feat(api): expose the §5 provenance stamp on IngestResult
The stamp ({stem}@{sha256(raw)[:16]}) was computed internally but only
written into frontmatter, forcing consumers to recompute it from the
manifest bytes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
9ec25d27d0
commit
d3a3bccfbb
2 changed files with 14 additions and 2 deletions
|
|
@ -42,9 +42,11 @@ _MANAGED_LINE_RE = re.compile(r"^- \[(?P<label>[^\]]*)\]\((?P<target>[^)]+)\)$")
|
|||
|
||||
@dataclass(frozen=True)
|
||||
class IngestResult:
|
||||
"""The concept files written by one materialization run."""
|
||||
"""The concept files written by one materialization run, and the §5
|
||||
provenance stamp (`{stem}@{sha256(raw)[:16]}`) they were stamped with."""
|
||||
|
||||
written: tuple[Path, ...]
|
||||
stamp: str
|
||||
|
||||
|
||||
def _render_frontmatter(frontmatter: dict[str, str]) -> str:
|
||||
|
|
@ -268,4 +270,4 @@ def materialize_bundle(
|
|||
_update_index_lines(index_path, owned - staged_names, labels_by_target)
|
||||
for extraction in manifest.extractions:
|
||||
_link_in_index(bundle, generated_filename(extraction.id), extraction.title)
|
||||
return IngestResult(written=written)
|
||||
return IngestResult(written=written, stamp=stamp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue