native

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 9 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthClear

Clear all stored authentication data.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func AuthList

List all stored authentication identities.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Auth Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_AUTH_IDENTITY` | `lore_auth_identity_event_data_t` | Emitted once per stored identity |

func AuthLocalUserInfo

func AuthLocalUserInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreAuthLocalUserInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve user identities to display names from locally stored JWT tokens.

Decodes cached JWT tokens to extract display names. For user IDs without a local token, returns the raw user ID. For remote resolution with proper authorization, use `lore_auth_user_info` which queries the remote authentication service.

When `user_ids` is empty, the call resolves the current user: `globals.identity`, else the identity the repository's config records, else the first identity stored for the auth endpoint.

When `auth_endpoint` is empty, the call reads it from the repository's remote, and first refreshes an expired stored token unless the call supplies a token. The refresh contacts the auth service and replaces the stored tokens; a refused or failed refresh removes the stored refresh token.

Every identity is answered with an `AUTH_USER_INFO` event, and an identity with a locally stored token also with an `AUTH_USER_TOKEN` event. Its `token` holds the cached identity token when `with_identity_token` is set, and is empty otherwise.

With `globals.offline` set, or `globals.local` set and neither `with_access_token` nor `with_claims`, and an empty `auth_endpoint`, the identities resolve without connecting and no token is refreshed, from the stored logins whose token the domain of the repository's remote accepts. A supplied token is used as given. Without `globals.identity` or a recorded identity, the current user is the first such login at each auth URL. Without a supplied token, the call fails with `NotAuthenticated` when the current user has no such login, and a requested identity without one gets no `AUTH_USER_TOKEN` event. With `with_access_token` or `with_claims`, a `globals.offline` call fails with `NoRemote` after resolving the identities as above.

When `with_access_token` or `with_claims` is set, the call requires a repository and additionally emits one `AUTH_IDENTITY` event for the repository-scoped authorization (access) token of the current user. A valid cached token is reused. Otherwise a token exchange is performed against the auth service. The event's `token` holds the token when `with_access_token` is set, and its `claims` hold the token's claims as a JSON object when `with_claims` is set. Each is empty otherwise. With `with_claims`, the call fails with `NotSupported` when the token is not a JWT.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Auth Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_AUTH_USER_INFO` | `lore_auth_user_info_event_data_t` | Emitted with the resolved user id and display name | | `LORE_EVENT_AUTH_USER_TOKEN` | `lore_auth_user_token_event_data_t` | Emitted before `AUTH_USER_INFO` for an identity with a cached token, with the token details; `token` is empty unless `with_identity_token` is set | | `LORE_EVENT_AUTH_IDENTITY` | `lore_auth_identity_event_data_t` | Emitted when `with_access_token` or `with_claims` is set, with the repository-scoped authorization token and its claims as requested |

func AuthLoginInteractive

