DocShell.Generate.Collection.Provenance (DocShell v0.4.0)

Copy Markdown View Source

Admits source records and verifies their relationship to a collection's content.

File identity is independent of document identity: several changelog releases may originate in one file, but every document has one globally unique ID and one provenance record. Source indexes are validated and indexed once, making reference checks linear rather than searching the corpus for every document.

Unknown manifested source indexes use the same entry contract as the built-in sources. Unreferenced extension artifacts remain opaque. Source ASTs are reconstructed from the existing content artifact; projection compatibility is checked before publication so discarded content is never restored implicitly.

Summary

Functions

Checks portable path ownership, allowing releases to share their changelog file.

Validates indexes and exact provenance coverage, returning qualified documents in source order.

Checks a complete extracted entry, including its recursive AST and JSON fields.

Rejects presentations from which the original source ASTs cannot be reconstructed.

Checks provenance record shapes and their canonical relative paths.

Functions

add_path(paths, path, artifact)

@spec add_path(map(), String.t() | nil, String.t()) :: {:ok, map()} | {:error, term()}

Checks portable path ownership, allowing releases to share their changelog file.

documents(sources, envelopes, collection_id)

@spec documents([map()], map(), String.t()) :: {:ok, [map()]} | {:error, term()}

Validates indexes and exact provenance coverage, returning qualified documents in source order.

valid_entry?(entry)

@spec valid_entry?(term()) :: boolean()

Checks a complete extracted entry, including its recursive AST and JSON fields.

validate_projection(entries, content)

@spec validate_projection([map()], map()) :: :ok | {:error, term()}

Rejects presentations from which the original source ASTs cannot be reconstructed.

validate_sources(sources)

@spec validate_sources(term()) :: :ok | {:error, term()}

Checks provenance record shapes and their canonical relative paths.