The module docstring and README claimed the library "calls the guard at every persist gate". That described the intended end state in the present tense. Door A -- the only door shipped -- has zero runtime dependencies and calls no guard function before writing to disk. Both places now say so, and state that gating external or untrusted content is the caller's responsibility (okf.import_bundle, or prepare_input / screen_output) until the persist gates land with Doors B and C. Reported as F2 in a dogfood review by claude-playlist-corpus, which read the earlier wording as safe-by-default and had to wire the gating itself. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WdVgowYC4LARgvNdNMiuvz
55 lines
1.6 KiB
Python
55 lines
1.6 KiB
Python
"""Shared OKF (Open Knowledge Format) ingestion library.
|
|
|
|
Three entry doors: spec-based ingestion (manifest -> connector ->
|
|
deterministic materialization -> index), a bundle inbox converting common
|
|
file types to OKF concepts, and import of external OKF bundles.
|
|
|
|
Security is owned by llm-ingestion-guard, never reimplemented here. Note
|
|
what that does and does not mean today: Door A is UNGATED. It has zero
|
|
runtime dependencies and calls no guard function on the way to disk. A
|
|
caller that materializes external or otherwise untrusted content is
|
|
responsible for gating it -- via guard's okf.import_bundle for received
|
|
bundles, or prepare_input/screen_output around extracted text. Do not read
|
|
"security is delegated" as "safe by default": materialize_bundle writes
|
|
what it is given. The guard-calling persist gates arrive with Doors B and C.
|
|
|
|
Door A (spec-based ingestion) public surface: materialize_bundle plus the
|
|
typed error hierarchy rooted in IngestError.
|
|
"""
|
|
|
|
from .errors import (
|
|
IngestError,
|
|
ManifestError,
|
|
MaterializationError,
|
|
NetworkGateError,
|
|
RenderError,
|
|
SourceError,
|
|
)
|
|
from .manifest import (
|
|
Extraction,
|
|
FileSource,
|
|
HttpSource,
|
|
Manifest,
|
|
SqlSource,
|
|
load_manifest,
|
|
)
|
|
from .materialize import IngestResult, materialize_bundle
|
|
|
|
__version__ = "0.3.1"
|
|
|
|
__all__ = [
|
|
"Extraction",
|
|
"FileSource",
|
|
"HttpSource",
|
|
"IngestError",
|
|
"IngestResult",
|
|
"Manifest",
|
|
"ManifestError",
|
|
"MaterializationError",
|
|
"NetworkGateError",
|
|
"RenderError",
|
|
"SourceError",
|
|
"SqlSource",
|
|
"load_manifest",
|
|
"materialize_bundle",
|
|
]
|