refactor(mcp): extract order services into independent project
Remove Kingdee sync, business CLI/MCP tools, and internal order-query routing now owned by the separate kingdee-orders-mcp project. Keep Wiki retrieval, file assets and ingest available in code while its deployed service is off. Retain legacy response fields with business access disabled, and document migration ownership and rollback without exposing credentials or data. Validation: 174 Wiki tests pass. Independent order service verified with 36 template parity checks, authenticated HTTP queries, and a real sync.
This commit is contained in:
@@ -15,7 +15,7 @@ import manage_mcp_service
|
||||
|
||||
|
||||
class McpServiceConfigTests(unittest.TestCase):
|
||||
def test_set_business_only_preserves_connection_and_restarts_once_without_opencode(self):
|
||||
def test_set_file_assets_only_preserves_connection_and_restarts_once_without_opencode(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
config_home = root / "config"
|
||||
@@ -31,11 +31,11 @@ class McpServiceConfigTests(unittest.TestCase):
|
||||
patch.object(manage_mcp_service, "resolve_opencode_path", side_effect=AssertionError("no OpenCode")),
|
||||
patch("builtins.print"),
|
||||
):
|
||||
result = manage_mcp_service.main(["tools", "set", "business", "--project-root", str(root)])
|
||||
result = manage_mcp_service.main(["tools", "set", "file-assets", "--project-root", str(root)])
|
||||
self.assertEqual(result, 0)
|
||||
restart.assert_called_once()
|
||||
config = manage_mcp_service.saved_service_config(root)
|
||||
self.assertEqual(config.enabled_tools, ("business",))
|
||||
self.assertEqual(config.enabled_tools, ("file-assets",))
|
||||
self.assertEqual(config.token, "existing-token")
|
||||
self.assertEqual(config.public_base_url, "https://orders.example.test/mcp")
|
||||
self.assertEqual(config.port, 8765)
|
||||
@@ -851,7 +851,7 @@ class McpServiceConfigTests(unittest.TestCase):
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low\n", env_content)
|
||||
self.assertNotIn("OBSIDIAN_MCP_INGEST_OPENCODE_PATH=", env_content)
|
||||
self.assertIn("Enabled tool groups:\nfile-assets,query", output)
|
||||
self.assertIn("Use ask_wiki for ordinary wiki, business facts, or hybrid questions.", output)
|
||||
self.assertIn("Use ask_wiki for wiki questions.", output)
|
||||
prepare_runtime.assert_called_once_with(project_root, uv_path=Path("/home/nac/.local/bin/uv"))
|
||||
run_systemctl.assert_has_calls(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user