func AuthLoginInteractive(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreAuthLoginInteractiveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Authenticate interactively via a browser-based login flow.

With `reuse_session` set, a stored login whose session is still valid, as `session_valid` in `lore_auth_user_token_event_data_t` reports it, is returned without starting a new login.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Auth Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_AUTH_URL` | `lore_auth_url_event_data_t` | Emitted with the login URL when no_browser mode is requested, and whenever the login has a code the user may need to enter or confirm at that URL, browser or not. `user_code` holds the code, or is empty | | `LORE_EVENT_AUTH_PENDING` | `lore_auth_pending_event_data_t` | Emitted before each wait while the login awaits the user's approval, with the seconds elapsed, the seconds until the next poll, and the seconds left before the session expires. | | `LORE_EVENT_AUTH_USER_INFO` | `lore_auth_user_info_event_data_t` | Emitted with user id and display name after successful interactive authentication, or for the stored login it reuses |

func AuthLoginWithToken

func AuthLoginWithToken(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreAuthLoginWithTokenArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Authenticate using an existing bearer token, or, when `client_id` is set, as the

registered client it names with `client_secret`.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Auth Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_AUTH_USER_INFO` | `lore_auth_user_info_event_data_t` | Emitted with user id and display name after successful token authentication |

func AuthLogout

Remove stored authentication and authorization tokens.

Each login removed with its refresh token is then revoked if the auth service offers revocation. A failed revocation fails the call after the tokens are removed, so a non-zero return value or `LORE_EVENT_COMPLETE` status does not mean the tokens are still stored.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func AuthUserInfo

func AuthUserInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreAuthUserInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve user IDs to display names using the remote authentication service.

Requires an authenticated connection.

When no user IDs are provided, returns the current user's identity using locally cached tokens (equivalent to `lore_auth_local_user_info`).

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Auth Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_AUTH_USER_INFO` | `lore_auth_user_info_event_data_t` | Emitted with user id and display name for each resolved user |

func BranchArchive

func BranchArchive(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchArchiveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Archive a branch in the repository.

The current branch is refused with `LORE_ERROR_CODE_DELETE_CURRENT`. A layer or link that fails to archive the branch is logged as a warning naming its repository, and the call does not fail for it.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_ARCHIVE` | `lore_branch_archive_event_data_t` | Emitted when the branch has been successfully archived |

func BranchCreate

func BranchCreate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchCreateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Create a new branch in the repository, in the scope `scope` names by ID or by name, or without

one in the scope it inherits from its parent. Naming a scope asks the remote for it, and a scope the remote doesn't hold, or an archived one, fails before the branch is created. A create whose `id` names an archived branch restores it in the scope `scope` names, and without one the branch keeps its scope.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_CREATE` | `lore_branch_create_event_data_t` | Emitted when the branch has been successfully created, includes branch name and id | | `LORE_EVENT_BRANCH_SCOPE` | `lore_branch_scope_event_data_t` | Emitted after a create that doesn't restore the branch, with the scope it is created in or inherits, unless the local store fails to read the scope it inherits |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_BRANCH_CREATE` | `lore_link_branch_create_event_data_t` | Emitted once per linked repository mount, reporting whether its branch was created or an existing one reused |

func BranchDiff

Show the changes and conflicts between two branches.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_DIFF_BEGIN` | `lore_branch_diff_begin_event_data_t` | Emitted before diff results begin streaming. Includes the resolved branch names and revisions being compared | | `LORE_EVENT_BRANCH_DIFF_CHANGE_BEGIN` | `lore_branch_diff_change_begin_event_data_t` | Emitted before the list of changed files begins | | `LORE_EVENT_BRANCH_DIFF_CHANGE` | `lore_branch_diff_change_event_data_t` | Emitted for each changed file between the two branches | | `LORE_EVENT_BRANCH_DIFF_CHANGE_END` | `lore_branch_diff_change_end_event_data_t` | Emitted after all changed files have been reported | | `LORE_EVENT_BRANCH_DIFF_CONFLICT_BEGIN` | `lore_branch_diff_conflict_begin_event_data_t` | Emitted before the list of conflicting files begins | | `LORE_EVENT_BRANCH_DIFF_CONFLICT` | `lore_branch_diff_conflict_event_data_t` | Emitted for each file that has a conflict between the two branches | | `LORE_EVENT_BRANCH_DIFF_CONFLICT_END` | `lore_branch_diff_conflict_end_event_data_t` | Emitted after all conflict files have been reported | | `LORE_EVENT_BRANCH_DIFF_END` | `lore_branch_diff_end_event_data_t` | Emitted after all diff results have been streamed |

func BranchInfo

Retrieve metadata about a specific branch.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_INFO` | `lore_branch_info_event_data_t` | Emitted with branch metadata (name, id, category, protection status, etc.) | | `LORE_EVENT_BRANCH_SCOPE` | `lore_branch_scope_event_data_t` | Emitted after `BRANCH_INFO`, with the branch's scope, unless the local store fails to read the scope of a branch the remote doesn't hold |

func BranchLatestList added in v0.10.1

func BranchLatestList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchLatestListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List the revisions the LATEST of a branch has held, most recent first.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_LATEST_LIST_ENTRY` | `lore_branch_latest_list_entry_event_data_t` | Emitted for each revision the branch LATEST has held, most recent first |

func BranchList

List the local branches of the repository, or the remote's branches when `remote` is set in

`lore_global_args_t`. A remote listing ignores `archived` in `lore_branch_list_args_t`, and a remote that can't be reached or listed fails the call.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_LIST_BEGIN` | `lore_branch_list_begin_event_data_t` | Emitted before branch list entries begin streaming | | `LORE_EVENT_BRANCH_LIST_ENTRY` | `lore_branch_list_entry_event_data_t` | Emitted for each listed branch | | `LORE_EVENT_BRANCH_LIST_END` | `lore_branch_list_end_event_data_t` | Emitted after all branch entries have been streamed |

func BranchMergeAbort

func BranchMergeAbort(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeAbortArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Abort an in-progress branch merge and restore the pre-merge state.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_ABORT_BEGIN` | `lore_branch_merge_abort_begin_event_data_t` | Emitted when aborting a branch merge, includes staged and current revision hashes | | `LORE_EVENT_BRANCH_MERGE_ABORT_END` | `lore_branch_merge_abort_end_event_data_t` | Emitted after the merge abort has been completed | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization while reverting merge changes |

func BranchMergeConflictsList added in v0.15.0

func BranchMergeConflictsList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeConflictsListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List every conflict the open merge still holds, files and link rows alike.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_CONFLICT_FILE` | `lore_branch_merge_conflict_file_event_data_t` | Emitted for each file still in conflict | | `LORE_EVENT_BRANCH_MERGE_LINK_PIN_CONFLICT` | `lore_branch_merge_link_pin_conflict_event_data_t` | Emitted for each link row still awaiting a side |

func BranchMergeInto

func BranchMergeInto(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeIntoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Merge the current branch into a target branch.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_INTO_FILE_BEGIN` | `lore_branch_merge_into_file_begin_event_data_t` | Emitted when starting to merge files into the target branch | | `LORE_EVENT_BRANCH_MERGE_INTO_FILE` | `lore_branch_merge_into_file_event_data_t` | Emitted for each file being merged into the target branch | | `LORE_EVENT_BRANCH_MERGE_INTO_FILE_END` | `lore_branch_merge_into_file_end_event_data_t` | Emitted after all files have been merged | | `LORE_EVENT_BRANCH_MERGE_INTO_FRAGMENT_BEGIN` | `lore_branch_merge_into_fragment_begin_event_data_t` | Emitted when starting fragment transfer for a file | | `LORE_EVENT_BRANCH_MERGE_INTO_FRAGMENT_PROGRESS` | `lore_branch_merge_into_fragment_progress_event_data_t` | Emitted periodically during fragment transfer | | `LORE_EVENT_BRANCH_MERGE_INTO_FRAGMENT_END` | `lore_branch_merge_into_fragment_end_event_data_t` | Emitted when fragment transfer for a file completes | | `LORE_EVENT_BRANCH_MERGE_INTO_REVISION` | `lore_branch_merge_into_revision_event_data_t` | Emitted with the resulting revision after the merge into is complete | | `LORE_EVENT_BRANCH_MERGE_INTO_SYNC_BEGIN` | `lore_branch_merge_into_sync_begin_event_data_t` | Emitted when starting to apply the changes on the target state | | `LORE_EVENT_BRANCH_MERGE_INTO_SYNC_END` | `lore_branch_merge_into_sync_end_event_data_t` | Emitted after applying the changes on the target state is complete | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-commit starts (if no conflicts) | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted periodically during auto-commit file processing | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit file processing completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed revision details | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during changes realization | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata entry of the committed revision | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for each file fragment written or deduplicated during commit |

func BranchMergeResolve

func BranchMergeResolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeResolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Mark conflicting files in a merge as resolved.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_RESOLVE_FILE` | `lore_branch_merge_resolve_file_event_data_t` | Emitted for each file that was marked as resolved | | `LORE_EVENT_BRANCH_MERGE_LINK_PIN_RESOLVED` | `lore_branch_merge_link_pin_resolved_event_data_t` | Emitted for each link row settled, naming the side it was settled to | | `LORE_EVENT_BRANCH_MERGE_RESOLVE_REVISION` | `lore_branch_merge_resolve_revision_event_data_t` | Emitted with the updated staged revision after resolve completes |

func BranchMergeResolveMine

func BranchMergeResolveMine(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeResolveMineArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a merge conflict by accepting the "mine" version of each conflicting file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_RESOLVE_FILE` | `lore_branch_merge_resolve_file_event_data_t` | Emitted for each file resolved by keeping "mine" | | `LORE_EVENT_BRANCH_MERGE_LINK_PIN_RESOLVED` | `lore_branch_merge_link_pin_resolved_event_data_t` | Emitted for each link row settled, naming the side it was settled to | | `LORE_EVENT_BRANCH_MERGE_RESOLVE_REVISION` | `lore_branch_merge_resolve_revision_event_data_t` | Emitted with the updated staged revision |

func BranchMergeResolveTheirs

func BranchMergeResolveTheirs(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeResolveTheirsArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a merge conflict by accepting the "theirs" version of each conflicting file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_RESOLVE_FILE` | `lore_branch_merge_resolve_file_event_data_t` | Emitted for each file resolved by keeping "theirs" | | `LORE_EVENT_BRANCH_MERGE_LINK_PIN_RESOLVED` | `lore_branch_merge_link_pin_resolved_event_data_t` | Emitted for each link row settled, naming the side it was settled to | | `LORE_EVENT_BRANCH_MERGE_RESOLVE_REVISION` | `lore_branch_merge_resolve_revision_event_data_t` | Emitted with the updated staged revision |

func BranchMergeRestart

func BranchMergeRestart(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeRestartArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Restart an in-progress merge, re-materializing conflicted files.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_CONFLICT_FILE` | `lore_branch_merge_conflict_file_event_data_t` | Emitted for each file with a remaining merge conflict | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization during restart | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file re-materialized during restart |

func BranchMergeStart

func BranchMergeStart(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeStartArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Start a merge from another branch into the current branch.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_START_BEGIN` | `lore_branch_merge_start_begin_event_data_t` | Emitted when merge begins, includes source branch and revision info | | `LORE_EVENT_BRANCH_MERGE_START_END` | `lore_branch_merge_start_end_event_data_t` | Emitted when merge operation completes, includes sync stats and conflict flag | | `LORE_EVENT_BRANCH_MERGE_CONFLICT_FILE` | `lore_branch_merge_conflict_file_event_data_t` | Emitted for each file with an unresolved merge conflict | | `LORE_EVENT_BRANCH_MERGE_LINK_PIN_CONFLICT` | `lore_branch_merge_link_pin_conflict_event_data_t` | Emitted for each link row both branches changed, which the merge holds open | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during the apply_diff phase of the merge | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file modified during merge realization | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged for deletion during merge realization | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-commit starts (no conflicts, no_commit=false) | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted periodically during auto-commit | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit file processing completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed revision details | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata entry of the committed revision | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for each fragment written during auto-commit |

func BranchMergeUnresolve

func BranchMergeUnresolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMergeUnresolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Mark conflicting files in a merge as unresolved.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_MERGE_UNRESOLVE_FILE` | `lore_branch_merge_unresolve_file_event_data_t` | Emitted for each file that was marked as unresolved | | `LORE_EVENT_BRANCH_MERGE_UNRESOLVE_REVISION` | `lore_branch_merge_unresolve_revision_event_data_t` | Emitted with the updated staged revision after unresolve completes |

func BranchMetadataClear

func BranchMetadataClear(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMetadataClearArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)

Clear branch metadata keys.

func BranchMetadataGet

func BranchMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)

Retrieve branch metadata.

func BranchMetadataSet

func BranchMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)

Set branch metadata key-value pairs.

func BranchProtect

func BranchProtect(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchProtectArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Enable write protection on a branch to prevent direct commits.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_PROTECT` | `lore_branch_protect_event_data_t` | Emitted when the branch has been successfully protected |

func BranchPush

Push local branch commits to the remote repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_PUSH` | `lore_branch_push_event_data_t` | Emitted when push begins, includes branch name and revision info | | `LORE_EVENT_BRANCH_PUSH_BRANCH_CREATE_BEGIN` | `lore_branch_push_branch_create_begin_event_data_t` | Emitted when creating the remote branch (first push) | | `LORE_EVENT_BRANCH_PUSH_BRANCH_CREATE_END` | `lore_branch_push_branch_create_end_event_data_t` | Emitted when remote branch creation completes | | `LORE_EVENT_BRANCH_PUSH_REVISION_UPDATE_BEGIN` | `lore_branch_push_revision_update_begin_event_data_t` | Emitted when updating a revision on the remote | | `LORE_EVENT_BRANCH_PUSH_REVISION_UPDATE_END` | `lore_branch_push_revision_update_end_event_data_t` | Emitted when a revision update completes | | `LORE_EVENT_BRANCH_PUSH_FRAGMENT_BEGIN` | `lore_branch_push_fragment_begin_event_data_t` | Emitted when uploading fragment data begins | | `LORE_EVENT_BRANCH_PUSH_FRAGMENT_PROGRESS` | `lore_branch_push_fragment_progress_event_data_t` | Emitted periodically during fragment upload | | `LORE_EVENT_BRANCH_PUSH_FRAGMENT_END` | `lore_branch_push_fragment_end_event_data_t` | Emitted when fragment upload completes | | `LORE_EVENT_BRANCH_PUSH_REVISION_PUSH_BEGIN` | `lore_branch_push_revision_push_begin_event_data_t` | Emitted when pushing a revision to the remote begins | | `LORE_EVENT_BRANCH_PUSH_REVISION_PUSH_UPDATE` | `lore_branch_push_revision_push_update_event_data_t` | Emitted with progress updates during revision push | | `LORE_EVENT_BRANCH_PUSH_REVISION_PUSH_END` | `lore_branch_push_revision_push_end_event_data_t` | Emitted when revision push completes |

func BranchReset

func BranchReset(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchResetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Reset the current branch to a specific revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_RESET` | `lore_branch_reset_event_data_t` | Emitted when the branch has been reset to the target revision |

func BranchSwitch

func BranchSwitch(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchSwitchArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Switch to a different branch and update the working directory.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_SWITCH_BEGIN` | `lore_branch_switch_begin_event_data_t` | Emitted when branch switch starts | | `LORE_EVENT_BRANCH_SWITCH_END` | `lore_branch_switch_end_event_data_t` | Emitted when branch switch completes successfully | | `LORE_EVENT_REVISION_SYNC_TARGET` | `lore_revision_sync_target_event_data_t` | Emitted with target revision info after resolving the switch target | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file modified/added/deleted during switch | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted periodically during file realization | | `LORE_EVENT_REVISION_SYNC_REVISION` | `lore_revision_sync_revision_event_data_t` | Emitted with the resulting revision after switch | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by view or ignore filters | | `LORE_EVENT_REVISION_RESOLVE` | `lore_revision_resolve_event_data_t` | Emitted when resolving a revision number |

func BranchUnprotect

func BranchUnprotect(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreBranchUnprotectArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove write protection from a branch.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Branch Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_UNPROTECT` | `lore_branch_unprotect_event_data_t` | Emitted when the branch has been successfully unprotected |

func FileAudit added in v0.11.0

Attribute each line of a file to the revision that last changed it.

One `LORE_EVENT_FILE_AUDIT` event carries each range of consecutive lines sharing an attribution. Each range arrives as soon as the step of the walk that resolves it ends. The walk resolves the most recently changed lines first, so ranges arrive in that order, not in line order. Each range is complete and never needs joining with another. A caller with what it needs may stop reading; the events already delivered stand.

A range names its revision and repository, not the revision's metadata. Read the metadata with `lore_revision_info`, once per distinct revision.

An error that ends the walk, such as a lost connection to the remote, ends the audit: every line is still delivered, those the walk did not reach with the outcome `LORE_FILE_AUDIT_OUTCOME_UNRESOLVED`, and `LORE_EVENT_COMPLETE` carries the error.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_AUDIT` | `lore_file_audit_event_data_t` | Emitted for each range of consecutive lines sharing an attribution |

func FileDependencyAdd

func FileDependencyAdd(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileDependencyAddArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Adds dependency relationships between files.

Fails with error code 9 (not supported) when a path is inside a link, and changes nothing.

Events

## Standard Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Dependency Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_DEPENDENCY_ADD_BEGIN` | `lore_file_dependency_add_begin_event_data_t` | Start of operation | | `LORE_EVENT_FILE_DEPENDENCY_ADD_ENTRY` | `lore_file_dependency_add_entry_event_data_t` | Each dependency added | | `LORE_EVENT_FILE_DEPENDENCY_ADD_END` | `lore_file_dependency_add_end_event_data_t` | Operation complete |

func FileDependencyList

func FileDependencyList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileDependencyListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Queries dependency information for files.

Fails with error code 9 (not supported) when a path is inside a link.

Events

## Standard Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Dependency Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_DEPENDENCY_LIST_BEGIN` | `lore_file_dependency_list_begin_event_data_t` | Start of listing | | `LORE_EVENT_FILE_DEPENDENCY_LIST_FILE` | `lore_file_dependency_list_file_event_data_t` | Start of entries for one file | | `LORE_EVENT_FILE_DEPENDENCY_LIST_ENTRY` | `lore_file_dependency_list_entry_event_data_t` | One dependency entry | | `LORE_EVENT_FILE_DEPENDENCY_LIST_FILE_END` | `lore_file_dependency_list_file_end_event_data_t` | End of entries for one file | | `LORE_EVENT_FILE_DEPENDENCY_LIST_END` | `lore_file_dependency_list_end_event_data_t` | End of listing |

func FileDependencyRemove

func FileDependencyRemove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileDependencyRemoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Removes dependency relationships between files.

Fails with error code 9 (not supported) when a path is inside a link, and changes nothing.

Events

## Standard Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Dependency Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_DEPENDENCY_REMOVE_BEGIN` | `lore_file_dependency_remove_begin_event_data_t` | Start of operation | | `LORE_EVENT_FILE_DEPENDENCY_REMOVE_ENTRY` | `lore_file_dependency_remove_entry_event_data_t` | Each dependency removed | | `LORE_EVENT_FILE_DEPENDENCY_REMOVE_END` | `lore_file_dependency_remove_end_event_data_t` | Operation complete |

func FileDiff

Show which files differ between two revisions.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_DIFF` | `lore_file_diff_event_data_t` | Emitted for each file that differs between the two revisions |

func FileDirty

Mark files as dirty in the staged state without staging their content.

Action is determined by checking filesystem existence and current revision state (modify, add, delete, or revert-add). Respects ignore and view filters. With `check_dirty`, a file the current revision holds is marked modified only where its name as the file system spells it differs from the name Lore holds for it, a rename marked with `lore dirty move` included, its size or its mode from that revision, or its modified time from its modified-time record, and a file that matches has its dirty mark cleared, unless it is staged or marked moved, or lies in a folder of a linked repository that another link also mounts.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_PATH_IGNORE` | `lore_path_ignore_event_data_t` | Emitted for each input path that could not be resolved to a repository-relative path | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by view or ignore filters |

func FileDirtyCopy

func FileDirtyCopy(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileDirtyCopyArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Mark a file as dirty-copied from one path to another in the staged state.

Creates a new destination node flagged `DirtyCopy`; the source node is unchanged. No filesystem access is performed.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func FileDirtyMove

func FileDirtyMove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileDirtyMoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Mark a file as dirty-moved from one path to another in the staged state.

Updates the source node's parent/name and flags it with `DirtyMove`, propagating `Dirty` to both the old and new parent directories. For directories, the move is propagated recursively to children. The destination path then names the moved node. A node the destination held is marked deleted, at the destination, or at its committed path where a dirty move had put it at the destination; one holding a staged change is staged for deletion. A destination that is a link's mount fails with `NotSupported`. A move onto a directory a dirty move put there whose committed directory now lies inside it, or onto a node one put there whose committed directory is gone, or onto a directory only marked added holding a node whose committed path another unstaged node holds, fails with an internal error, the staged state unchanged; `lore_file_stage_move` takes such a move. No filesystem access is performed.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

Emitted only where the node the destination held holds a staged change:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_STAGE_BEGIN` | `lore_file_stage_begin_event_data_t` | Emitted when the staging of its deletion begins | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file of it staged for deletion | | `LORE_EVENT_FILE_STAGE_END` | `lore_file_stage_end_event_data_t` | Emitted when the staging of its deletion completes |

func FileDump

Retrieve the binary content of a file at a specific revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_DUMP` | `lore_file_dump_event_data_t` | Emitted with binary content of the requested file |

func FileHash

Compute the hash of a local file for comparison with repository content.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_HASH` | `lore_file_hash_event_data_t` | Emitted with the computed hash and size of the specified file |

func FileHistory

func FileHistory(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileHistoryArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve the revision history for a specific file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_HISTORY` | `lore_file_history_event_data_t` | Emitted for each revision in which the file was modified |

func FileInfo

Retrieve metadata for one or more files in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_INFO` | `lore_file_info_event_data_t` | Emitted for each file with its metadata (size, hash, staged status, etc.) |

func FileMetadataClear

func FileMetadataClear(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileMetadataClearArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Clear all metadata from a file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA_CLEAR_FILE` | `lore_metadata_clear_file_event_data_t` | Emitted when metadata has been cleared for the file |

func FileMetadataGet

func FileMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Get a specific metadata key/value pair from a file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for the requested metadata key/value pair |

func FileMetadataList

func FileMetadataList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileMetadataListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List all metadata key/value pairs associated with a file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata key/value pair associated with the file |

func FileMetadataSet

func FileMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Set a metadata key/value pair on a file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func FileObliterate

func FileObliterate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileObliterateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Permanently remove a file and all its history from the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_OBLITERATE` | `lore_file_obliterate_event_data_t` | Emitted for each file permanently removed from repository history |

func FileReset

Reset files to the state recorded in the current or target revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_RESET_BEGIN` | `lore_file_reset_begin_event_data_t` | Emitted when reset starts, includes path count | | `LORE_EVENT_FILE_RESET_PROGRESS` | `lore_file_reset_progress_event_data_t` | Emitted periodically during file reset with progress counts | | `LORE_EVENT_FILE_RESET_END` | `lore_file_reset_end_event_data_t` | Emitted when reset completes | | `LORE_EVENT_FILE_RESET_FILE` | `lore_file_reset_file_event_data_t` | Emitted for each file that was reset | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file materialized | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by filters |

func FileResetToLastMerged

func FileResetToLastMerged(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileResetToLastMergedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Reset files to their state at the last merged revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_RESET_BEGIN` | `lore_file_reset_begin_event_data_t` | Emitted when reset starts | | `LORE_EVENT_FILE_RESET_PROGRESS` | `lore_file_reset_progress_event_data_t` | Emitted periodically during file reset | | `LORE_EVENT_FILE_RESET_END` | `lore_file_reset_end_event_data_t` | Emitted when reset completes | | `LORE_EVENT_FILE_RESET_FILE` | `lore_file_reset_file_event_data_t` | Emitted for each file that was reset | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file materialized |

func FileStage

Stage files for the next commit.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_STAGE_BEGIN` | `lore_file_stage_begin_event_data_t` | Emitted when staging begins, includes path count | | `LORE_EVENT_FILE_STAGE_PROGRESS` | `lore_file_stage_progress_event_data_t` | Emitted periodically during staging with file counts | | `LORE_EVENT_FILE_STAGE_END` | `lore_file_stage_end_event_data_t` | Emitted when staging completes | | `LORE_EVENT_FILE_STAGE_REVISION` | `lore_file_stage_revision_event_data_t` | Emitted with the resulting staged revision | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged or staged for deletion | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by filters |

func FileStageMerge

func FileStageMerge(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileStageMergeArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Stage files for a merge commit, recording resolved merge content.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_STAGE_BEGIN` | `lore_file_stage_begin_event_data_t` | Emitted when merge-staging begins | | `LORE_EVENT_FILE_STAGE_PROGRESS` | `lore_file_stage_progress_event_data_t` | Emitted periodically during merge-staging | | `LORE_EVENT_FILE_STAGE_REVISION` | `lore_file_stage_revision_event_data_t` | Emitted with the resulting staged revision | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged |

func FileStageMove

func FileStageMove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileStageMoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Stage a file move (rename) operation for commit.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_STAGE_BEGIN` | `lore_file_stage_begin_event_data_t` | Emitted when move staging begins | | `LORE_EVENT_FILE_STAGE_END` | `lore_file_stage_end_event_data_t` | Emitted when move staging completes | | `LORE_EVENT_FILE_STAGE_REVISION` | `lore_file_stage_revision_event_data_t` | Emitted with the resulting staged revision | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged (deletion of original and new path) |

func FileUnstage

func FileUnstage(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreFileUnstageArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove files from the staging area without discarding local changes.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_UNSTAGE_BEGIN` | `lore_file_unstage_begin_event_data_t` | Emitted when unstage begins, includes path count | | `LORE_EVENT_FILE_UNSTAGE_PROGRESS` | `lore_file_unstage_progress_event_data_t` | Emitted periodically during unstaging | | `LORE_EVENT_FILE_UNSTAGE_END` | `lore_file_unstage_end_event_data_t` | Emitted when unstaging completes | | `LORE_EVENT_FILE_UNSTAGE_REVISION` | `lore_file_unstage_revision_event_data_t` | Emitted with the resulting staged revision | | `LORE_EVENT_FILE_UNSTAGE_FILE` | `lore_file_unstage_file_event_data_t` | Emitted for each file that was unstaged |

func FileWrite

Write binary content to a file in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## File Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_FILE_WRITE` | `lore_file_write_event_data_t` | Emitted when the file has been successfully written to the repository |

func LayerAdd

Add a new layer to the repository configuration.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Layer Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LAYER_ADD` | `lore_layer_add_event_data_t` | Emitted when a layer has been successfully added |

func LayerList

List all layers configured in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Layer Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LAYER_ENTRY` | `lore_layer_entry_event_data_t` | Emitted for each layer configured in the repository |

func LayerRemove

func LayerRemove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLayerRemoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove a layer from the repository configuration.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func LinkAdd

Add a link to another repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_CLONE_BEGIN` | `lore_repository_clone_begin_event_data_t` | Emitted when cloning a linked repository begins | | `LORE_EVENT_REPOSITORY_CLONE_END` | `lore_repository_clone_end_event_data_t` | Emitted when cloning a linked repository completes | | `LORE_EVENT_LINK_BRANCH_CREATE` | `lore_link_branch_create_event_data_t` | Emitted when branching is enabled, reporting whether the link's branch was created or an existing one reused | | `LORE_EVENT_LINK_CHANGE` | `lore_link_change_event_data_t` | Emitted when the link has been added and saved |

func LinkInfo added in v0.9.0

Report detailed information about a single repository link.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_INFO` | `lore_link_info_event_data_t` | Emitted once for the described link |

List all repository links configured in the current repository.

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_ENTRY` | `lore_link_entry_event_data_t` | Emitted for each linked repository |

func LinkListStaged added in v0.10.1

func LinkListStaged(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLinkListStagedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List the links whose linked repositories hold staged changes, including nested links.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_STAGED_ENTRY` | `lore_link_staged_entry_event_data_t` | Emitted for each link with staged changes |

func LinkRemove

Remove a link to another repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_CHANGE` | `lore_link_change_event_data_t` | Emitted when the link has been removed |

func LinkUpdate

Update properties of an existing repository link.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Link Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LINK_CHANGE` | `lore_link_change_event_data_t` | Emitted when a link property is updated or finalized |

func LockFileAcquire

func LockFileAcquire(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLockFileAcquireArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Acquire exclusive locks on one or more files in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Lock Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOCK_FILE_ACQUIRE` | `lore_lock_file_acquire_event_data_t` | Emitted for each file for which a lock was successfully acquired | | `LORE_EVENT_LOCK_FILE_ACQUIRE_IGNORE` | `lore_lock_file_acquire_ignore_event_data_t` | Emitted for each file for which a lock was ignored (already owned) |

func LockFileQuery

func LockFileQuery(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLockFileQueryArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Query which files are currently locked, optionally filtered by user or path.

A `path` without a `branch` in `lore_lock_file_query_args_t` queries the current branch. A query giving both `owner` and `path` fails with `LORE_ERROR_CODE_INVALID_ARGUMENTS` before the remote is asked.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Lock Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOCK_FILE_QUERY_BEGIN` | `lore_lock_file_query_begin_event_data_t` | Emitted before query results begin streaming | | `LORE_EVENT_LOCK_FILE_QUERY` | `lore_lock_file_query_event_data_t` | Emitted for each file matching the query |

func LockFileRelease

func LockFileRelease(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLockFileReleaseArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Release file locks previously acquired by this client.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Lock Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOCK_FILE_RELEASE` | `lore_lock_file_release_event_data_t` | Emitted for each file lock successfully released | | `LORE_EVENT_LOCK_FILE_RELEASE_NOT_FOUND` | `lore_lock_file_release_not_found_event_data_t` | Emitted for each file whose lock was not found |

func LockFileStatus

func LockFileStatus(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreLockFileStatusArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Get the lock status of files in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Lock Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOCK_FILE_STATUS_BEGIN` | `lore_lock_file_status_begin_event_data_t` | Emitted before lock status results begin streaming | | `LORE_EVENT_LOCK_FILE_STATUS` | `lore_lock_file_status_event_data_t` | Emitted for each locked file with owner and lock details |

func LogConfigure

func LogConfigure(logConfig *types.LoreLogConfigFFI) (int32, error)

func NotificationSubscribe

func NotificationSubscribe(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreNotificationSubscribeArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Subscribe to repository notifications.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Notification Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_NOTIFICATION_SUBSCRIBED` | `lore_notification_subscribed_event_data_t` | Emitted when successfully subscribed to repository notifications | | `LORE_EVENT_NOTIFICATION_BRANCH_CREATED` | `lore_notification_branch_created_event_data_t` | Emitted when a branch is created in the repository (push notification) | | `LORE_EVENT_NOTIFICATION_BRANCH_DELETED` | `lore_notification_branch_deleted_event_data_t` | Emitted when a branch is deleted in the repository (push notification) | | `LORE_EVENT_NOTIFICATION_BRANCH_PUSHED` | `lore_notification_branch_pushed_event_data_t` | Emitted when a branch is pushed to (push notification) | | `LORE_EVENT_NOTIFICATION_RESOURCE_LOCKED` | `lore_notification_resource_locked_event_data_t` | Emitted when a resource is locked (push notification) | | `LORE_EVENT_NOTIFICATION_RESOURCE_UNLOCKED` | `lore_notification_resource_unlocked_event_data_t` | Emitted when a resource is unlocked (push notification) |

func NotificationUnsubscribe

func NotificationUnsubscribe(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreNotificationUnsubscribeArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Unsubscribe from repository notifications.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Notification Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_NOTIFICATION_UNSUBSCRIBED` | `lore_notification_unsubscribed_event_data_t` | Emitted when successfully unsubscribed from repository notifications |

func RepositoryClone

func RepositoryClone(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryCloneArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Clone a remote repository to a local path.

A clone needs the remote, so the `offline` global argument does not keep it from connecting: it prepares the clone for working offline instead. With `offline` or `cache`, a clone that writes its files caches every file metadata block of the cloned revision, which staging and committing write to, so both work without the remote, and fails if it cannot. A bare or virtual clone writes no files and reads them from the remote when a call needs them.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_CLONE_BEGIN` | `lore_repository_clone_begin_event_data_t` | Emitted when clone begins, includes remote URL and target path | | `LORE_EVENT_REPOSITORY_CLONE_PROGRESS` | `lore_repository_clone_progress_event_data_t` | Emitted periodically during clone with progress data | | `LORE_EVENT_REPOSITORY_CLONE_END` | `lore_repository_clone_end_event_data_t` | Emitted only when the clone succeeds; `LORE_EVENT_COMPLETE` reports the outcome of every clone | | `LORE_EVENT_REPOSITORY_INSTANCE` | `lore_repository_instance_event_data_t` | Over a shared store, one for each instance registration the clone prunes, as `lore_repository_instance_prune` reports it | | `LORE_EVENT_REVISION_SYNC_TARGET` | `lore_revision_sync_target_event_data_t` | Emitted after resolving the target revision to sync during clone | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file written during initial sync | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted periodically during initial file sync | | `LORE_EVENT_REVISION_SYNC_REVISION` | `lore_revision_sync_revision_event_data_t` | Emitted with the resulting revision | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by view filters | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for each fragment written to the local store |

func RepositoryConfigGet

func RepositoryConfigGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryConfigGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)

Read a configuration value of the current repository by key.

func RepositoryCreate

func RepositoryCreate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryCreateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Create a new Lore repository on the remote server.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_CREATE` | `lore_repository_create_event_data_t` | Emitted when the repository has been successfully created |

func RepositoryDelete added in v0.10.1

func RepositoryDelete(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryDeleteArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Delete a Lore repository on the remote server.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RepositoryDump

func RepositoryDump(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryDumpArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Dump the internal state of the repository for diagnostic purposes.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_DUMP_BEGIN` | `lore_repository_dump_begin_event_data_t` | Emitted before dump output begins | | `LORE_EVENT_REPOSITORY_DUMP_END` | `lore_repository_dump_end_event_data_t` | Emitted when dump completes | | `LORE_EVENT_REPOSITORY_STATE_DUMP` | `lore_repository_state_dump_event_data_t` | Emitted with repository state summary | | `LORE_EVENT_REPOSITORY_STATE_DUMP_NODE` | `lore_repository_state_dump_node_event_data_t` | Emitted for each node in the state tree |

func RepositoryFlush

func RepositoryFlush(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryFlushArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Flush pending repository state to persistent storage.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RepositoryGc

func RepositoryGc(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryGcArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Run garbage collection to reclaim unreferenced storage in the repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RepositoryInfo

func RepositoryInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve metadata about the current repository.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_DATA` | `lore_repository_data_event_data_t` | Emitted with repository metadata (name, URL, branch info, etc.) |

func RepositoryInstanceClone added in v0.14.0

func RepositoryInstanceClone(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInstanceCloneArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Clone the current repository instance to `args->target_path`, sharing its data blocks where

the destination allows it, and register the clone as an instance of its own on the same revision, branch and staged state. The clone holds the instance's and the store's locks while it copies, so other calls on the instance, and calls from other processes on the store, that open the store wait for it. An instance delete waits too, since it opens the store to deregister the instance before it removes any file. An instance move renames the instance before it opens the store, so a move makes the clone fail, or on Windows is refused while the clone lists one of its directories. `LORE_EVENT_REPOSITORY_INSTANCE_CLONE_BEGIN` says how the clone is made, once the instance's store and the destination have passed their checks and before any of the instance is copied; a refusal before that, of the store or the destination, comes only with the completion. Delivers `LORE_EVENT_REPOSITORY_INSTANCE_CLONE_PROGRESS` per phase, and each event interval (`globals->event_interval_ms`) while it copies, and `LORE_EVENT_REPOSITORY_INSTANCE_CLONE_COMPLETE`, which names the new instance.

Fails with: - error code 9 (not supported) for a clone that cannot share blocks while `args->allow_copy` is zero, refused before anything is copied or, for an entry that turns out not to share blocks, partway through the copy; and for an instance with a local store or a virtual clone, whatever `args->allow_copy` is; - error code 3 (invalid arguments) for a destination that exists before the clone moves into place, names no directory, has no parent directory that can be resolved, has a name too long for the directory the clone writes beside it, is nested in another instance or a virtual clone's mount, or is where another live instance is registered (a registration the local store can't read, which a `LORE_EVENT_LOG` warning counts, names none), and where a path inside the copy is taken while the clone writes it; - error code 4 (invalid path) where the instance's Lore directory lies outside its tree; - error code 118 (oversized) for a copy the destination has no room for, and where a volume the clone writes fills while it runs; - error code 82 (file not found) where the instance, or an entry the clone needs, is moved or removed while it is copied.

Failures every repository call can report, such as code 89 (repository not found), are reported as for those calls; any other failure of the clone is internal.

A failure while the clone registers itself, after it is at `args->target_path`, leaves the instance there; it registers itself when a write command next opens it. A failure before that leaves nothing at `args->target_path`: the call returns once it has tried to remove what the clone copied, which takes minutes for a large tree; what it cannot remove the next clone to the same destination removes.

With `dry_run` set in `globals`, runs the checks that take no lock, sending `LORE_EVENT_REPOSITORY_INSTANCE_CLONE_BEGIN` as the clone does, fails as the clone would where one of those checks refuses it, and otherwise sends a `LORE_EVENT_REPOSITORY_INSTANCE_CLONE_COMPLETE` with a zero instance ID, and writes nothing but the probe files it removes again. The checks for another live instance registered at the destination and for a branch to clone need the store, so only the clone itself makes them.

func RepositoryInstanceDelete added in v0.13.0

func RepositoryInstanceDelete(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInstanceDeleteArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Delete the current repository instance: unmount (if SWFS and in service),

deregister from the mutable store, and delete associated directories. With `dry_run` set in `globals`, emits events describing what would be deleted without performing any changes.

func RepositoryInstanceList

func RepositoryInstanceList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInstanceListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List the registered instances of the repository, each through a

`LORE_EVENT_REPOSITORY_INSTANCE` event. A registration whose data is missing from the local store, malformed, or can't be read is left out, and a `LORE_EVENT_LOG` warning counts those left out of each kind.

func RepositoryInstanceMove added in v0.13.0

func RepositoryInstanceMove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInstanceMoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Move the current repository instance to a new path: update registry metadata

and remap mount (for SWFS in service context) or move directory (for regular instances). With `dry_run` set in `globals`, checks that the move can be made without performing it.

func RepositoryInstancePrune

func RepositoryInstancePrune(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryInstancePruneArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove stale instances of the repository: those whose path no longer

exists, those whose path holds no checkout, and those whose path now holds a repository naming a different current instance. Each removed instance is reported through a `LORE_EVENT_REPOSITORY_INSTANCE` event whose `stale` field gives the reason. Also removes each registration whose data is missing from the local store or malformed, reported with `stale` 4, and, where it finds any, then registers the current instance again where it has no registration. Under `globals.dry_run` the call removes and registers nothing and still reports each such registration.

func RepositoryList

func RepositoryList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List all repositories available on the remote server.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_LIST_ENTRY` | `lore_repository_list_entry_event_data_t` | Emitted for each repository found |

func RepositoryMetadataClear

func RepositoryMetadataClear(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryMetadataClearArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Clear repository metadata keys. Clears all user-defined keys when none are

given.

func RepositoryMetadataGet

func RepositoryMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve repository metadata. Reads a single key, or all entries when no

key is given.

func RepositoryMetadataSet

func RepositoryMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)

Set repository metadata key-value pairs.

func RepositoryRelease

func RepositoryRelease(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryReleaseArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Release all cached store references for the given repository path.

Frees cached in-memory store data. Disk-backed stores are not forced closed: each is released once nothing uses it, and a later open reuses one that is still alive, which the store epoch keeps current with what other processes wrote. Any active repository contexts for this path remain valid.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RepositoryRename added in v0.15.0

func RepositoryRename(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryRenameArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Rename a Lore repository on the remote server to `name` in `lore_repository_rename_args_t`.

The repository keeps its ID.

`repository_url` is a URL, or a repository name or ID on the remote of the repository at `repository_path` in `lore_global_args_t`. An ID is sent as is. When `repository_url` is empty, the call renames the repository of the instance at `repository_path`.

On failure, `status` is error code 9 (not supported) when the remote cannot rename repositories, and error code 54 (rename incomplete) when the remote can have stopped the rename after its checks passed. Error codes 28 (disconnected) and 31 (slow down) can also follow a rename the remote started. The same rename, made again, completes it, and a rename back to the old name abandons it. A repeat that fails because another repository holds the new name is abandoned in the same way, by a rename back to the old name. Make the repeat by URL and ID, `<remote_url>/<id>`, which the message of error code 54 names: a repeat by the old name can fail, since the remote can already have released that name. A caller that must repeat without reading the message addresses the repository by URL and ID from the start, as `lore_repository_info` reports them.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_ERROR` | `lore_error_event_data_t` | Emitted for a non-fatal error during the operation | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RepositoryStatus

func RepositoryStatus(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryStatusArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Show the working directory status, including staged, dirty, and conflicted files.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_STATUS_REVISION` | `lore_repository_status_revision_event_data_t` | Emitted with current and staged revision info | | `LORE_EVENT_REPOSITORY_STATUS_FILE` | `lore_repository_status_file_event_data_t` | Emitted for each file with pending changes, conflict status, or untracked status | | `LORE_EVENT_PATH_IGNORE` | `lore_path_ignore_event_data_t` | Emitted for each path excluded by ignore rules |

func RepositoryStoreImmutableQuery

func RepositoryStoreImmutableQuery(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryStoreImmutableQueryArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Query the repository's immutable fragment store.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_STORE_IMMUTABLE_QUERY` | `lore_repository_store_immutable_query_event_data_t` | Emitted for each fragment entry found in the immutable store |

func RepositoryUpdatePath

func RepositoryUpdatePath(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryUpdatePathArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Update the recorded path of the current repository instance to its present

location.

func RepositoryVerifyState

func RepositoryVerifyState(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRepositoryVerifyStateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Verify the integrity of the repository's stored fragments.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Repository Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REPOSITORY_VERIFY_STATE_BEGIN` | `lore_repository_verify_state_begin_event_data_t` | Emitted when verify begins | | `LORE_EVENT_REPOSITORY_VERIFY_STATE_END` | `lore_repository_verify_state_end_event_data_t` | Emitted when verify completes (success or with errors) | | `LORE_EVENT_REPOSITORY_VERIFY_FRAGMENT` | `lore_repository_verify_fragment_event_data_t` | Emitted for each fragment verified in the local store | | `LORE_EVENT_REPOSITORY_VERIFY_FRAGMENT_REMOTE` | `lore_repository_verify_fragment_remote_event_data_t` | Emitted for each fragment verified against the remote store |

func RevisionAmend

func RevisionAmend(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionAmendArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Amend the most recent revision with updated metadata.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the amended revision details | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata entry of the amended revision |

func RevisionBisect added in v0.10.1

func RevisionBisect(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionBisectArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Take one step of a bisect between two revisions, synchronizing the working directory to the

revision halfway between them.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Bisect Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_BISECT` | `lore_revision_bisect_event_data_t` | Emitted once the working directory is synchronized to the selected revision, with the revision numbers of the range and whether the search is done |

## Sync Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_SYNC_TARGET` | `lore_revision_sync_target_event_data_t` | Emitted once after resolving the selected revision | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file deleted, modified, added, or merged during sync | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted periodically during file realization and once at completion | | `LORE_EVENT_REVISION_SYNC_REVISION` | `lore_revision_sync_revision_event_data_t` | Emitted once at the end with the resulting revision | | `LORE_EVENT_REVISION_RESOLVE` | `lore_revision_resolve_event_data_t` | Emitted when resolving a revision | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by view or ignore filters |

func RevisionCherryPick added in v0.10.1

func RevisionCherryPick(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionCherryPickArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Cherry-pick a revision onto the current branch, applying its changes to the working tree.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Cherry-Pick Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_CHERRY_PICK_START_BEGIN` | `lore_cherry_pick_start_begin_event_data_t` | Emitted when cherry-pick begins, includes picked revision info | | `LORE_EVENT_CHERRY_PICK_START_END` | `lore_cherry_pick_start_end_event_data_t` | Emitted when cherry-pick completes, includes conflict flag | | `LORE_EVENT_CHERRY_PICK_CONFLICT_FILE` | `lore_cherry_pick_conflict_file_event_data_t` | Emitted for each file with an unresolved cherry-pick conflict | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted while the picked changes are applied | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file modified during cherry-pick realization | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged for deletion during cherry-pick | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-commit starts (no conflicts) | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted during auto-commit | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed cherry-pick revision | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for metadata of the auto-commit | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for fragments written during auto-commit |

func RevisionCommit

func RevisionCommit(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionCommitArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Commit staged files to create a new revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when commit begins fragmenting files | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted periodically during commit with file processing counts | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when commit file processing completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed revision details (hash, branch, parents) | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata entry of the committed revision | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for each fragment written or deduplicated |

func RevisionDiff

func RevisionDiff(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionDiffArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Show files that differ between two revisions.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_DIFF_FILE` | `lore_revision_diff_file_event_data_t` | Emitted for each file that differs between the two revisions | | `LORE_EVENT_REVISION_RESOLVE` | `lore_revision_resolve_event_data_t` | Emitted when resolving a revision number |

func RevisionFind

func RevisionFind(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionFindArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Find a revision by metadata or revision number.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_FIND` | `lore_revision_find_event_data_t` | Emitted when a matching revision is found (exact or partial match) |

func RevisionGraphBranchArchive added in v0.15.0

func RevisionGraphBranchArchive(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchArchiveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Archive `args->branch` at each location the call consults.

With no location flag, the call archives the branch at the remote, if `args->store` has one, and in the local store; `local` or `offline` archives it in the local store alone, and `remote` at the remote alone. An archive releases the branch's name and keeps its metadata and latest, so `lore_revision_graph_revision_resolve` still resolves the branch by its id, and `lore_revision_graph_branch_list` lists it with `include_archived`. The call ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

Where the call will archive the branch in the local store, it first reads which repository instances registered in the local store have the branch as their current branch. A live one, an instance record with `stale` 0, refuses the call before either location changes: the call sends a `LORE_EVENT_REVISION_GRAPH_INSTANCE` for each live one and fails, with no location complete event. An instance whose registration the local store can't read refuses nothing; a `LORE_EVENT_LOG` warning counts such instances. At the remote, the call refuses a protected branch, the repository's default branch and a branch without a branch point before it archives anything, also with no location complete event, and then archives the branch at the remote. In the local store, it settles a restore that stopped part way, then archives the branch, refusing a protected branch, the default branch and a branch without a branch point there too. A location where the branch is archived already, once such a restore is settled, reports it archived and writes nothing more.

Each location that holds the branch sends a `LORE_EVENT_REVISION_GRAPH_BRANCH` with the branch's record and `archived` set, then its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, which carries no error and no records where the location doesn't hold the branch. A failure at the remote fails the call before it reaches the local store, so no complete event for the local store follows. Where the archive succeeds at the remote and fails in the local store, a refusal there included, the local store's complete event carries the error, and a call with `local` set retries it.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH` | `lore_revision_graph_branch_event_data_t` | The archived branch, as one location holds it | | `LORE_EVENT_REVISION_GRAPH_INSTANCE` | `lore_revision_graph_instance_event_data_t` | A live instance on the branch, which refuses the call | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its record | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a zero `args->branch`, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 48 (delete current) where a live repository instance over the local store has the branch as its current branch; - error code 47 (delete protected) for a protected branch; - error code 49 (delete default) for the repository's default branch and a branch without a branch point; - error code 87 (branch not found) where no location consulted holds the branch; - error code 80 (address not found) where the remote lacks a blob it names, such as the branch's metadata; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block, or a refusal of the archive at the remote that the call can't attribute, whose message the detail carries.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_archive_async` copy `args` before they return, so an `_async` caller can free `args` once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchCreate added in v0.15.0

func RevisionGraphBranchCreate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchCreateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Create a branch named `args->name` in `args->category`, starting at the revision `args->from`

names, at each location the call consults.

With no location flag, the call creates the branch at the remote, if `args->store` has one, and in the local store; `local` or `offline` creates it in the local store alone, and `remote` at the remote alone. The call checks the name, the category and the creator before it reads either location. Before it creates anything, it reads at each location it creates on where the branch starts, and whether a live branch holds the name there, compared regardless of case; at the remote, it also reads whether a non-zero `args->scope` names a live scope. A hash in `args->from` makes the revision's own branch the parent, as any location consulted records it, and a branch makes that branch the parent, at its latest or at the revision number given. The branch point must be the same revision at every location the call creates on. The new branch's stack is that branch point, then the parent's stack, from the local store's metadata of the parent or, where the local store lacks it, from the remote's.

The call creates the branch with a new id at the remote first, then in the local store under the same id, name, category, creator and stack. Each location records its own `created` time. The creator is the call's user id, else `globals.identity`, else the identity `args->store` was opened with, else the identity the remote connection authenticated as; the local store records the creator the remote returns. The remote creates the branch in the scope `args->scope` names, and where it is zero has the branch inherit its scope. The local store records the scope `args->scope` names, the default scope included, or else the scope the remote assigns the branch, which the remote returns for any scope but the default. A branch created at both locations starts with its local latest in sync with the remote, and one created in the local store alone starts divergent. A name an archived branch held gets a new branch with a new id; the archived branch keeps its own. The call ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

Each location the call creates the branch on sends a `LORE_EVENT_REVISION_GRAPH_BRANCH` with the branch's record, then its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`. A refusal found before the call creates anything, such as a name a live branch holds, fails the call with no location complete event. A failed read at a location, a refused connection included, ends that location with its complete event, which carries the error, and fails the call. A failure at the remote fails the call before it reaches the local store, so no complete event for the local store follows. To commit on the new branch, load a tree at its latest with `lore_revision_tree_load`, set the `branch` metadata key to the record's `branch` as a `LORE_METADATA_TYPE_CONTEXT` value, and commit.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH` | `lore_revision_graph_branch_event_data_t` | The new branch, as one location records it | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its record | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a name that is empty, longer than 1000 bytes, not UTF-8 or reads as a branch id; a category or a creator longer than 1000 bytes; a malformed `args->from`; a parent in the personal category; a parent without a latest revision that isn't the repository's default branch, or, with the local store alone, whose store holds no repository metadata to tell; an unknown or closed `args->store`; location flags that contradict each other or those `args->store` was opened with; an `args->scope` the remote doesn't hold, or holds archived; and a non-zero `args->scope` where the call doesn't create the branch at the remote; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 87 (branch not found) where no location consulted holds the parent, records the own branch of the revision `args->from` names, or holds the parent's metadata; - error code 88 (revision not found) where a location the call creates on lacks the revision `args->from` names, its revision number, or the parent another location holds; - error code 42 (divergent) where `args->from` resolves to different revisions at the locations the call creates on; - error code 57 (branch already exists) where a live branch holds the name at a location the call creates on, as for the loser of two concurrent creates; - error code 80 (address not found) where the remote lacks a blob it names, such as the repository's metadata; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block, a refusal of the create at the remote that the call can't attribute, whose message the detail carries, or a remote that predates scopes where `args->scope` names one.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_create_async` copy `args` before they return, so an `_async` caller can free `args` and its strings once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchList added in v0.15.0

func RevisionGraphBranchList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List the branches of `args->repository` at each location the call consults.

The call consults the locations, works at each, and fails as `lore_revision_graph_revision_resolve` describes. It sends a `LORE_EVENT_REVISION_GRAPH_BRANCH` for each branch at each location, in no particular order. Each of the local store's branch records is followed by the instance records `lore_revision_graph_branch_resolve` sends for that branch. Each location the call consults ends with its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, whose `records` counts the branch and instance records. With `args->include_archived` set, a branch whose create, name lookup or clone has stored its metadata and not yet claimed its name can list as archived, and one whose lookup or clone then finds its name held by another branch keeps listing as archived. In the local store, a live branch whose id an older version of Lore derived from its name, and that no name maps to, lists only with `args->include_archived` set, and as archived; a branch whose metadata key or metadata blob the local store lacks doesn't list there.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH` | `lore_revision_graph_branch_event_data_t` | A branch, as one location holds it | | `LORE_EVENT_REVISION_GRAPH_INSTANCE` | `lore_revision_graph_instance_event_data_t` | An instance on the branch of the local branch record it follows | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its records | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a creator that is not UTF-8, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 80 (address not found) where the remote lacks the metadata blob it names for a branch, whose address the error detail names; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_list_async` copy `args` before they return, so an `_async` caller can free `args` and its strings once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchMetadataGet added in v0.15.0

func RevisionGraphBranchMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Read the metadata of `args->branch` at each location the call consults.

The call consults the locations, works at each, and fails as `lore_revision_graph_revision_resolve` describes. It sends a `LORE_EVENT_REVISION_GRAPH_BRANCH_METADATA` for each entry of the branch's metadata at each location that holds the branch, built-in entries included, in the order the location stores them, or only for the entry `args->key` names where `args->key` isn't empty. A location without metadata for the branch doesn't hold it, and in the local store a metadata blob the store lacks counts as none. Lore Server answers a failed read of the branch's metadata key as a missing key, which reads as a remote that doesn't hold the branch. An archived branch reads like a live one. A `protect` entry is reported with the type it's stored with: Lore and Lore Server read a one-byte value of any type by its byte, and any other value as unprotected. The `archived` and `restored` entries alone don't say whether the branch is archived, since a restore keeps `archived` beside `restored` and an older version's archive wrote no `archived` entry; `lore_revision_graph_branch_list` with `include_archived` set says whether it is. An entry whose key isn't UTF-8, whose type this build doesn't define, or whose value doesn't decode as its type is left out, with one `LORE_EVENT_LOG` warning from each location that leaves any out. Each location the call consults ends with its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, which carries no error and no records where the location doesn't hold the branch, or, for a non-empty `args->key`, holds it without that key.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH_METADATA` | `lore_revision_graph_branch_metadata_event_data_t` | One entry of the branch's metadata, as one location holds it | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its records | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a zero `args->branch`, an `args->key` that is not UTF-8, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 87 (branch not found) where no location consulted holds the branch; - error code 80 (address not found) where the remote lacks the metadata blob it names for the branch, whose address the error detail names; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block.

An event's strings, binary values, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_metadata_get_async` copy `args` before they return, so an `_async` caller can free `args` and its strings once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchMetadataSet added in v0.15.0

func RevisionGraphBranchMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Edit the metadata of `args->branch` at each location the call consults: set each of

`args->entries`, replacing the value its key holds, and remove each key of `args->remove`.

The call consults the locations `lore_revision_graph_revision_resolve` describes, the remote first, and checks its arguments before it reads either. Neither list may name a read-only key: `id`, `name`, `category`, `creator`, `created`, `stack`, `parent`, `branch-point`, `archived`, `restored`, `restoring`, `released` or `scope`. `protect` can be set, with a `LORE_METADATA_TYPE_BOOLEAN` value, but not removed. Each value's `tag` must be a `LORE_METADATA_TYPE_*` value; any other is undefined behavior, which no error code reports. The call ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

At each location, the call reads the metadata as `lore_revision_graph_branch_metadata_get` does and applies the edits to it. Where they change it, the call checks its address values, writes it, and swaps it in for the metadata it read. Where another writer swapped first, the call applies the edits to that writer's metadata and swaps again, at most eight swaps at one location, so the last writer wins, key by key. Where the edits leave the metadata as it was, the call checks and writes nothing there. The call edits no location that doesn't hold the branch, or whose metadata another writer removed.

At the remote, the check covers every address value of the new metadata, and in the local store the addresses `args->entries` sets, whose payloads the local store must hold. An address with a zero hash needs no check. The call sends no address payload: the caller puts it at the remote first, with `lore_storage_put` and an item with `remote_write` set. The call writes the new metadata at the remote through the local store of `args->store`, which it queries and where it records each fragment it stores, adding a payload only for a fragment list or a fragment whose upload failed. Its other work at one location never reads or writes the other.

Each location that holds the branch then sends a `LORE_EVENT_REVISION_GRAPH_BRANCH_METADATA` for each entry of the metadata it holds after the call, other writers' entries included, and leaves entries out as `lore_revision_graph_branch_metadata_get` does. Each location the call consults ends with its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, which carries no error and no records where the location doesn't hold the branch. A failure at the remote fails the call before it reaches the local store, so no complete event for the local store follows. A call that fails in the local store after the remote succeeded can be retried with `local` set. Since a failed read of the metadata key at the remote reads as a miss there, a caller that needs both locations edited checks that each location's complete event reports records.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH_METADATA` | `lore_revision_graph_branch_metadata_event_data_t` | One entry of the branch's metadata, as one location holds it after the call | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its records | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a zero `args->branch`; an empty or read-only key, or a key the two lists name more than once between them; `protect` in `args->remove` or with a value that isn't Boolean; a key or a `LORE_METADATA_TYPE_STRING` value that is not UTF-8; an unknown or closed `args->store`; and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 87 (branch not found) where no location consulted holds the branch; - error code 118 (oversized) where the edited metadata is larger than 1 MiB, or a location holds a metadata blob larger than that; - error code 80 (address not found) where an address value the call checks names a payload the location doesn't hold, or the remote lacks a metadata blob it names for the branch. The error detail names the address; - error code 41 (branch advanced) where another writer changed the metadata at a location before each of the call's eight swaps there. The error's message speaks of a branch's latest, while its trace names the metadata swap; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error code 17 (not authorized) where the remote refuses the call, among them a change to `protect` without repository administration, and error codes 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block, or new metadata whose upload failed and that the remote then can't read.

An event's strings, binary values, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_metadata_set_async` copy `args` before they return, so an `_async` caller can free `args`, its arrays, strings and binary values once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchPush added in v0.15.0

func RevisionGraphBranchPush(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchPushArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Publish the local history of `args->branch` to the remote of `args->store`.

The call always writes to the remote: `local` and `offline`, on the call or on `args->store`, fail it, and `remote` means the same as no flag. It walks the branch's local history back to the revision the remote holds, uploads each revision's fragments the remote lacks, creates the branch on the remote on its first push, and offers each revision as the remote latest. The remote checks branch protection and verifies each revision. It publishes this repository's revisions alone: each revision of a linked repository that a revision links must be on the remote already, and is checked there before anything is created, uploaded or offered. The repository's layers are left out. The branch's tree blocks and leaf payloads must be in the local store of `args->store` or on the remote.

The call reads the branch's local latest from the local store, and writes the local latest once, as it finishes: the last revision the remote accepted, convergent, after a fast-forward merge too, with a compare-and-swap from the local latest it read. A tree commit that moves the local latest while the push runs stays in place, and the call still succeeds. Where the remote latest is the local latest, and without `args->options.force` where the remote's history holds the local latest and either `args->options.fast_forward_merge` is set or an earlier push published it without recording it, the call succeeds without offering a revision. `args->options.force` overwrites a remote latest that has moved, which branch protection still governs, and `args->options.fast_forward_merge` lets the remote merge onto a remote latest that has moved where the merge has no conflicts. The call ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

`LORE_EVENT_REVISION_GRAPH_BRANCH_PUSHED` fires before `LORE_EVENT_COMPLETE` once the call has read the remote latest, on success and on failure alike. On success its `revision_hash` is the revision to build on next, which can differ from the one committed after a fast-forward merge, and its `remote_latest` is the remote latest; a caller continues from `remote_latest` where it differs from `revision_hash`. On failure, `remote_latest` names the remote latest the call last read and `local_latest` the local latest the call left. After error code 41, `remote_latest` names the revision to reload from, and a forced `lore_revision_graph_branch_sync` to it with `expected_local_latest` set to `local_latest` drops the refused revisions. A call that fails before that read, such as on invalid arguments or a branch without a local latest, sends only `LORE_EVENT_COMPLETE`. The call sends no `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_BRANCH_PUSH_FRAGMENT_PROGRESS` | `lore_branch_push_fragment_progress_event_data_t` | The upload's progress, every `globals.event_interval_ms` while it uploads fragments and once as each upload ends; it carries no `args->id` | | `LORE_EVENT_BRANCH_PUSH_STATS` | `lore_branch_push_stats_event_data_t` | What the push cost, once as it finishes, at `globals.stats` 1 and above; it carries no `args->id` | | `LORE_EVENT_REVISION_GRAPH_BRANCH_PUSHED` | `lore_revision_graph_branch_pushed_event_data_t` | The revision published last, the remote latest and the local latest | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a zero `args->branch`, an unknown or closed `args->store`, `local` or `offline` on the call or on `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `args->store` has no remote; - error code 87 (branch not found) where the local store holds no local latest of the branch; - error code 41 (branch advanced) where, without `args->options.force`, the remote latest isn't the revision the push builds on, and no fast-forward merge applies, because `args->options.fast_forward_merge` isn't set or the merge would conflict. A Lore Server older than this version doesn't mark its refusal of such a push, which then fails with -1; - error code 57 (branch already exists) where the branch's first push, or a push that restores the branch the remote archived, finds another remote branch holding its name; - error code 88 (revision not found) where a revision the push would offer links a revision of another repository that the remote lacks; - error code 80 (address not found) where the remote still lacks a fragment a revision names; - error code 118 (oversized) where a blob the push reads or sends is larger than the remote or the local store allows; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error code 17 (not authorized) where the remote refuses the caller, including a forced push to a protected branch and a linked repository the caller can't read; - error codes 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote can't be reached or declines work; - error code -1 (internal) for any other failure, with the remote's message for a refusal of the remote.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_push_async` copy `args` before they return, so an `_async` caller can free `args` once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchResolve added in v0.15.0

func RevisionGraphBranchResolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchResolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve `args->name` to the branch it names at each location the call consults.

An archived branch's name no longer names it, so the call doesn't resolve an archived branch, except, in the local store, one an older version of Lore archived whose id derives from its name. The call consults the locations, works at each, and fails as `lore_revision_graph_revision_resolve` describes. It sends a `LORE_EVENT_REVISION_GRAPH_BRANCH` for each location where the name names a branch. The local store's record is followed by a `LORE_EVENT_REVISION_GRAPH_INSTANCE` for each repository instance registered in the local store whose current branch it is, stale ones included; the call retires no registration, and leaves out each instance whose registration the local store can't read, which a `LORE_EVENT_LOG` warning counts. Each location the call consults ends with its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, whose `records` counts the instance records too.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_BRANCH` | `lore_revision_graph_branch_event_data_t` | The branch, as one location holds it | | `LORE_EVENT_REVISION_GRAPH_INSTANCE` | `lore_revision_graph_instance_event_data_t` | An instance on the branch, after the local store's branch record | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its records | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a name that is empty, longer than 1000 bytes, not UTF-8 or reads as a branch id, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 87 (branch not found) where the name names no branch at any location consulted; - error code 80 (address not found) where the remote lacks the metadata blob it names for the branch, whose address the error detail names; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_resolve_async` copy `args` before they return, so an `_async` caller can free `args` and its strings once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphBranchSync added in v0.15.0

func RevisionGraphBranchSync(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphBranchSyncArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Sync the local latest of `args->branch` to the revision `args->target` names.

With no location flag or with `remote`, the call looks the target up at the remote, if `args->store` has one; with `local` or `offline`, or on a storage handle without a remote, it looks it up in the local store. Whatever the flags, the call writes the local store alone: the branch's local latest with its latest status and latest history, and the last synchronized revision where it records the branch in sync with the remote. An all-zero `args->target` names the branch's latest. A hash target must be a revision whose own branch is `args->branch`, or the branch point the branch starts from, and a branch-form target must name `args->branch`.

The local store holds the branch where it holds the branch's metadata; a local latest alone, as a tree commit leaves it, doesn't count. Where the call consults the remote and the local store lacks the branch's metadata, or the branch's name doesn't map to it there, the call first brings the branch in: it copies the remote's metadata into the local store under the same id, settling a restore that stopped part way, and claims the name. A branch the remote has archived gets its metadata and no name.

The call moves the local latest to the target where the local latest is zero, or where the target descends from it along first parents, which an ancestry walk checks. The walk reads history from the remote and keeps what it fetches in the local store where the call looks the target up at the remote, and reads the local store alone otherwise. `args->options.force` moves the local latest to any target, and a non-zero `args->options.expected_local_latest` lets the call proceed only while the local latest is that revision. The local latest moves with a compare-and-swap from the value the call read, so a commit on the branch that lands first fails the call, and one that lands after reports a tip collision. Where the target is the remote latest, the call records the branch in sync with the remote, also where the local latest is the target already. Otherwise it records the new local latest as divergent, unless the remote shows that its history for the branch holds the target: a revision number on the branch, the branch point, or a hash whose revision number on the branch the remote's revision list answers with that hash, which takes one more request. A local sync with an all-zero target writes nothing, and sends a `LORE_EVENT_REVISION_GRAPH_INSTANCE` for each repository instance registered in the local store whose current branch is `args->branch`, leaving out each instance whose registration the local store can't read, which a `LORE_EVENT_LOG` warning counts. The call ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

`LORE_EVENT_REVISION_GRAPH_BRANCH_SYNCED` fires before `LORE_EVENT_COMPLETE` once the call has read the local latest, on success and on failure alike. On success its `local_latest` is the new local latest. After a later failure, both its latests hold the local latest the call last read, so a caller can retry with `args->options.expected_local_latest` set to it. A call that fails before that read, such as on invalid arguments, a refused connection, or a branch the local store doesn't hold that the remote can't supply, sends only `LORE_EVENT_COMPLETE`. The call sends no `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_INSTANCE` | `lore_revision_graph_instance_event_data_t` | A repository instance on the branch, from a local sync with no target | | `LORE_EVENT_REVISION_GRAPH_BRANCH_SYNCED` | `lore_revision_graph_branch_synced_event_data_t` | The local latest the call read and the one it left | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a zero `args->branch`, a malformed `args->target`, a target outside the branch, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 41 (branch advanced) where the local latest isn't `args->options.expected_local_latest`, or changed during the call; - error code 42 (divergent) where, without `args->options.force`, the target doesn't descend from the local latest along first parents, including a target that reaches it only through the second parent of a merge; - error code 57 (branch already exists) where bringing the branch in finds another local branch holding its name, or another writer changing the branch's local metadata meanwhile; - error code 87 (branch not found) where the location the call looks the target up in doesn't hold the branch; - error code 88 (revision not found) where that location lacks the revision `args->target` names, and where the ancestry walk stops at a revision the local store lacks with no remote to read it from; - error code 80 (address not found) where the remote lacks a blob it names, such as the branch's metadata; - error code 118 (oversized) where a location holds a metadata blob larger than 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_branch_sync_async` copy `args` before they return, so an `_async` caller can free `args` once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionGraphRevisionResolve added in v0.15.0

func RevisionGraphRevisionResolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionGraphRevisionResolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve `args->revision` to a revision at each location the call consults.

The call consults the remote of `args->store`, if it has one, then the local store: the local store alone where `local` or `offline` is set in `globals` or was set when `args->store` was opened, and the remote alone where `remote` is. Its work at one location never reads or writes the other, it writes nothing to the local store, and a block the local store doesn't hold counts as absent there. It ignores `globals.force` and `globals.dry_run`, and `lore_storage_close` waits for it.

The call sends a `LORE_EVENT_REVISION_GRAPH_REVISION` for each location that holds the revision. A revision number can name a different revision at each location, where the local latest holds revisions the remote lacks. Each location the call consults ends with its `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE`, which carries no error and no records where the location doesn't hold the revision. A failure at a location fails the call with that location's error, the remote's where both fail, once the call has consulted the other location too.

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_GRAPH_REVISION` | `lore_revision_graph_revision_event_data_t` | The revision, as one location resolves it | | `LORE_EVENT_REVISION_GRAPH_LOCATION_COMPLETE` | `lore_revision_graph_location_complete_event_data_t` | One location's outcome, after its record, if any | | `LORE_EVENT_LOG` | `lore_log_event_data_t` | A log line | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code, with its detail in `error` |

Fails with: - error code 3 (invalid arguments) for a malformed `args->revision`, an unknown or closed `args->store`, and location flags that contradict each other or those `args->store` was opened with; - error code 111 (no remote) where `remote` is set in `globals` and `args->store` has no remote; - error code 88 (revision not found) where no location consulted holds the revision, and error code 87 (branch not found) in its place where none holds `args->revision.branch`; - error code 118 (oversized) where a location holds a revision metadata blob over 1 MiB; - error code 16 (not authenticated) where the call has no login or tokens the remote accepts. The call starts no login: the caller logs in, with `lore_auth_login_interactive` or `lore_auth_login_with_token`, and calls again, and a storage handle's open connection picks up the new login within a minute. A caller that passes its own tokens in `globals` opens a new storage handle with fresh ones, since an open connection keeps the tokens it connected with; - error codes 17 (not authorized), 28 (disconnected), 29 (not connected), 30 (maintenance) and 31 (slow down) where the remote refuses the call or can't be reached; - error code -1 (internal) for any other failure, such as a corrupt block.

An event's strings, arrays and error detail are valid only during the callback invocation that delivers it. This call and `lore_revision_graph_revision_resolve_async` copy `args` before they return, so an `_async` caller can free `args` and its strings once the call returns. A caller that passes the same `globals.correlation_id` on every call over one storage handle reuses one storage session per connection, as with the `lore_storage_*` calls. `args->id`, which every `LORE_EVENT_REVISION_GRAPH_*` event echoes, is separate from it.

func RevisionHistory

func RevisionHistory(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionHistoryArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve the revision history of the current branch.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_HISTORY` | `lore_revision_history_event_data_t` | Emitted once with summary info before entries stream | | `LORE_EVENT_REVISION_HISTORY_ENTRY` | `lore_revision_history_entry_event_data_t` | Emitted for each revision in the history |

func RevisionInfo

func RevisionInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve metadata and delta information about a specific revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_INFO` | `lore_revision_info_event_data_t` | Emitted with revision metadata (hash, branch, parents, file count, etc.) | | `LORE_EVENT_REVISION_INFO_DELTA` | `lore_revision_info_delta_event_data_t` | Emitted with delta information between revision and its parent (when delta=true) | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata key/value of the revision (when metadata=true) |

func RevisionMetadataClear

func RevisionMetadataClear(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionMetadataClearArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Clear all metadata from the current revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA_CLEAR_REVISION` | `lore_metadata_clear_revision_event_data_t` | Emitted when metadata has been cleared for the current revision |

func RevisionMetadataGet

func RevisionMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Get a specific metadata key/value pair from the current revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted with the requested key/value for the revision |

func RevisionMetadataList

func RevisionMetadataList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionMetadataListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List all metadata key/value pairs associated with the current revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for each metadata key/value associated with the revision |

func RevisionMetadataSet

func RevisionMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Set a metadata key/value pair on the current revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func RevisionRestore

func RevisionRestore(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRestoreArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Restore the working directory to a previously committed revision.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revision Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_RESTORE_FILE_BEGIN` | `lore_revision_restore_file_begin_event_data_t` | Emitted when restore starts processing files | | `LORE_EVENT_REVISION_RESTORE_FILE` | `lore_revision_restore_file_event_data_t` | Emitted for each file being restored | | `LORE_EVENT_REVISION_RESTORE_FILE_END` | `lore_revision_restore_file_end_event_data_t` | Emitted when file processing completes | | `LORE_EVENT_REVISION_RESTORE_FRAGMENT_BEGIN` | `lore_revision_restore_fragment_begin_event_data_t` | Emitted when fragment download begins for a file | | `LORE_EVENT_REVISION_RESTORE_FRAGMENT_PROGRESS` | `lore_revision_restore_fragment_progress_event_data_t` | Emitted periodically during fragment download | | `LORE_EVENT_REVISION_RESTORE_FRAGMENT_END` | `lore_revision_restore_fragment_end_event_data_t` | Emitted when fragment download completes | | `LORE_EVENT_REVISION_RESTORE_REVISION` | `lore_revision_restore_revision_event_data_t` | Emitted with the restored revision details | | `LORE_EVENT_REVISION_RESTORE_SYNC_BEGIN` | `lore_revision_restore_sync_begin_event_data_t` | Emitted when starting to apply the changes on the target state | | `LORE_EVENT_REVISION_RESTORE_SYNC_END` | `lore_revision_restore_sync_end_event_data_t` | Emitted after applying the changes on the target state is complete | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-commit of restored revision starts | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted during auto-commit | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed restored revision | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during changes realization | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for metadata of the restored revision | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for fragments written during restore commit |

func RevisionRevert

func RevisionRevert(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Revert a revision, applying its inverse changes to the working tree.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_START_BEGIN` | `lore_revert_start_begin_event_data_t` | Emitted when revert begins, includes target revision info | | `LORE_EVENT_REVERT_START_END` | `lore_revert_start_end_event_data_t` | Emitted when revert completes, includes conflict flag | | `LORE_EVENT_REVERT_CONFLICT_FILE` | `lore_revert_conflict_file_event_data_t` | Emitted for each file with an unresolved revert conflict | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during apply_diff phase | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file modified during revert realization | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged for deletion during revert | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-commit starts (no conflicts) | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted during auto-commit | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed revert revision | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for metadata of the auto-commit | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for fragments written during auto-commit |

func RevisionRevertAbort

func RevisionRevertAbort(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertAbortArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Abort an in-progress revert operation and restore the previous state.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_ABORT_BEGIN` | `lore_revert_abort_begin_event_data_t` | Emitted when revert abort begins | | `LORE_EVENT_REVERT_ABORT_END` | `lore_revert_abort_end_event_data_t` | Emitted when revert abort completes | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization while reverting |

func RevisionRevertResolve

func RevisionRevertResolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertResolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a revert conflict by marking conflicting files as resolved.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_RESOLVE_FILE` | `lore_revert_resolve_file_event_data_t` | Emitted for each file marked as resolved | | `LORE_EVENT_REVERT_RESOLVE_REVISION` | `lore_revert_resolve_revision_event_data_t` | Emitted with the updated staged revision |

func RevisionRevertResolveMine

func RevisionRevertResolveMine(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertResolveMineArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a revert conflict by accepting the "mine" version of each conflicting file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_RESOLVE_FILE` | `lore_revert_resolve_file_event_data_t` | Emitted for each file resolved by keeping "mine" | | `LORE_EVENT_REVERT_RESOLVE_REVISION` | `lore_revert_resolve_revision_event_data_t` | Emitted with the updated staged revision |

func RevisionRevertResolveTheirs

func RevisionRevertResolveTheirs(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertResolveTheirsArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a revert conflict by accepting the "theirs" version of each conflicting file.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_RESOLVE_FILE` | `lore_revert_resolve_file_event_data_t` | Emitted for each file resolved by keeping "theirs" | | `LORE_EVENT_REVERT_RESOLVE_REVISION` | `lore_revert_resolve_revision_event_data_t` | Emitted with the updated staged revision |

func RevisionRevertRestart

func RevisionRevertRestart(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertRestartArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Restart a revert operation, re-materializing files with conflicts.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_CONFLICT_FILE` | `lore_revert_conflict_file_event_data_t` | Emitted for each file with a remaining revert conflict | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted during file realization | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file re-materialized |

func RevisionRevertUnresolve

func RevisionRevertUnresolve(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionRevertUnresolveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Mark conflicting files in a revert operation as unresolved.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Revert Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVERT_UNRESOLVE_FILE` | `lore_revert_unresolve_file_event_data_t` | Emitted for each file marked as unresolved | | `LORE_EVENT_REVERT_UNRESOLVE_REVISION` | `lore_revert_unresolve_revision_event_data_t` | Emitted with the updated staged revision |

func RevisionSync

func RevisionSync(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionSyncArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Synchronize the working directory to a target revision, optionally merging divergent branches.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Sync Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_REVISION_SYNC_TARGET` | `lore_revision_sync_target_event_data_t` | Emitted once after resolving the target revision with source/target revision info, branch, and remote URL | | `LORE_EVENT_REVISION_SYNC_FILE` | `lore_revision_sync_file_event_data_t` | Emitted for each file deleted, modified, added, or merged during sync | | `LORE_EVENT_REVISION_SYNC_PROGRESS` | `lore_revision_sync_progress_event_data_t` | Emitted periodically during file realization and once at completion with cumulative update/delete/automerge/conflict counts | | `LORE_EVENT_REVISION_SYNC_REVISION` | `lore_revision_sync_revision_event_data_t` | Emitted once at the end with the resulting revision, branch, and merge/conflict flags | | `LORE_EVENT_REVISION_RESOLVE` | `lore_revision_resolve_event_data_t` | Emitted when resolving a revision number | | `LORE_EVENT_FILTER_EXCLUDE` | `lore_filter_exclude_event_data_t` | Emitted for each path excluded by view or ignore filters | | `LORE_EVENT_BRANCH_MERGE_START_BEGIN` | `lore_branch_merge_start_begin_event_data_t` | Emitted when an auto-merge is initiated (diverged branches) | | `LORE_EVENT_BRANCH_MERGE_START_END` | `lore_branch_merge_start_end_event_data_t` | Emitted when the auto-merge operation completes | | `LORE_EVENT_BRANCH_MERGE_CONFLICT_FILE` | `lore_branch_merge_conflict_file_event_data_t` | Emitted for each file with an unresolved merge conflict | | `LORE_EVENT_REVISION_COMMIT_BEGIN` | `lore_revision_commit_begin_event_data_t` | Emitted when auto-merge auto-commits (no conflicts) | | `LORE_EVENT_REVISION_COMMIT_PROGRESS` | `lore_revision_commit_progress_event_data_t` | Emitted during auto-commit | | `LORE_EVENT_REVISION_COMMIT_END` | `lore_revision_commit_end_event_data_t` | Emitted when auto-commit completes | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | Emitted with the committed merge revision | | `LORE_EVENT_METADATA` | `lore_metadata_event_data_t` | Emitted for metadata of the auto-merge commit | | `LORE_EVENT_FRAGMENT_WRITE` | `lore_fragment_write_event_data_t` | Emitted for each fragment written during auto-merge commit | | `LORE_EVENT_FILE_STAGE_FILE` | `lore_file_stage_file_event_data_t` | Emitted for each file staged for deletion during merge realization |

func RevisionTreeAdd added in v0.8.6

func RevisionTreeAdd(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeAddArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Add a batch of nodes to a loaded revision tree. An entry parents onto an existing

node or onto an earlier entry, so one call builds a subtree. Every entry is checked before any node is created, so one bad entry rejects the call and creates nothing; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify. The entry and the call report `LORE_ERROR_CODE_OVERSIZED` for a name longer than a node name may be, and `LORE_ERROR_CODE_INVALID_ARGUMENTS` for any other bad entry. A failure after those checks pass fails its entry with the code of the State's failure, and the call with `LORE_ERROR_CODE_INTERNAL`, and may leave part of the batch created. An entry the tree gave up on under load, in its checks or after, reports `LORE_ERROR_CODE_SLOW_DOWN` instead. An entry parented onto a failed entry reports that entry's code. The load is heavy concurrent change on the handle, or a store asking the tree to slow down, and a caller can retry. The batch reports `LORE_ERROR_CODE_SLOW_DOWN` where every failed entry did.

A link entry's target revision is not resolved here, so a link naming a revision that cannot be read is accepted and fails only when something later reads through it. Entries under separate parents are created concurrently, but allocating a node slot is serialized per loaded tree.

A revision tree does not support content stored with its holes skipped (`skip_holes` on `lore_storage_put_file` or `lore_storage_put_file_resolved`), and this call does not refuse an address naming such content: FUSE reads of the file fail, and status reports the file modified whenever a scan hashes it.

| Terminal event | Payload | Notes | |-------------------------------------------|--------------------------------------------------|----------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_ADD_COMPLETE` | `lore_revision_tree_add_complete_event_data_t` | One per entry, carrying its `entry_id` | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeClose added in v0.8.5

func RevisionTreeClose(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeCloseArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Release a memory-based revision tree handle.

Subsequent calls against the same handle return `InvalidArguments`. The call blocks until every in-flight op on the handle has paired its decrement. Closing a tree on a storage handle that is already closed flushes the stores, as `globals.sync_data` and `globals.fast_flush` ask, once the eviction and compaction passes in flight on the immutable store have given up and a verification in flight has ended, and completes once the flush has finished. A failed flush still releases the handle, and close returns the flush's error. With `skip_flush` set, close does not flush: what no flush has written is lost once nothing holds the stores. Closing the last tree releases what was keeping that handle's claim on its stores.

| Terminal event | Payload | Notes | |---------------------------------------------|-----------------------------------------------|----------------------------------------------------| | `LORE_EVENT_REVISION_TREE_CLOSE_COMPLETE` | `lore_revision_tree_close_complete_event_data_t` | Carries the caller id and the outcome |

func RevisionTreeCommit added in v0.9.0

func RevisionTreeCommit(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeCommitArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Freeze a loaded revision tree into a new revision and advance its branch tip.

**The branch is not an argument.** It is the revision's own, read from the `branch` metadata key: set it with `lore_revision_tree_metadata_set` to start a branch's history, and leave it unset to continue the loaded revision's branch. A key that is set must name either the loaded revision's branch or a branch whose branch point is exactly the loaded revision. A handle loaded from the zero revision has no parent to read a branch from and must set the key.

The revision records exactly the metadata set on the handle — nothing is inherited from the revision it was loaded on — plus the three facts about the commit the caller did not supply: the branch, the timestamp if unset, and `created-by` / `committed-by` if unset. The commit message is caller metadata like any other: set `"message"` before committing.

On success the handle stays usable and now *is* the new revision: node ids captured before the commit still resolve, and further edits commit on top. The pending metadata is emptied, so the next revision starts fresh.

**A commit is all-or-nothing against the handle.** Either it succeeds and the handle is consistent on the new revision, or it fails and the handle is consistent on the state it had before the call. A call rejected before any write — nothing staged, an unusable branch, a tree the validator refuses, or a branch tip that has already moved — writes nothing at all. A failure once the freeze has begun leaves a part-frozen tree, which is discarded and rebuilt from a snapshot taken before the freeze started, so the handle comes back on the revision it was on with the edits still staged. Either way recovery is to fix what the terminal reported and retry **on the same handle**: no close, no reload, no re-applying edits. The one failure that still poisons the handle is a restore that itself fails, which reports `INTERNAL` saying so. When the branch had advanced, `new_tip_hash` on the terminal carries that tip, which is also how a caller tells that failure apart: the call's error set holds neither `BRANCH_ADVANCED` nor `NOTHING_STAGED`, which the file-system commit reports, so a tip collision and an empty commit both report `INTERNAL` with the reason in the completion detail.

**A merge revision.** `options.parent_other` names a second parent, the merged revision; zero commits a revision with one parent. The loaded revision is always the first parent: load the handle at the revision the branch continues, apply the result of merging as edits, and name the merged revision. The revision is numbered one above the higher of its parents' numbers, every change it records is marked as merged, and it commits even with no edits and no metadata set. A second parent that is the loaded revision, that the handle's store doesn't hold, or that is given to a handle loaded from the zero revision, is refused with `LORE_ERROR_CODE_INVALID_ARGUMENTS` before anything is written, naming its hash; another failure to read it reports `LORE_ERROR_CODE_INTERNAL`, as the call's other reads do. A second parent claims that the revision holds that revision's history: name one only where merging brought in the whole of the merged line.

`options.remote_write = 1` uploads within the call. It is a request, not a guarantee: a store bound offline or local-only, or a call passing `globals.local`, silently commits local-only. So does a store opened without a remote configuration — there is nothing to upload to, and the commit still reports success. Per-call flags contradicting the store's bound flags reject the call.

**The commit holds the handle for the length of the call.** No other call on the same handle runs while the tree is frozen, so an edit issued concurrently lands wholly before the commit reads the tree or wholly after it finishes, two commits on one handle serialize, and `metadata_set` can no longer lose an edit to the commit. A commit on a large tree therefore blocks reads on that handle for its duration, and a callback that re-enters the API on the same handle deadlocks — which the callback contract already forbids. Commits from *different* handles or processes still race, and the branch tip compare-and-swap decides them.

`remote_write` is resolved onto the handle's shared repository context, so the value outlives the call: the handle carries whatever the last commit resolved.

| Terminal event | Payload | Notes | |-----------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_COMMIT_COMPLETE` | `lore_revision_tree_commit_complete_event_data_t` | Exactly one; carries the new revision, or the new tip on collision | | `LORE_EVENT_REVISION_COMMIT_REVISION` | `lore_revision_commit_revision_event_data_t` | On success, for continuity with file-system commit consumers |

func RevisionTreeDelete added in v0.9.0

func RevisionTreeDelete(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeDeleteArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove a batch of subtrees from a loaded revision tree. Each entry names a

subtree root and removes it whole, transitive children included. Every entry is checked before any node is touched, so one bad entry rejects the call and leaves every subtree in place; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify. A failure after those checks pass fails its entry with the code of the State's failure, and the call with `LORE_ERROR_CODE_INTERNAL`, and may leave part of the batch removed. An entry the tree gave up on under load, heavy concurrent change on the handle or a store asking it to slow down, reports `LORE_ERROR_CODE_SLOW_DOWN` instead, which a caller can retry. The batch reports `LORE_ERROR_CODE_SLOW_DOWN` where every failed entry did.

A node the loaded revision holds is **staged** for deletion and stays in the tree: it keeps its name and its place among its siblings, still lists through `lore_revision_tree_list_children`, and reports `LORE_NODE_STAGED_ACTION_DELETE` in its `staged_action`. The commit that freezes the tree is what drops it. A node added through this handle is in no revision yet, so it leaves the tree outright instead: it stops being listed, `lore_revision_tree_node_info` answers for it as for a freed id, and the next commit that goes ahead frees its node id. A link is removed as one node — its subtree belongs to the linked repository's tree.

A staged deletion is reversible: `lore_revision_tree_add` of the same name under the same parent with the same kind restores the node. A zero `address.context` on that add preserves the node's `file_id`; supplying one replaces it, as on `lore_revision_tree_modify`. Only the named node comes back — restoring a directory leaves its children staged for deletion, so each has to be added back in turn. An added node that left the tree is not restorable: adding its name again creates a new node.

Each entry's subtree is checked before any of it is staged: an added directory in it holding a live node the loaded revision holds, moved there, fails the entry with `LORE_ERROR_CODE_INTERNAL`, and the entry changes nothing. Staging fans out one depth level at a time over at most one task per processor. Each added subtree is then detached from its directory in one step; detaches from one directory run one after another. Memory while the call runs is proportional to the entry count times the tasks the work spreads over, plus two adjacent depth levels of the tracked subtrees being removed, plus one record per added subtree root found, plus, while an entry's subtree is checked, its directories still to walk. Entries report in entry order once the whole batch has been walked. The root cannot be deleted, and an entry whose ancestor another entry deletes is rejected rather than removed twice.

A delete or move call waits for any other delete or move call on the same handle to finish, so they apply one after the other, each checking its entries against the tree the one before left.

| Terminal event | Payload | Notes | |---------------------------------------------|---------------------------------------------------|----------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_DELETE_COMPLETE` | `lore_revision_tree_delete_complete_event_data_t` | One per entry, carrying its `entry_id` and `node_count` | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeInfo added in v0.8.5

func RevisionTreeInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Fetch the loaded revision's record-level metadata (parents, creation

timestamp, author identity, metadata key count). Revision-scoped — no node id.

| Terminal event | Payload | Notes | |------------------------------------|----------------------------------------|---------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_INFO` | `lore_revision_tree_info_event_data_t` | Carries the revision record metadata for the handle |

func RevisionTreeListChildren added in v0.8.5

func RevisionTreeListChildren(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeListChildrenArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Stream the children of a directory node in a loaded revision tree.

Moves and deletions on the same handle may run beside the listing: a child moved away meanwhile may be left out, and a child may be reported twice. A caller that needs each child once drops repeats by `node_id`. A listing the tree gave up on under load, heavy changes beside it or a store asking it to slow down, completes with `LORE_ERROR_CODE_SLOW_DOWN`, which a caller can retry.

| Terminal event | Payload | Notes | |--------------------------------------|----------------------------------------|----------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_CHILD` | `lore_revision_tree_child_event_data_t` | One per child reached; an empty directory emits none before `Complete` |

func RevisionTreeLoad added in v0.8.5

func RevisionTreeLoad(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeLoadArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Open a memory-based revision tree handle on the given

`(store, repository, revision_hash)` tuple. `revision_hash == 0` opens an empty tree suitable for committing an initial revision.

The tree keeps the storage handle's claim on its stores for as long as it is open, past `lore_storage_close` on that handle.

| Terminal event | Payload | Notes | |--------------------------------------|----------------------------------------|----------------------------------------------------| | `LORE_EVENT_REVISION_TREE_LOADED` | `lore_revision_tree_loaded_event_data_t` | Emitted on success carrying the opened handle id |

func RevisionTreeMetadataClear added in v0.9.0

func RevisionTreeMetadataClear(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeMetadataClearArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Remove a batch of keys from a loaded revision tree's in-progress metadata.

Every entry is checked before any key is removed, so one bad entry rejects the call and removes nothing; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify.

**Clearing a key that is not set is a no-op success**, not a failure. The terminal's `removed` field says which happened: `1` when the key was there and is now gone, `0` when there was nothing to remove. A repeated key is likewise not rejected — the second entry naming it reports `removed = 0`.

This clears the **pending** metadata that `lore_revision_tree_metadata_set` records and `lore_revision_tree_metadata_get` reads first; a key frozen in the loaded revision is not reachable from here, since clearing edits the revision being built and the one it was loaded from is immutable. The whole batch applies under one write lock, which is what makes it atomic.

| Terminal event | Payload | Notes | |-----------------------------------------------------|-----------------------------------------------------------|-------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_METADATA_CLEAR_COMPLETE` | `lore_revision_tree_metadata_clear_complete_event_data_t` | One per entry, carrying its `entry_id` and `removed` | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeMetadataGet added in v0.9.0

func RevisionTreeMetadataGet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeMetadataGetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Read a batch of metadata values from a loaded revision tree.

By default this reads only the **revision being built** — what `lore_revision_tree_metadata_set` recorded on this handle, which is exactly what `lore_revision_tree_commit` will write. Nothing is inherited from the revision the handle was loaded on. Set `include_revision` to `1` to also fall back to that revision for a key the handle has no entry for; a pending entry still wins, so the flag only adds answers.

A key present in neither emits **no event at all** and does not fail the call, matching `lore_revision_metadata_get`: detect an absent key by tracking whether a value event arrived for its `entry_id`. This verb is therefore **not all-or-nothing**, unlike the other batch verbs — it mutates nothing, so one unanswerable key costs the others nothing. Bad arguments still reject the whole call.

A value comes back as the same `lore_metadata_t` that `lore_revision_tree_metadata_set` takes, so it round-trips without either side encoding it as text. Every kind is returned, raw binary included.

A value whose stored bytes do not match the kind they are tagged with, or whose tag this build does not recognize, reports `LORE_ERROR_CODE_INTERNAL` on that entry rather than staying silent, so it is never mistaken for an absent key.

The revision's metadata is read once for the whole batch, which is what batching buys here.

| Terminal event | Payload | Notes | |---------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_METADATA_GET_COMPLETE` | `lore_revision_tree_metadata_get_complete_event_data_t` | One per key that resolved, carrying its `entry_id`; none for an absent key | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeMetadataSet added in v0.9.0

func RevisionTreeMetadataSet(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeMetadataSetArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Record a batch of `(key, value)` pairs on a loaded revision tree's in-progress

metadata.

`value` is a `lore_metadata_t`, which carries its own kind — set the union's `tag` and the matching member. There is no separate format field and nothing is parsed, so a value cannot be stored under a kind it is not, and a binary value can hold any bytes rather than only text. This differs from `lore_revision_metadata_set`, which takes text plus a parallel format array. `lore_revision_tree_metadata_get` returns the same union.

Every entry is checked before any pair is recorded, so one bad entry rejects the call and records nothing; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify.

A repeated key is **not** rejected, unlike the duplicate-target rules on the node verbs: entries apply in index order, so the last entry naming a key wins — the same result as sending those pairs as separate calls.

Nothing reaches storage here. The pairs live on the handle until `lore_revision_tree_commit` serializes them, so only this handle's `lore_revision_tree_metadata_get` sees them. The whole batch applies under one write lock, which is what makes it atomic and why there is no concurrency to gain: the work is buffer writes, not I/O.

A revision's whole metadata is capped at 1 MiB. The cap counts the metadata itself — keys, values and per-entry overhead — and not what a value refers to: a value holding a content address costs the address, not the content behind it.

A single entry larger than the whole cap is rejected here, since no amount of removing other keys could make it fit. The running total is not checked here, because what a revision ends up carrying is only known once every set has run: a batch of individually legal entries that together push past the limit is reported as recorded and fails later, at `lore_revision_tree_commit`.

| Terminal event | Payload | Notes | |---------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_METADATA_SET_COMPLETE` | `lore_revision_tree_metadata_set_complete_event_data_t` | One per entry, carrying its `entry_id` | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeModify added in v0.9.0

func RevisionTreeModify(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeModifyArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Rewrite a batch of file nodes' `mode`, `size` and `address` in a loaded revision

tree. Every entry is checked before any node is rewritten, so one bad entry rejects the call and leaves every target untouched; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify. A failure after those checks pass fails its entry with the code of the State's failure, and the call with `LORE_ERROR_CODE_INTERNAL`, and may leave part of the batch rewritten. An entry the tree gave up on under load, a store asking it to slow down, reports `LORE_ERROR_CODE_SLOW_DOWN` instead, which a caller can retry. The batch reports `LORE_ERROR_CODE_SLOW_DOWN` where every failed entry did.

Only a file is modifiable: a directory's size and address are derived at commit and a link's address is its target. A zero `address.context` preserves the node's existing file id rather than generating one, which is the opposite of `lore_revision_tree_add` — the node already has an identity, and replacing it would record the edit as a move. An entry's `mode` replaces bits 0 to 12 of the node's, and the node keeps bits 13 to 15, which Lore reserves. A file added or moved through this handle stays an addition or a move, which the commit records with the new content. Entries touch no parent or sibling chain, so the whole batch applies concurrently.

A revision tree does not support content stored with its holes skipped (`skip_holes` on `lore_storage_put_file` or `lore_storage_put_file_resolved`), and this call does not refuse an address naming such content: FUSE reads of the file fail, and status reports the file modified whenever a scan hashes it.

| Terminal event | Payload | Notes | |---------------------------------------------|---------------------------------------------------|----------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_MODIFY_COMPLETE` | `lore_revision_tree_modify_complete_event_data_t` | One per entry, carrying its `entry_id` | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeMove added in v0.9.0

func RevisionTreeMove(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeMoveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Move a batch of nodes to new parents and/or new names in a loaded revision tree. An

entry naming the node's current parent renames it where it is. Every entry is checked before any node is moved, so one bad entry rejects the call and leaves every node where it was; the reason names the offending entry's batch index, which a caller leaving `entry_id` at zero has no other way to identify. The entry and the call report `LORE_ERROR_CODE_OVERSIZED` for a name longer than a node name may be, and `LORE_ERROR_CODE_INVALID_ARGUMENTS` for any other bad entry. A failure after those checks pass fails its entry with the code of the State's failure, and the call with `LORE_ERROR_CODE_INTERNAL`, and may leave earlier entries applied. An entry the tree gave up on under load, in its checks or after, reports `LORE_ERROR_CODE_SLOW_DOWN` instead. The load is heavy concurrent change on the handle, or a store asking the tree to slow down, and a caller can retry. The batch reports `LORE_ERROR_CODE_SLOW_DOWN` where every failed entry did.

A move keeps the node: its node id, its `file_id` and its children come along, and the change is recorded as a move rather than as a deletion and an addition, so the revision graph carries the node's history across it. The node reports `LORE_NODE_STAGED_ACTION_MOVE` until the commit that freezes the tree, and so does every node under a moved directory — their records do not change, but their paths do. Two exceptions: a node added through this handle stays staged as an addition wherever it lands, since it is in no revision a move could be recorded against; and a node under the moved directory that is staged for deletion keeps its deletion, since it is leaving the revision at the commit either way.

Both batch-level rules read the tree the whole batch produces rather than the one in front of them. A destination inside the moved node's own subtree is rejected, and so is one that lands there once the batch is applied — moving A under B and B under A is a loop neither entry shows on its own. A name a live child of the destination already holds is rejected, but a name the batch itself vacates is not: moving `x` out of a directory while moving another node to `x` in it succeeds, and two entries taking one name under one destination reject even though neither collides with the tree.

Entries apply one at a time, in batch order, because a move rewrites the parent and sibling pointers of two child chains where `lore_revision_tree_add` only prepends to one. A delete or move call waits for any other delete or move call on the same handle to finish, so they apply one after the other, each checking its entries against the tree the one before left.

| Terminal event | Payload | Notes | |-------------------------------------------|--------------------------------------------------|-------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_MOVE_COMPLETE` | `lore_revision_tree_move_complete_event_data_t` | One per entry, carrying its `entry_id` and the moved node | | `LORE_EVENT_REVISION_TREE_BATCH_COMPLETE` | `lore_revision_tree_batch_complete_event_data_t` | Exactly one, carrying the `batch_id` and the call's outcome |

func RevisionTreeNodeInfo added in v0.8.5

func RevisionTreeNodeInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeNodeInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Fetch the per-node record for a single node id in a loaded revision tree.

| Terminal event | Payload | Notes | |-----------------------------------------|---------------------------------------------|----------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_NODE_INFO` | `lore_revision_tree_node_info_event_data_t` | Carries the node record, uniform across every node id (revision metadata: `lore_revision_tree_info`) |

func RevisionTreeNodePath added in v0.8.5

func RevisionTreeNodePath(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeNodePathArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Reconstruct the full UTF-8 path for a node id by walking parent pointers,

relative to the handle's own tree root.

| Terminal event | Payload | Notes | |--------------------------------------|---------------------------------------------|--------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_NODE_PATH` | `lore_revision_tree_node_path_event_data_t` | Carries the path; the root resolves to the empty path |

func RevisionTreeResolvePath added in v0.8.5

func RevisionTreeResolvePath(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreRevisionTreeResolvePathArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve a UTF-8 path against a loaded revision tree to a node id. An empty

path resolves to the root node.

| Terminal event | Payload | Notes | |------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------| | `LORE_EVENT_REVISION_TREE_RESOLVE_PATH_COMPLETE` | `lore_revision_tree_resolve_path_complete_event_data_t` | Carries the resolved node id and the per-call outcome |

func ScopeArchive added in v0.15.0

func ScopeArchive(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreScopeArchiveArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Archive a scope of the repository: its name stops naming it, and its ID, its record and the

branches in it stay. The default scope's ID fails with `LORE_ERROR_CODE_INVALID_ARGUMENTS` before the remote is asked.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Scope Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SCOPE_ARCHIVE` | `lore_scope_event_data_t` | Emitted with the archived scope |

func ScopeCreate added in v0.15.0

func ScopeCreate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreScopeCreateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Create a scope in the repository, under the ID the arguments name or a new one. A create of an

archived scope's ID restores the scope under the name. The name `default`, a name a branch can't take, an ID that isn't valid and the default scope's ID fail with `LORE_ERROR_CODE_INVALID_ARGUMENTS` before the remote is asked.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Scope Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SCOPE_CREATE` | `lore_scope_event_data_t` | Emitted with the created or restored scope |

func ScopeInfo added in v0.15.0

Retrieve a scope of the repository by its ID, which names an archived scope too, or by the name

of a live scope.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Scope Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SCOPE_INFO` | `lore_scope_event_data_t` | Emitted with the scope |

func ScopeRename added in v0.15.0

func ScopeRename(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreScopeRenameArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Rename a live scope of the repository. The default scope's ID fails with

`LORE_ERROR_CODE_INVALID_ARGUMENTS` before the remote is asked.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Scope Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SCOPE_RENAME` | `lore_scope_event_data_t` | Emitted with the renamed scope |

func ServiceSetExecutable added in v0.10.0

func ServiceSetExecutable(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceSetExecutableArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Name the executable the Lore background service runs from, for this machine.

Written to the user-level global config, so it holds for later commands and for other clients that read it. An empty `executable` clears the setting. Naming it decides which build serves the machine, rather than leaving that to whichever client happens to start a service first.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func ServiceSetExternalDirectory added in v0.15.0

func ServiceSetExternalDirectory(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceSetExternalDirectoryArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Move every virtual instance's external directory to a new external root, `args->path`, and

name it in the setting, for the caller's global data directory.

Runs in the calling process, and is never relayed to the service. Stops the running service and holds its socket until the move ends, then starts the service again. A relative `path` resolves against the caller's working directory, and an empty one names the default location in the global data directory. With `adopt`, points the setting at `path`, a root that holds this global data directory's marker, and moves nothing; with `abandon`, gives up the unavailable current root for a new, empty one at `path`. Both together fail with error code 3 (invalid arguments). With `globals->dry_run`, runs every check that needs nothing stopped, reports what it would do in `LORE_EVENT_LOG` events, and changes nothing. With `globals->force`, the stop detaches busy mounts lazily, and programs with files open through them get errors; without it, a busy mount fails the call with error code 51 (mounts busy). A service that runs inside another program or in the calling program, and another move that holds the service's socket, fail the call with error code 51. The call returns only once the move holds the lock of every shared store its final switch needs, and a store the calling program holds fails it with error code 51.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func ServiceSetUseAutomatically added in v0.10.0

func ServiceSetUseAutomatically(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceSetUseAutomaticallyArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Set whether commands are carried out by the Lore background service.

Written to the user-level global config, so the service stays in use for later commands rather than for one command at a time. A non-zero `enabled` turns it on; zero turns it off.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func ServiceStart

func ServiceStart(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceStartArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Start the Lore background service, unless one is already running.

Connects to the running service, and starts one when nothing is listening, then asks it for its status. Returns `0` once a service is reachable, whether it was already running or was started by this call, and at once in a program whose service has claimed the service socket, while it may still be starting. Each log message the service buffered while no command was running arrives as a `LORE_EVENT_LOG` event of its level, emptying the buffer. Fails with error code 32 (service unavailable) while a move of the external directories holds the service socket, as no service runs then.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func ServiceStatus added in v0.11.0

func ServiceStatus(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceStatusArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Report whether the Lore background service is running, and its metadata.

Answers from inside the service when called there, and otherwise reaches the one that is listening. Nothing listening is an answer rather than a failure: the call returns `0` with `running` set to `0`, so a caller branches on the event rather than on a connection error. While a move of the external directories holds the service socket, no service runs: the call also returns `0` with `running` set to `0`, and `external_root_state` is `LORE_EXTERNAL_ROOT_STATE_INTERRUPTED`. The `external_root`, `external_root_state` and `external_leftovers` fields describe the external root of the caller's global data directory whether or not a service runs. Also hands back the log messages the service buffered while no command was running, emptying the buffer as it reads it.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Operation-Specific Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SERVICE_STATUS` | `lore_service_status_event_data_t` | Service running state and metadata | | `LORE_EVENT_SERVICE_MESSAGE` | `lore_service_message_event_data_t` | A log message the service buffered outside command execution |

func ServiceStop

func ServiceStop(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreServiceStopArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Stop the running Lore background service.

Does not start a service in order to stop one. Returns `0` when no service is running, since that is the state the call asks for. A mount the service cannot release because something holds it refuses the stop with `MountsBusy`, unless the global `force` argument is set, which detaches busy mounts lazily. Fails with error code 32 (service unavailable) while a move of the external directories holds the service socket.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func SetCompressionLevel added in v0.10.0

func SetCompressionLevel(level int32) (int32, error)

func SetCompressionMode added in v0.10.0

func SetCompressionMode(mode uint32) (int32, error)

func SetThreadLimit

func SetThreadLimit(count uintptr) (int32, error)

func SharedStoreCreate

func SharedStoreCreate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreSharedStoreCreateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Create a new shared store at the specified path.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Shared Store Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SHARED_STORE_CREATE` | `lore_shared_store_create_event_data_t` | Emitted on success after the shared store is created, carrying the path of the newly created store |

func SharedStoreInfo

func SharedStoreInfo(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreSharedStoreInfoArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Retrieve the path of the configured default shared store.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Shared Store Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SHARED_STORE_INFO` | `lore_shared_store_info_event_data_t` | Emitted on success carrying the path of the configured default shared store |

func SharedStoreList added in v0.10.1

func SharedStoreList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreSharedStoreListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List every registered shared store.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

## Shared Store Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_SHARED_STORE_LIST` | `lore_shared_store_list_event_data_t` | Emitted on success carrying every registered shared store, and the instances using each when `include_instances` is set, leaving out an instance registration the store can't read, which a `LORE_EVENT_LOG` warning counts. A store another process still holds once the listing has waited 3 seconds in all is carried without its instances, and a `LORE_EVENT_LOG` warning names it. With `include_instances` set and a service running in another process, the listing runs in the service, so this includes a store the calling process holds |

func SharedStoreSetUseAutomatically

func SharedStoreSetUseAutomatically(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreSharedStoreSetUseAutomaticallyArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Set whether to automatically use the shared store.

Events

Events are delivered via the callback as `lore_event_t`. Use the `tag` field to identify the event type.

## Standard Events

These events are emitted by all interface functions:

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_LOG` | `lore_log_event_data_t` | Diagnostic messages throughout execution | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | Always emitted at the end; `status` is `0` on success or the error code on failure | | `LORE_EVENT_END` | `lore_end_event_data_t` | Always emitted after `COMPLETE` to signal callback termination |

func Shutdown

func Shutdown() (int32, error)

func StorageClose

func StorageClose(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageCloseArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Release a content-addressed storage handle.

Subsequent calls against the same handle return `InvalidArguments`. Close waits for the calls in flight on the handle, then flushes its stores as `globals.sync_data` and `globals.fast_flush` ask, once the eviction and compaction passes in flight on the immutable store have given up and a verification in flight has ended. `LORE_EVENT_COMPLETE` fires once the flush has finished. A failed flush still releases the handle, and close returns the flush's error; a caller that must be able to retry a failed flush calls `lore_storage_flush` before close. With `skip_flush` set, close releases the handle once the calls in flight have ended, without a flush: what the handle, and the revision trees closed while it was open, wrote that no flush has written is lost once nothing holds the stores. The handle's claim on its stores ends as `lore_storage_open` describes. With `LORE_STORE_RETAIN` set to `1` or `true`, a disk-backed handle's stores stay in memory without the claim for the window `store_keep_alive_seconds` gives, so a `lore_storage_open` of the same repository in that window reuses them. Retained stores holding writes no flush has written, after a failed flush or with `skip_flush`, keep the lock on their directory until the window ends or a later flush in the process writes them.

func StorageCopy

func StorageCopy(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageCopyArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Copy content from one partition to another within the same store.

Same-partition source/target rejects with `INVALID_ARGUMENTS`. The item's content hash is preserved; only the source address is carried in the per-item event.

func StorageFlush

func StorageFlush(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageFlushArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Flush pending writes through the handle's stores.

On disk-backed stores this writes as `globals.sync_data` and `globals.fast_flush` ask. On in-memory stores the underlying flush is a no-op and the call still completes with `status: 0`.

func StorageGet

Read one or more content-addressed buffers.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_GET_HEADER` | `lore_storage_get_header_event_data_t` | Size of the item's reassembled content, emitted before any DATA events | | `LORE_EVENT_STORAGE_GET_DATA` | `lore_storage_get_data_event_data_t` | Payload bytes — valid only during the callback invocation | | `LORE_EVENT_STORAGE_GET_ITEM_COMPLETE` | `lore_storage_get_item_complete_event_data_t` | Terminal per-item event | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StorageGetFile

func StorageGetFile(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageGetFileArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Write content-addressed payloads to filesystem paths.

Each item emits `LORE_EVENT_STORAGE_GET_ITEM_COMPLETE`. No HEADER or DATA events are produced — the payload is written straight to disk. A multi-fragment write goes through `<path>.loretmp`, the name of `path` with `.loretmp` appended, and renames it into place atomically, so the target is either the finished range or untouched. The temporary file is emptied before anything is written to it, so nothing a `<path>.loretmp` left by an earlier get held stays in it, except where the write resumes from it, below. A hole the content was stored with (`skip_holes` on `lore_storage_put_file`), a range holding no data, is left unwritten, so it is a hole of the written file where its file system supports holes. On Windows a multi-fragment write makes its file sparse before it sizes it, so a hole holds no storage there either. Every range of data is written, zeros included: written zeros are data. On macOS, APFS allocates a hole of under 16 MiB beside data as zeros when it writes that data out, so where the file system holds holes, once every range of data is written the call writes the data out and deallocates the whole blocks of each hole (`F_PUNCHHOLE`), and never a range of data. Where one cannot be deallocated, the call fails.

A multi-fragment write of a range of at least 32 MiB that fails, or that a process stops, keeps `<path>.loretmp`, which takes disk space up to the size of the range, and beside it its *resume record*, the file `<path>.loretmp.rec`, which names the content hash and the range the temporary file holds. The rename into place comes after the resume record is removed, so a rename that fails keeps the temporary file alone. A later call writing the same content, `offset` and `length` to the same path resumes from them. It takes the temporary file's map of data ranges once, reads back each fragment whose whole range is data there, and checks it against its address, and fetches every other fragment: those that fail, and those of zeros. A hole is not written, and of it the call reads back only the parts of the file-system blocks it shares with the fragments beside it that hold data. A block is the unit a write allocates: on NTFS, 16 clusters. Where a whole block of a hole holds data in the temporary file, as every hole holding a whole block does on a file system that reports no holes, where a part read back holds bytes other than zeros, where the temporary file cannot be mapped, or where a part of a hole cannot be read back, the call empties the file and writes the range again. On macOS, where the file system holds holes, as APFS does, a whole block of a hole holding data does not empty the file, since the call deallocates the whole blocks of every hole of the range before the rename. The read covers every fragment of the range, so on a slow disk a resume of a mostly written range can take longer than fetching it again over a fast link. Where the file system refuses advisory locks, as some network file systems do, a write of any length writes as a shorter one does.

What each write does with the two files at its path: - a multi-fragment write of at least 32 MiB of other content or another range empties the temporary file before it writes its own, and any one removes both files once it completes; - a shorter multi-fragment write keeps nothing when it fails, and otherwise writes the temporary file and renames it into place, leaving the resume record; - a single-fragment write, and an item of the zero hash, write `path` directly and leave both.

A `path` takes one get at a time. Items that name the same path, in one call or in concurrent calls of this function or `lore_storage_get_file_resolved`, are not supported. Even so, multi-fragment writes of at least 32 MiB to one path exclude each other: such a write waits for another one writing the same temporary file, while a shorter write neither waits nor is waited for. Delete both files to reclaim the space of a write that will not be retried.

An `offset` past the end of the content is rejected with `INVALID_ARGUMENTS` without opening the target, so a destination that was already there survives.

func StorageGetFileResolved added in v0.10.0

func StorageGetFileResolved(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageGetFileResolvedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve one or more mutable keys and write the content they name to filesystem paths, in one

round trip.

`lore_storage_get_resolved` writing to a path instead of to the callback. Nothing is held whole on either side of the boundary: the resolve and the read of the root fragment share one request, and the content goes to disk fragment by fragment at its own offset, so a key naming something large needs neither the `streaming` mode nor a buffer for it. No `LORE_EVENT_STORAGE_GET_HEADER` or `LORE_EVENT_STORAGE_GET_DATA` is emitted, as with `lore_storage_get_file`.

The terminal event's `address` is the *resolved* address, so a caller still learns the key-to-hash mapping. A key with no mapping, or one naming absent content, reports `error_code = ADDRESS_NOT_FOUND`, carries a zero address, and leaves `path` untouched — there is no zero-hash truncation as in `lore_storage_get_file`, because a resolve that finds nothing is a miss rather than an address for empty content.

`offset` and `length` select part of the content, multi-fragment writes go through `<path>.loretmp` and an atomic rename, and holes are left unwritten, all as in `lore_storage_get_file`: the file holds exactly the requested range from its own first byte, and the target is either the finished range or untouched. A write of a range of at least 32 MiB that fails or stops keeps `<path>.loretmp` and its resume record, and is resumed from them, as in `lore_storage_get_file`, by a call whose key resolves to the same content and that asks for the same range. The files are kept, emptied and removed, and writes of at least 32 MiB to one path exclude each other, as there. A start past the end is rejected with `INVALID_ARGUMENTS` without opening the target, so a destination that was already there survives.

A `path` takes one get at a time. Items that name the same path, in one call or in concurrent calls of this function or `lore_storage_get_file`, are not supported.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_GET_ITEM_COMPLETE` | `lore_storage_get_item_complete_event_data_t` | Terminal per-item event, carrying the resolved address | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StorageGetMetadata

func StorageGetMetadata(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageGetMetadataArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Fetch fragment metadata for one or more `(partition, address)` pairs without paying the

payload bytes. Each item's terminal event carries the resolved `Fragment` (`flags`, `size_payload`, `size_content`); on miss `error_code == ADDRESS_NOT_FOUND`. An item the remote answers is written to the handle's local store as an entry without its payload, marked stored durable, so a put of the same content uploads nothing.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_GET_METADATA_ITEM_COMPLETE` | `lore_storage_get_metadata_item_complete_event_data_t` | Per-item terminal event | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StorageGetResolved added in v0.9.0

func StorageGetResolved(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageGetResolvedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Resolve one or more mutable keys and read the content they name, in one round trip.

`lore_storage_mutable_load` followed by `lore_storage_get`, performed by the server. The keys are read under the `LORE_KEY_TYPE_RESOLVE` key type, which is what `lore_storage_put_resolved` publishes; no other key type is resolvable this way.

The `address` in every event is the *resolved* address, so a caller can learn the key-to-hash mapping from the event stream. A key with no mapping, or one naming absent content, reports `error_code = ADDRESS_NOT_FOUND`, and the terminal event then carries a zero address.

Set `streaming` to receive one `LORE_EVENT_STORAGE_GET_DATA` per leaf fragment instead of a single reassembled buffer, exactly as `lore_storage_get` does. Without it the whole content is materialised in memory before the first byte reaches the callback, so a key naming something large should set it.

Set `fragments` to receive one `LORE_EVENT_STORAGE_GET_FRAGMENT` per leaf fragment in place of `LORE_EVENT_STORAGE_GET_DATA`, each carrying the leaf's `lore_fragment_t` and its payload as stored. No leaf is expanded or checked against its hash. A hole of the content arrives as a `LORE_EVENT_STORAGE_GET_FRAGMENT` whose fragment has a `size_payload` of zero and no payload, covering `size_content` bytes that read as zeros.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_GET_HEADER` | `lore_storage_get_header_event_data_t` | Size of the item's reassembled content, emitted before any DATA events | | `LORE_EVENT_STORAGE_GET_DATA` | `lore_storage_get_data_event_data_t` | Payload bytes — valid only during the callback invocation. One event per item, or one per leaf fragment when `streaming` is set | | `LORE_EVENT_STORAGE_GET_FRAGMENT` | `lore_storage_get_fragment_event_data_t` | One leaf fragment and its payload, in content order, when `fragments` is set. The payload is valid only during the callback invocation | | `LORE_EVENT_STORAGE_GET_ITEM_COMPLETE` | `lore_storage_get_item_complete_event_data_t` | Terminal per-item event | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StorageMutableCompareAndSwap added in v0.8.4

func StorageMutableCompareAndSwap(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageMutableCompareAndSwapArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Conditionally swap one or more mutable key values. Each item updates the key to `value` when

its current value matches `expected`, and reports the value the key held before the swap.

Each item acts on the local mutable store by default, or the remote mutable store when `globals.remote` is set (or the handle was opened remote-bound), over the shared storage session.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_MUTABLE_COMPARE_AND_SWAP_ITEM_COMPLETE` | `lore_storage_mutable_compare_and_swap_item_complete_event_data_t` | Per-item terminal event carrying `previous`; the swap took effect when `previous == expected` | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status: 0` iff every item succeeded |

func StorageMutableList added in v0.8.4

func StorageMutableList(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageMutableListArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
List the mutable key-value pairs of a given type for one or more partitions.

Acts on the local mutable store only; a remote-targeted call (`globals.remote`, or a remote-bound handle) is rejected with `INVALID_ARGUMENTS`. A zero/default partition lists every partition the caller can access.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_MUTABLE_LIST_ENTRY` | `lore_storage_mutable_list_entry_event_data_t` | One `(key, value)` pair, emitted before the item's terminal event | | `LORE_EVENT_STORAGE_MUTABLE_LIST_ITEM_COMPLETE` | `lore_storage_mutable_list_item_complete_event_data_t` | Per-item terminal event | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status: 0` iff every item succeeded |

func StorageMutableLoad added in v0.8.4

func StorageMutableLoad(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageMutableLoadArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Read one or more mutable key values.

Each item acts on the local mutable store by default, or the remote mutable store when `globals.remote` is set (or the handle was opened remote-bound), over the shared storage session.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_MUTABLE_LOAD_ITEM_COMPLETE` | `lore_storage_mutable_load_item_complete_event_data_t` | Per-item terminal event carrying the value; `error_code == ADDRESS_NOT_FOUND` on a miss | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status: 0` iff every item succeeded |

func StorageMutableStore added in v0.8.4

func StorageMutableStore(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageMutableStoreArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Write one or more mutable key-value pairs. Storing the null value removes the key.

Each item acts on the local mutable store by default, or the remote mutable store when `globals.remote` is set (or the handle was opened remote-bound), over the shared storage session.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_MUTABLE_STORE_ITEM_COMPLETE` | `lore_storage_mutable_store_item_complete_event_data_t` | Per-item terminal event | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status: 0` iff every item succeeded |

func StorageObliterate

func StorageObliterate(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageObliterateArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Delete one or more `(partition, address)` entries from the store.

Idempotent on absent items; emits one `OBLITERATE_ITEM_COMPLETE` event per item carrying `local_success` / `remote_success` / `error_code`.

func StorageOpen

func StorageOpen(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageOpenArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Open a content-addressed storage handle.

A disk-backed handle claims its stores for this process until it is released, so another process using the same stores waits until then. The claim ends once `lore_storage_close`, and `lore_revision_tree_close` of every revision tree loaded against the handle, have completed.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_OPENED` | `lore_storage_opened_event_data_t` | Emitted on success carrying the opened handle id | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` on success or the error code on failure |

func StoragePut

Store one or more content-addressed buffers.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_PUT_ITEM_COMPLETE` | `lore_storage_put_item_complete_event_data_t` | Emitted once per input item — success or failure; `stored_local`/`stored_remote` report where the content landed | | `LORE_EVENT_STORAGE_PUT_STATS` | `lore_storage_put_stats_event_data_t` | Emitted once at `stats >= 1`, after every item has finished and before `LORE_EVENT_COMPLETE`, whether or not items failed; not emitted for a call with no items or one that fails before its items run | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StoragePutFile

func StoragePutFile(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStoragePutFileArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Read one or more files into the content-addressed store.

Empty files short-circuit to the zero-hash address without opening for read.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_PUT_ITEM_COMPLETE` | `lore_storage_put_item_complete_event_data_t` | Emitted once per input item, carrying the computed address; `stored_local`/`stored_remote` report where the content landed | | `LORE_EVENT_STORAGE_PUT_STATS` | `lore_storage_put_stats_event_data_t` | Emitted once at `stats >= 1`, after every item has finished and before `LORE_EVENT_COMPLETE`, whether or not items failed; not emitted for a call with no items or one that fails before its items run | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StoragePutFileResolved added in v0.10.0

func StoragePutFileResolved(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStoragePutFileResolvedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Store one or more files and publish a mutable key naming each, in one round trip.

`lore_storage_put_resolved` reading its content from a path instead of a buffer, and identical to it in everything but the source: the key is published under `LORE_KEY_TYPE_RESOLVE`, the mapping is written only once the content is stored, publishing is last-writer-wins, and `remote_write = 1` publishes remotely as well as locally.

The caller never loads the file, and the library holds no more than one fragment of it: a file at or below the fragment threshold is read once into the single fragment it becomes, a larger one chunks straight off disk.

A zero `key` or a zero `partition` rejects with `INVALID_ARGUMENTS`, as does a missing, unreadable, or non-file `path` — a path that cannot be read is never taken for a delete, so a typo cannot retract a live key. A **zero-length** file does retract it, exactly as a zero-length `data` does in `lore_storage_put_resolved`.

A remote content upload that fails still leaves a successful local write, so the key is not published remotely and `stored_remote` is `0` while `error_code` stays `NONE`. Check `stored_remote`, not `error_code`, to confirm the key is visible to other clients.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_PUT_ITEM_COMPLETE` | `lore_storage_put_item_complete_event_data_t` | Emitted once per input item; `address` is the content the key now resolves to, and `stored_local`/`stored_remote` report where it landed | | `LORE_EVENT_STORAGE_PUT_STATS` | `lore_storage_put_stats_event_data_t` | Emitted once at `stats >= 1`, after every item has finished and before `LORE_EVENT_COMPLETE`, whether or not items failed; not emitted for a call with no items or one that fails before its items run | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StoragePutResolved added in v0.9.0

func StoragePutResolved(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStoragePutResolvedArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Store one or more buffers and publish a mutable key naming each, in one round trip.

`lore_storage_put` followed by `lore_storage_mutable_store`, with the mapping riding on whichever request carries the content's top-level fragment rather than costing one of its own. The key is published under `LORE_KEY_TYPE_RESOLVE`, making it readable by `lore_storage_get_resolved`, and the mapping is written only once the content is stored — so a key published this way never resolves to content that is not there. Writing the same key type directly with `lore_storage_mutable_store` carries no such guarantee. Content the server already holds uploads nothing, so its key takes a mapping write instead — still one request.

The local store always receives both the content and the mapping. `remote_write = 1` also publishes them remotely, matching `lore_storage_put`; there is no local-then-remote fallback. A zero `key` or a zero `partition` rejects with `INVALID_ARGUMENTS`.

A zero-length `data` **removes** the key's mapping rather than publishing one: no content is stored, the key is set to the zero hash, and `lore_storage_get_resolved` then reports `ADDRESS_NOT_FOUND` for it. The terminal event carries the zero content hash and the caller's context.

With `remote_write = 0` this evicts only the locally cached mapping. The local mutable store is a cache, not an authority, so a key published remotely resolves again on the next call. Deleting a published key requires `remote_write = 1`.

A remote content upload that fails still leaves a successful local write, so the key is not published remotely and `stored_remote` is `0` while `error_code` stays `NONE`. Check `stored_remote`, not `error_code`, to confirm the key is visible to other clients.

Publishing is last-writer-wins. Two callers publishing the same key concurrently both succeed, and the key ends up naming whichever content was published second — the first publisher is not told it was overwritten. Callers needing to detect a lost update should store the content with `lore_storage_put` and publish with `lore_storage_mutable_compare_and_swap`, which costs the second round trip this operation exists to avoid.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_PUT_ITEM_COMPLETE` | `lore_storage_put_item_complete_event_data_t` | Emitted once per input item; `address` is the content the key now resolves to, and `stored_local`/`stored_remote` report where it landed | | `LORE_EVENT_STORAGE_PUT_STATS` | `lore_storage_put_stats_event_data_t` | Emitted once at `stats >= 1`, after every item has finished and before `LORE_EVENT_COMPLETE`, whether or not items failed; not emitted for a call with no items or one that fails before its items run | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func StorageUpload

func StorageUpload(
	globals *types.LoreGlobalArgsFFI,
	args *types.LoreStorageUploadArgsFFI,
	config *types.LoreEventCallbackConfig,
) (int32, error)
Push locally-stored, not-yet-durable content to the remote store.

Whole-call pre-dispatch fails when the handle has no remote, when `globals.offline=1`, or when `globals.local=1`. Per-item: `partition == 0` → `INVALID_ARGUMENTS`; zero hash and already-durable both succeed with `already_durable=1` and no remote call; missing local payload → `ADDRESS_NOT_FOUND`. Otherwise the bytes are uploaded and the local entry is updated with `PayloadStoredDurable` set.

Events

| Tag | Data Type | Description | |-----|-----------|-------------| | `LORE_EVENT_STORAGE_UPLOAD_ITEM_COMPLETE` | `lore_storage_upload_item_complete_event_data_t` | Emitted once per input item — success or failure; `already_durable` is `1` where no upload was needed | | `LORE_EVENT_STORAGE_PUT_STATS` | `lore_storage_put_stats_event_data_t` | Emitted once at `stats >= 1`, after every item has finished and before `LORE_EVENT_COMPLETE`, whether or not items failed; not emitted for a call with no items or one that fails before its items run | | `LORE_EVENT_COMPLETE` | `lore_complete_event_data_t` | `status` is `0` iff every item succeeded, else the error code |

func Version

func Version() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL