Compare commits

...

3 commits

Author SHA1 Message Date
9e87f656fc chore(release): v0.2.0
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 03:47:00 +02:00
d3a3bccfbb 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>
2026-07-17 03:46:52 +02:00
9ec25d27d0 feat(typing): ship the PEP 561 py.typed marker
Consumers run mypy --strict against the inline annotations; without the
marker every imported symbol degrades to Any.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 03:46:51 +02:00
7 changed files with 33 additions and 5 deletions

View file

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "llm-ingestion-okf"
version = "0.1.0"
version = "0.2.0"
description = "Shared OKF (Open Knowledge Format) ingestion library: spec-based connectors, bundle inbox, and external-bundle import, with security delegated to llm-ingestion-guard."
readme = "README.md"
license = "MIT"

View file

@ -27,7 +27,7 @@ from .manifest import (
)
from .materialize import IngestResult, materialize_bundle
__version__ = "0.1.0"
__version__ = "0.2.0"
__all__ = [
"Extraction",

View file

@ -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)

View file

View file

@ -131,6 +131,16 @@ def test_result_lists_written_concept_files(file_setup: tuple[Path, Path]) -> No
assert result.written == (bundle / "ingest-orders.md",)
def test_result_exposes_manifest_stamp(file_setup: tuple[Path, Path]) -> None:
"""The §5 provenance stamp ({stem}@{sha256(raw)[:16]}) is returned on the
result so consumers never have to recompute it from the manifest bytes."""
manifest_path, bundle = file_setup
result = materialize_bundle(manifest_path, bundle, INGESTED_AT)
assert result.stamp == stamp_of(manifest_path)
content = (bundle / "ingest-orders.md").read_text(encoding="utf-8")
assert f"ingest_manifest: {result.stamp}\n" in content
def test_relative_root_resolves_against_manifest_dir(
tmp_path: Path, file_setup: tuple[Path, Path], monkeypatch: pytest.MonkeyPatch
) -> None:

16
tests/test_packaging.py Normal file
View file

@ -0,0 +1,16 @@
"""Packaging contract: the library is a PEP 561 typed package.
Consumers run mypy --strict against the inline annotations; without the
py.typed marker mypy degrades every imported symbol to Any.
"""
from __future__ import annotations
from pathlib import Path
import llm_ingestion_okf
def test_package_ships_py_typed_marker() -> None:
package_dir = Path(llm_ingestion_okf.__file__).parent
assert (package_dir / "py.typed").is_file()

2
uv.lock generated
View file

@ -166,7 +166,7 @@ wheels = [
[[package]]
name = "llm-ingestion-okf"
version = "0.1.0"
version = "0.2.0"
source = { editable = "." }
[package.dev-dependencies]