Bound adapter assemblies and extraction caches
This commit is contained in:
parent
9cd7c4e424
commit
f00aa65a73
4 changed files with 232 additions and 8 deletions
|
|
@ -39,6 +39,7 @@ from docforge.mcp_server import (
|
|||
)
|
||||
from docforge.models import (
|
||||
Edge,
|
||||
Limits,
|
||||
LogicEdge,
|
||||
LogicNode,
|
||||
LogicProjection,
|
||||
|
|
@ -341,6 +342,23 @@ class AdapterContractTests(unittest.TestCase):
|
|||
self.assertEqual("Workflow", index.get_node("guide.workflow")["node"]["title"])
|
||||
self.assertEqual(projection.identity(), projection.identity())
|
||||
|
||||
def test_adapter_project_enforces_graph_bounds_before_publication(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory).resolve()
|
||||
project = AdapterProject(
|
||||
Loader(self.projection(root)),
|
||||
cache_root=root / ".cache" / "bounded",
|
||||
settings=AdapterProjectSettings(limits=Limits(max_nodes=1)),
|
||||
)
|
||||
|
||||
with self.assertRaises(DocForgeError) as captured:
|
||||
project.load()
|
||||
|
||||
self.assertEqual("adapter_limit", captured.exception.code)
|
||||
self.assertEqual("nodes", captured.exception.details["kind"])
|
||||
self.assertEqual(1, captured.exception.details["maximum"])
|
||||
self.assertEqual(2, captured.exception.details["actual"])
|
||||
|
||||
def test_projection_rejects_unsorted_metadata_graph_and_identity_changes(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory).resolve()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue