jellycell.cache.manifest

Pydantic schema for cell execution manifests.

One JSON file per cell execution, stored under .jellycell/cache/manifests/. The schema here is a spec §10.1 contract — every field that users or agents can see is versioned via schema_version.

See spec §2.3 for the full manifest shape.

Module Contents

Classes

StreamOutput

Captured stdout/stderr stream.

DisplayDataOutput

A display_data mime bundle (e.g., images, html).

ExecuteResultOutput

The final expression value of a cell.

ErrorOutput

An exception raised during cell execution.

ArtifactRecord

A file produced by a cell (via jc.save, jc.figure, jc.table).

Manifest

A single cell execution’s manifest (spec §2.3).

Data

API

jellycell.cache.manifest.MANIFEST_SCHEMA_VERSION

1

class jellycell.cache.manifest.StreamOutput(/, **data: Any)

Bases: pydantic.BaseModel

Captured stdout/stderr stream.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

type: Literal[stream]

‘stream’

name: Literal[stdout, stderr]

None

blob: str

None

class jellycell.cache.manifest.DisplayDataOutput(/, **data: Any)

Bases: pydantic.BaseModel

A display_data mime bundle (e.g., images, html).

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

type: Literal[display_data]

‘display_data’

mime: str

None

blob: str

None

w: int | None

None

h: int | None

None

class jellycell.cache.manifest.ExecuteResultOutput(/, **data: Any)

Bases: pydantic.BaseModel

The final expression value of a cell.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

type: Literal[execute_result]

‘execute_result’

mime: str

None

blob: str

None

execution_count: int | None

None

class jellycell.cache.manifest.ErrorOutput(/, **data: Any)

Bases: pydantic.BaseModel

An exception raised during cell execution.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

type: Literal[error]

‘error’

ename: str

None

evalue: str

None

traceback: list[str]

None

jellycell.cache.manifest.OutputRecord

None

class jellycell.cache.manifest.ArtifactRecord(/, **data: Any)

Bases: pydantic.BaseModel

A file produced by a cell (via jc.save, jc.figure, jc.table).

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

path: str

None

Path relative to the project root.

sha256: str

None

Hex sha256 of the file contents.

size: int

None

Size in bytes.

mime: str | None

None

MIME type, if known.

caption: str | None

None

Human-readable caption for the artifact — used as the figure / table heading in tearsheets and the alt text on image embeds.

Optional, additive field (§10.1 safe). Populated when the producing jc.* call passes caption="..."; otherwise the tearsheet falls back to the cell name.

notes: str | None

None

Longer analyst-authored notes shown under the caption in tearsheets. Use for methodology, caveats, data-source reminders. Optional additive.

tags: list[str]

‘Field(…)’

Free-form tags (e.g. ["regression", "diagnostic"]) for grouping and filtering. Currently surface-only metadata; future versions may use tags for tearsheet section ordering. Optional additive.

class jellycell.cache.manifest.Manifest(/, **data: Any)

Bases: pydantic.BaseModel

A single cell execution’s manifest (spec §2.3).

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config

‘ConfigDict(…)’

schema_version: int

None

§10.1 contract.

cache_key: str

None

notebook: str

None

cell_id: str

None

cell_name: str | None

None

source_hash: str

None

dep_keys: list[str]

‘Field(…)’

env_hash: str

None

executed_at: datetime.datetime

None

duration_ms: int

None

status: Literal[ok, error, cached]

None

outputs: list[jellycell.cache.manifest.OutputRecord]

‘Field(…)’

artifacts: list[jellycell.cache.manifest.ArtifactRecord]

‘Field(…)’

to_json() str

Serialize to canonical JSON with 2-space indentation.

classmethod from_json(text: str) jellycell.cache.manifest.Manifest

Parse a manifest from JSON text.

write(path: pathlib.Path) None

Write to path as JSON with a trailing newline.

classmethod read(path: pathlib.Path) jellycell.cache.manifest.Manifest

Read a manifest from disk.