feat(okf): wire adapter into public API — import_bundle carries link graph, package exposes okf namespace (TDD, +2)
This commit is contained in:
parent
b80c896fd9
commit
07e0b2153a
3 changed files with 31 additions and 2 deletions
|
|
@ -444,3 +444,22 @@ def test_link_graph_records_rejected_dangerous_link():
|
|||
bundle = {"a/main.md": "---\ntype: t\n---\n[x](javascript:alert(1))\n"}
|
||||
graph = link_graph(bundle)
|
||||
assert any(from_id == "a/main" for from_id, _target, _reason in graph.rejected)
|
||||
|
||||
|
||||
# --- wiring: import_bundle carries the cross-link graph, and the package
|
||||
# exposes the okf adapter as a first-class namespace ----------------------
|
||||
|
||||
def test_import_bundle_attaches_link_graph():
|
||||
bundle = {
|
||||
"a/main.md": "---\ntype: t\n---\nSee [later](/b/target.md).\n",
|
||||
"a/other.md": "---\ntype: t\n---\nNothing linked here.\n",
|
||||
}
|
||||
result = import_bundle(bundle)
|
||||
assert ("a/main", "b/target") in result.links.dangling
|
||||
|
||||
|
||||
def test_okf_adapter_is_exposed_from_package():
|
||||
import llm_ingestion_guard as guard
|
||||
|
||||
assert "okf" in guard.__all__
|
||||
assert guard.okf.import_bundle is import_bundle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue