Bound indexed retrieval operations
This commit is contained in:
parent
ad4f52b239
commit
c69cd16515
6 changed files with 208 additions and 46 deletions
|
|
@ -333,6 +333,9 @@ class DocForgeCoreTests(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
["proof.validation"], [item["node_id"] for item in filtered["results"]]
|
||||
)
|
||||
limited_filter = index.filter_nodes(limit=1)
|
||||
self.assertEqual(1, limited_filter["count"])
|
||||
self.assertTrue(limited_filter["truncated"])
|
||||
dependencies = index.dependencies("guide.workflow", depth=2)
|
||||
self.assertEqual(
|
||||
["guide.foundation"], [item["node_id"] for item in dependencies["results"]]
|
||||
|
|
@ -346,6 +349,23 @@ class DocForgeCoreTests(unittest.TestCase):
|
|||
["guide.workflow", "proof.validation"],
|
||||
[item["node_id"] for item in impact["results"]],
|
||||
)
|
||||
limited = index.impact("guide.foundation", depth=2, limit=1)
|
||||
self.assertEqual(["guide.workflow"], [item["node_id"] for item in limited["results"]])
|
||||
self.assertEqual(1, limited["limit"])
|
||||
self.assertTrue(limited["truncated"])
|
||||
self.assertLessEqual(
|
||||
limited["examined_edges"],
|
||||
limited["examined_edges_limit"],
|
||||
)
|
||||
|
||||
complete_limit = index.dependencies("guide.workflow", depth=2, limit=1)
|
||||
self.assertEqual(1, complete_limit["count"])
|
||||
self.assertFalse(complete_limit["truncated"])
|
||||
|
||||
limited_backlinks = index.backlinks("guide.workflow", limit=1)
|
||||
self.assertEqual(1, limited_backlinks["count"])
|
||||
self.assertEqual(1, limited_backlinks["limit"])
|
||||
self.assertFalse(limited_backlinks["truncated"])
|
||||
|
||||
def test_query_rechecks_source_identity_before_returning(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
|
|
|||
|
|
@ -131,9 +131,15 @@ class DocForgeMcpTests(unittest.IsolatedAsyncioTestCase):
|
|||
("docforge_get_logic", {"owner_node_id": "guide.workflow"}),
|
||||
("docforge_search", {"query": "canonical nodes", "limit": 5}),
|
||||
("docforge_filter_nodes", {"family": "proof", "tag": "validation"}),
|
||||
("docforge_backlinks", {"node_id": "guide.workflow"}),
|
||||
("docforge_dependencies", {"node_id": "guide.workflow", "depth": 2}),
|
||||
("docforge_impact", {"node_id": "guide.foundation", "depth": 2}),
|
||||
("docforge_backlinks", {"node_id": "guide.workflow", "limit": 5}),
|
||||
(
|
||||
"docforge_dependencies",
|
||||
{"node_id": "guide.workflow", "depth": 2, "limit": 5},
|
||||
),
|
||||
(
|
||||
"docforge_impact",
|
||||
{"node_id": "guide.foundation", "depth": 2, "limit": 5},
|
||||
),
|
||||
("docforge_get_context", {"profile": "active", "budget": 180}),
|
||||
("docforge_validate_project", {}),
|
||||
("docforge_render_status", {}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue