Project API

Project discovery and Ledgercore compatibility helpers are semi-public integration APIs. Discovery is read-only and must not initialize storage. Path resolution is confined by the project and Ledgercore bindings.

.. py:module:: memoryledger.project

Canonical schema-3 project discovery and read-only workspace resolution.

.. py:function:: resolve_canonical_workspace(start, loaded=None)

module:

memoryledger.project

Resolve and validate the registered schema-3 workspace without writes.

type start:
sphinx_autodoc_typehints_type:

\:py\:class\:\~pathlib.Path``

param start:
type loaded:

:sphinx_autodoc_typehints_type:\:py\:data\:\~typing.Any` | :py:obj:`None``

param loaded:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Workspace``

.. py:function:: resolve_workspace(start=None, *, allow_legacy=True)

module:

memoryledger.project

Discover the canonical workspace, optionally falling back to legacy data.

type start:
sphinx_autodoc_typehints_type:

\:py\:class\:\~pathlib.Path` | :py:obj:`None``

param start:
type allow_legacy:

:sphinx_autodoc_typehints_type:\:py\:class\:\bool``

param allow_legacy:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Workspace``

.. py:function:: workspace_as_compat_config(workspace)

module:

memoryledger.project

Expose the old Config shape to unchanged domain code during migration.

type workspace:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Workspace``

param workspace:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Config``

.. py:function:: init_canonical_workspace(project_name=None)

module:

memoryledger.project

Initialize a fresh schema-3 project with activation written last.

type project_name:
sphinx_autodoc_typehints_type:

\:py\:class\:\str` | :py:obj:`None``

param project_name:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Workspace``

.. py:function:: ensure_artifacts(workspace)

module:

memoryledger.project

Initialize the derived artifacts mount only when a render is written.

type workspace:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.Workspace``

param workspace:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~pathlib.Path``

.. py:function:: discover_storage(start=None)

module:

memoryledger.project

Return a non-mutating report for canonical, legacy, or invalid storage.

type start:
sphinx_autodoc_typehints_type:

\:py\:class\:\~pathlib.Path` | :py:obj:`None``

param start:
rtype:
sphinx_autodoc_typehints_type:

\:py\:class\:\~memoryledger.models.StorageDiscovery``

from memoryledger.project import discover_storage, resolve_workspace

Workspace creation and artifact initialization are explicit write operations; callers should prefer the CLI for those workflows.