Add incremental adapter compiler boundary
This commit is contained in:
parent
82b3b90521
commit
696b62f9f8
20 changed files with 1592 additions and 122 deletions
|
|
@ -69,7 +69,7 @@ class DocForgeMcpTests(unittest.IsolatedAsyncioTestCase):
|
|||
|
||||
names = tuple(tool.name for tool in response.tools)
|
||||
self.assertEqual(ALL_TOOLS, names)
|
||||
self.assertEqual(10, len(PROPOSAL_TOOLS))
|
||||
self.assertEqual(11, len(PROPOSAL_TOOLS))
|
||||
self.assertFalse(
|
||||
any(
|
||||
token in name
|
||||
|
|
@ -328,6 +328,49 @@ class DocForgeMcpTests(unittest.IsolatedAsyncioTestCase):
|
|||
self.assertTrue((root / ".docforge/previews/mcp-update/manual.html").is_file())
|
||||
self.assertFalse((root / ".docforge/rendered/manual.html").exists())
|
||||
|
||||
async def test_relationship_only_mcp_tool_queues_no_content_rewrite(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = self.copy_fixture("alpha", Path(directory))
|
||||
project = Project.open(root)
|
||||
ProjectIndex(project).build()
|
||||
workflow = next(
|
||||
node for node in project.load().nodes if node.node_id == "guide.workflow"
|
||||
)
|
||||
async with create_connected_server_and_client_session(
|
||||
create_server(root, "alpha-editor"), raise_exceptions=True
|
||||
) as session:
|
||||
created = await session.call_tool(
|
||||
"docforge_create_changeset", {"changeset_id": "mcp-relationship"}
|
||||
)
|
||||
proposed = await session.call_tool(
|
||||
"docforge_propose_relationship_update",
|
||||
{
|
||||
"changeset_id": "mcp-relationship",
|
||||
"expected_changeset_hash": created.structuredContent["changeset_hash"],
|
||||
"node_id": "guide.workflow",
|
||||
"expected_content_hash": workflow.content_hash,
|
||||
"relationship_changes": [
|
||||
{
|
||||
"action": "remove",
|
||||
"source_id": "guide.workflow",
|
||||
"relation": "depends_on",
|
||||
"target_id": "guide.foundation",
|
||||
}
|
||||
],
|
||||
"rationale": "Exercise the relationship-only MCP boundary.",
|
||||
},
|
||||
)
|
||||
diff = await session.call_tool(
|
||||
"docforge_get_changeset_diff",
|
||||
{"changeset_id": "mcp-relationship"},
|
||||
)
|
||||
|
||||
self.assertEqual("ok", proposed.structuredContent["status"])
|
||||
self.assertEqual("", diff.structuredContent["changes"][0]["content_diff"])
|
||||
self.assertEqual({}, diff.structuredContent["changes"][0]["metadata"])
|
||||
self.assertTrue((root / ".docforge/changesets/mcp-relationship.json").is_file())
|
||||
self.assertFalse((root / ".docforge/rendered/manual.html").exists())
|
||||
|
||||
async def test_server_without_writer_rejects_proposal_mutation_structurally(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = self.copy_fixture("alpha", Path(directory))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue