{"id":110691,"date":"2026-09-29T08:32:44","date_gmt":"2026-09-29T00:32:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/110691.html"},"modified":"2026-09-29T08:32:44","modified_gmt":"2026-09-29T00:32:44","slug":"%e8%bd%af%e7%ba%a6%e6%9d%9f%e4%b8%8e%e7%a1%ac%e7%ba%a6%e6%9d%9f%ef%bc%9aagents-md-%e5%86%99%e4%ba%86%e7%a6%81%e6%ad%a2%e8%b7%a8%e5%b1%82%e8%b0%83%e7%94%a8%ef%bc%8c%e5%a4%9f%e5%90%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/110691.html","title":{"rendered":"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f"},"content":{"rendered":"<h2><\/h2>\n<h3>\u4e00\u3001\u4e00\u6761\u5199\u5728\u6587\u4ef6\u7b2c\u4e00\u884c\u7684\u89c4\u5219&#xff0c;\u4e09\u4e2a\u6708\u540e\u88ab\u8fdd\u53cd\u4e86<\/h3>\n<p>\u8fd8\u662f shop \u8ba2\u5355\u670d\u52a1\u3002\u9879\u76ee\u5f00\u5de5\u90a3\u5929&#xff0c;\u4f60\u4eec\u5728 AGENTS.md \u7684\u201c\u4ec0\u4e48\u4e0d\u80fd\u505a\u201d\u4e00\u8282\u5199\u4e0b\u7b2c\u4e00\u6761\u89c4\u5219&#xff1a;<\/p>\n<p>&#8211; \u4e0d\u5141\u8bb8 domain \u5c42\u548c services \u5c42\u76f4\u63a5\u4f9d\u8d56\u6570\u636e\u5e93\u9a71\u52a8\u6216 repositories \u7684\u5b9e\u73b0\u7ec6\u8282<\/p>\n<p>\u8fd9\u6761\u89c4\u5219\u4e00\u76f4\u6709\u6548\u3002\u5b83\u5199\u5728\u9879\u76ee\u6839\u76ee\u5f55&#xff0c;\u4efb\u4f55\u4e00\u6b21\u4efb\u52a1\u5f00\u59cb\u524d&#xff0c;Agent \u90fd\u4f1a\u8bfb\u5230\u5b83\u3002\u4e09\u4e2a\u6708\u91cc&#xff0c;\u5927\u5927\u5c0f\u5c0f\u7684\u6539\u52a8\u90fd\u9075\u5b88\u4e86\u8fd9\u6761\u7ea6\u5b9a&#xff0c;\u8ba2\u5355\u3001\u652f\u4ed8\u3001\u9000\u6b3e\u76f8\u5173\u7684\u7528\u4f8b\u90fd\u89c4\u89c4\u77e9\u77e9\u5730\u901a\u8fc7\u4ed3\u5e93\u63a5\u53e3\u8bbf\u95ee\u6570\u636e\u3002<\/p>\n<p>\u7136\u540e\u6709\u4e00\u5929&#xff0c;\u4f60\u8981\u4e0a\u7ebf\u4e00\u4e2a\u65b0\u7684\u5ba1\u8ba1\u9700\u6c42\u3002Agent \u7684\u4efb\u52a1\u662f&#xff1a;\u8ba9\u53d6\u6d88\u8ba2\u5355\u65f6\u5199\u5165\u7684\u5ba1\u8ba1\u4e8b\u4ef6\u548c\u72b6\u6001\u53d8\u66f4\u5728\u540c\u4e00\u4e2a\u4e8b\u52a1\u91cc\u5b8c\u6210\u3002\u5b83\u8bfb\u4e86\u4ee3\u7801&#xff0c;\u53d1\u73b0\u4e8b\u52a1\u8fb9\u754c\u5728\u4ed3\u5e93\u5b9e\u73b0\u91cc&#xff0c;\u800c\u7528\u4f8b\u5c42\u62ff\u4e0d\u5230\u4e8b\u52a1\u5bf9\u8c61\u3002\u4e8e\u662f\u5b83\u5728 src\/orders\/services\/cancel_order.py \u9876\u90e8\u52a0\u4e86\u4e00\u884c&#xff1a;<\/p>\n<p><span class=\"token keyword\">from<\/span> orders<span class=\"token punctuation\">.<\/span>repositories<span class=\"token punctuation\">.<\/span>postgres <span class=\"token keyword\">import<\/span> session_factory<\/p>\n<p>\u7136\u540e\u6253\u5f00\u4f1a\u8bdd\u3001\u5f00\u542f\u4e8b\u52a1\u3001\u5199\u5ba1\u8ba1\u4e8b\u4ef6\u3001\u63d0\u4ea4\u3002\u529f\u80fd\u662f\u5bf9\u7684&#xff0c;\u8bc4\u5ba1\u7684\u65f6\u5019\u8fd9\u6bb5\u4ee3\u7801\u770b\u8d77\u6765\u4e5f\u633a\u81ea\u7136&#xff1a;\u4e0d\u5c31\u662f\u591a\u62ff\u4e86\u4e00\u4e2a\u4f1a\u8bdd\u5417\u3002<\/p>\n<p>\u9ebb\u70e6\u51fa\u73b0\u5728\u4e24\u5929\u540e\u3002\u56e2\u961f\u628a\u8ba2\u5355\u4ed3\u5e93\u7684\u5b9e\u73b0\u4ece PostgreSQL \u6362\u6210\u4e86\u5185\u5b58\u7248&#xff0c;\u7528\u4e8e\u8dd1\u4e00\u6279\u5feb\u901f\u96c6\u6210\u6d4b\u8bd5\u3002\u6240\u6709\u7528\u4f8b\u77ac\u95f4\u5931\u8d25&#xff0c;\u56e0\u4e3a\u90a3\u4e2a\u4ece postgres \u6a21\u5757\u5bfc\u5165\u7684\u4f1a\u8bdd\u5bf9\u8c61\u5728\u5185\u5b58\u7248\u91cc\u4e0d\u5b58\u5728\u3002\u8fd9\u65f6\u5019\u5927\u5bb6\u624d\u60f3\u8d77\u90a3\u6761\u89c4\u5219&#xff0c;\u5e76\u4e14\u53d1\u73b0\u4e00\u4ef6\u8ba9\u4eba\u4e0d\u592a\u8212\u670d\u7684\u4e8b&#xff1a;\u89c4\u5219\u4e00\u76f4\u90fd\u5728&#xff0c;\u8c01\u90fd\u77e5\u9053&#xff0c;\u53ef\u5b83\u4ece\u6765\u6ca1\u6709\u62e6\u4e0b\u8fc7\u4efb\u4f55\u4e00\u6b21\u63d0\u4ea4\u3002<\/p>\n<p>\u4fee\u590d\u82b1\u7684\u4e0d\u662f\u5f88\u591a\u65f6\u95f4&#xff0c;\u4e00\u5171\u6539\u4e86\u4e09\u5904\u3002\u771f\u6b63\u82b1\u65f6\u95f4\u7684\u662f\u8ba8\u8bba&#xff1a;\u8fd9\u6761\u89c4\u5219\u5230\u5e95\u8981\u4e0d\u8981\u4fdd\u7559&#xff1f;\u5982\u679c\u4fdd\u7559&#xff0c;\u600e\u4e48\u4fdd\u8bc1\u5b83\u4e0b\u6b21\u4e0d\u518d\u88ab\u65e0\u58f0\u5730\u8fdd\u53cd&#xff1f;\u8ba8\u8bba\u7684\u6700\u540e\u7ed3\u8bba\u4e5f\u5f88\u7b80\u5355\u2014\u2014\u628a\u5b83\u5199\u6210\u4e00\u6761\u68c0\u67e5\u3002\u8fd9\u7bc7\u5269\u4e0b\u7684\u90e8\u5206\u5c31\u662f\u5728\u8bb2\u8fd9\u6761\u68c0\u67e5\u957f\u4ec0\u4e48\u6837\u3002<\/p>\n<p>\u8fd9\u4ef6\u4e8b\u7684\u5173\u952e\u4e0d\u5728\u4e8e\u201c\u6a21\u578b\u4e0d\u542c\u8bdd\u201d\u3002\u6070\u6070\u76f8\u53cd&#xff0c;\u5b83\u5927\u6982\u7387\u8bfb\u5230\u8fc7\u90a3\u6761\u89c4\u5219&#xff0c;\u4e5f\u7406\u89e3\u5b83\u3002\u5b83\u8fdd\u53cd\u89c4\u5219\u7684\u539f\u56e0\u975e\u5e38\u52a1\u5b9e&#xff1a;\u773c\u4e0b\u7684\u4efb\u52a1\u9700\u8981\u4e8b\u52a1&#xff0c;\u800c\u90a3\u6761\u8def\u5f84\u6700\u987a\u624b\u3002\u89c4\u5219\u548c\u65b9\u4fbf\u4e4b\u95f4&#xff0c;\u89c4\u5219\u8f93\u4e86\u3002<\/p>\n<p>\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e2a\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u7ec6\u8282&#xff1a;\u90a3\u6b21\u8fdd\u89c4\u7684\u4ee3\u7801\u672c\u8eab\u8d28\u91cf\u4e0d\u5dee\u3002\u547d\u540d\u6e05\u695a\u3001\u5f02\u5e38\u8def\u5f84\u5b8c\u6574\u3001\u4e8b\u52a1\u8fb9\u754c\u4e5f\u8003\u8651\u5230\u4e86\u3002\u5b83\u552f\u4e00\u7684\u9519\u8bef\u662f\u8d70\u4e86\u4e00\u6761\u88ab\u7ea6\u5b9a\u6392\u9664\u7684\u8def\u3002\u6b63\u56e0\u4e3a\u5982\u6b64&#xff0c;\u8bc4\u5ba1\u7684\u4eba\u4e5f\u4f1a\u72b9\u8c6b\u2014\u2014\u4ee3\u7801\u770b\u8d77\u6765\u6ca1\u95ee\u9898&#xff0c;\u4e3a\u4ec0\u4e48\u8981\u6253\u56de\u53bb&#xff1f;\u5f53\u89c4\u5219\u53ea\u662f\u6587\u5b57\u65f6&#xff0c;\u8fd9\u79cd\u72b9\u8c6b\u51e0\u4e4e\u6ce8\u5b9a\u4f1a\u4ee5\u201c\u5148\u5408\u8fdb\u53bb\u518d\u8bf4\u201d\u7ed3\u675f\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u8fd9\u4e00\u7bc7\u8981\u8bb2\u7684\u4e1c\u897f&#xff1a;\u6587\u5b57\u7ea6\u5b9a\u548c\u53ef\u6267\u884c\u68c0\u67e5&#xff0c;\u662f\u4e24\u79cd\u4e0d\u540c\u6027\u8d28\u7684\u7ea6\u675f\u3002\u524d\u8005\u63d0\u9ad8\u6b63\u786e\u884c\u4e3a\u7684\u6982\u7387&#xff0c;\u540e\u8005\u51b3\u5b9a\u9519\u8bef\u884c\u4e3a\u6709\u6ca1\u6709\u540e\u679c\u3002\u5c11\u4e86\u540e\u8005&#xff0c;\u89c4\u5219\u4f1a\u5728\u6700\u9700\u8981\u5b83\u7684\u65f6\u5019\u6070\u597d\u5931\u5b88\u3002<\/p>\n<h3>\u4e8c\u3001\u5148\u628a\u8bcd\u8bb2\u660e\u767d<\/h3>\n<p>\u8f6f\u7ea6\u675f&#xff08;soft constraint&#xff09;&#xff1a;\u5199\u5728\u6587\u6863\u3001\u4efb\u52a1\u5355\u3001\u6ce8\u91ca\u6216\u8005\u53e3\u5934\u7ea6\u5b9a\u91cc\u7684\u89c4\u5219&#xff0c;\u6bd4\u5982\u201c\u4e0d\u8981\u8de8\u5c42\u8c03\u7528\u201d\u201c\u4fdd\u6301\u51fd\u6570\u77ed\u5c0f\u201d\u3002\u5b83\u901a\u8fc7\u5f71\u54cd\u4eba\u7684\u5224\u65ad\u548c\u6a21\u578b\u7684\u884c\u4e3a\u6765\u8d77\u4f5c\u7528&#xff0c;\u8fdd\u89c4\u65f6\u4e0d\u4f1a\u6709\u4efb\u4f55\u81ea\u52a8\u53cd\u5e94\u3002\u5b83\u7684\u597d\u5904\u662f\u4fbf\u5b9c\u3001\u7075\u6d3b&#xff0c;\u4ee3\u4ef7\u662f\u4e0d\u786e\u5b9a\u3002<\/p>\n<p>\u786c\u7ea6\u675f&#xff08;hard constraint&#xff09;&#xff1a;\u7531\u673a\u5668\u5224\u5b9a\u7684\u68c0\u67e5&#xff0c;\u8fdd\u89c4\u65f6\u6d41\u7a0b\u76f4\u63a5\u5931\u8d25\u3002\u6bd4\u5982\u4e00\u6761\u6d4b\u8bd5\u3001\u4e00\u4e2a\u9759\u6001\u68c0\u67e5\u3001\u4e00\u4e2a CI \u5fc5\u987b\u901a\u8fc7\u7684\u6b65\u9aa4\u3002\u5b83\u4e0d\u9700\u8981\u4efb\u4f55\u4eba\u8bb0\u5f97&#xff0c;\u4e5f\u4e0d\u63a5\u53d7\u89e3\u91ca\u3002\u5b83\u7684\u597d\u5904\u662f\u786e\u5b9a&#xff0c;\u4ee3\u4ef7\u662f\u9700\u8981\u6709\u4eba\u5148\u628a\u5b83\u5199\u51fa\u6765\u3002<\/p>\n<p>\u8de8\u5c42\u8c03\u7528&#xff1a;\u4e0a\u5c42\u4ee3\u7801\u8df3\u8fc7\u7ea6\u5b9a\u7684\u4e2d\u95f4\u5c42&#xff0c;\u76f4\u63a5\u4f7f\u7528\u66f4\u5e95\u5c42\u7684\u5b9e\u73b0\u7ec6\u8282\u3002\u65e5\u5e38\u7c7b\u6bd4&#xff1a;\u4f60\u53bb\u9910\u5385\u5403\u996d&#xff0c;\u6b63\u5e38\u6d41\u7a0b\u662f\u8ddf\u670d\u52a1\u5458\u70b9\u5355&#xff1b;\u8de8\u5c42\u8c03\u7528\u76f8\u5f53\u4e8e\u4f60\u76f4\u63a5\u8d70\u8fdb\u53a8\u623f&#xff0c;\u4ece\u51b0\u7bb1\u91cc\u62ff\u98df\u6750\u3002\u591a\u6570\u65f6\u5019\u4e5f\u80fd\u5403\u4e0a\u996d&#xff0c;\u53ea\u662f\u540e\u53a8\u7684\u89c4\u77e9\u3001\u5e93\u5b58\u8bb0\u5f55\u3001\u536b\u751f\u6d41\u7a0b\u5168\u90e8\u88ab\u8df3\u8fc7\u4e86\u3002<\/p>\n<p>\u4f9d\u8d56\u65b9\u5411&#xff1a;\u8c01\u53ef\u4ee5\u5f15\u7528\u8c01\u3002\u4e00\u4e2a\u5e38\u89c1\u7684\u7ea6\u5b9a\u662f\u201c\u5916\u5c42\u53ef\u4ee5\u4f9d\u8d56\u5185\u5c42&#xff0c;\u5185\u5c42\u4e0d\u80fd\u4f9d\u8d56\u5916\u5c42\u201d&#xff1a;\u63a5\u53e3\u5c42\u53ef\u4ee5\u8c03\u7528\u7528\u4f8b\u5c42&#xff0c;\u7528\u4f8b\u5c42\u53ef\u4ee5\u8c03\u7528\u9886\u57df\u5bf9\u8c61&#xff0c;\u4f46\u9886\u57df\u5bf9\u8c61\u4e0d\u5e94\u8be5\u53cd\u8fc7\u6765\u77e5\u9053\u6570\u636e\u5e93\u3001HTTP \u6216\u8005\u6d88\u606f\u961f\u5217\u7684\u5b58\u5728\u3002\u8fd9\u6761\u7ea6\u5b9a\u53ef\u4ee5\u7528\u4e00\u53e5\u8bdd\u5199\u51fa\u6765&#xff0c;\u4e5f\u53ef\u4ee5\u7528\u4e00\u6761\u68c0\u67e5\u6765\u9a8c\u8bc1\u3002<\/p>\n<p>\u9759\u6001\u68c0\u67e5&#xff1a;\u4e0d\u8fd0\u884c\u7a0b\u5e8f&#xff0c;\u53ea\u8bfb\u4ee3\u7801\u7ed3\u6784\u5c31\u80fd\u505a\u7684\u68c0\u67e5\u3002\u6700\u5178\u578b\u7684\u662f\u770b\u5bfc\u5165\u8bed\u53e5&#xff1a;\u54ea\u4e2a\u6587\u4ef6\u5bfc\u5165\u4e86\u54ea\u4e2a\u6a21\u5757\u3002\u56e0\u4e3a\u5b83\u4e0d\u9700\u8981\u6570\u636e\u5e93\u3001\u4e0d\u9700\u8981\u7f51\u7edc&#xff0c;\u6240\u4ee5\u53c8\u5feb\u53c8\u7a33&#xff0c;\u9002\u5408\u5f53\u95e8\u7981\u3002<\/p>\n<p>\u67b6\u6784\u6d4b\u8bd5&#xff1a;\u7528\u6d4b\u8bd5\u7684\u5f62\u5f0f\u6765\u68c0\u67e5\u7ed3\u6784\u7ea6\u5b9a&#xff0c;\u6bd4\u5982\u201csrc\/orders\/domain \u4e0b\u7684\u6587\u4ef6\u4e0d\u5141\u8bb8\u5bfc\u5165\u6570\u636e\u5e93\u9a71\u52a8\u201d\u3002\u5b83\u548c\u529f\u80fd\u6d4b\u8bd5\u7528\u540c\u4e00\u5957\u8fd0\u884c\u65b9\u5f0f&#xff0c;\u53ea\u662f\u65ad\u8a00\u7684\u5bf9\u8c61\u4e0d\u662f\u4e1a\u52a1\u884c\u4e3a&#xff0c;\u800c\u662f\u4ee3\u7801\u7684\u5f62\u6001\u3002<\/p>\n<p>\u4f8b\u5916\u673a\u5236&#xff1a;\u5141\u8bb8\u51fa\u73b0\u7684\u7834\u4f8b&#xff0c;\u4f46\u5fc5\u987b\u5199\u6e05\u4f4d\u7f6e\u548c\u7406\u7531&#xff0c;\u6bd4\u5982\u201c\u53ea\u6709 src\/orders\/repositories\/postgres.py \u5141\u8bb8\u5bfc\u5165\u9a71\u52a8\u201d\u3002\u4f8b\u5916\u673a\u5236\u7684\u4ef7\u503c\u662f\u8ba9\u89c4\u5219\u4fdd\u6301\u53ef\u6267\u884c&#xff0c;\u540c\u65f6\u4e0d\u903c\u7740\u4eba\u7ed5\u5f00\u68c0\u67e5\u3002<\/p>\n<p>\u89c4\u5219\u8150\u5316&#xff1a;\u89c4\u5219\u8fd8\u5728\u6587\u6863\u91cc&#xff0c;\u4f46\u5df2\u7ecf\u548c\u4ee3\u7801\u73b0\u5b9e\u4e0d\u4e00\u81f4\u3002\u5e38\u89c1\u7684\u53d1\u751f\u65b9\u5f0f\u662f\u6709\u4eba\u4e3a\u4e86\u901a\u8fc7\u68c0\u67e5\u4fee\u6539\u4e86\u767d\u540d\u5355\u6216\u6ce8\u91ca&#xff0c;\u5374\u6ca1\u6709\u66f4\u65b0\u89c4\u5219\u672c\u8eab\u3002\u8150\u5316\u4e4b\u540e&#xff0c;\u89c4\u5219\u4e0d\u518d\u662f\u7ea6\u675f&#xff0c;\u53ea\u662f\u5386\u53f2\u9057\u8ff9\u3002<\/p>\n<h3>\u4e09\u3001\u4e3a\u4ec0\u4e48\u201c\u5199\u4e0b\u6765\u201d\u53ea\u80fd\u63d0\u9ad8\u6982\u7387<\/h3>\n<p>\u5148\u628a\u4e24\u4e2a\u6982\u5ff5\u5206\u5f00&#xff1a;\u77e5\u9053\u548c\u53d1\u751f\u3002\u8f6f\u7ea6\u675f\u5f71\u54cd\u7684\u662f\u201c\u77e5\u9053\u201d\u8fd9\u4e00\u4fa7&#xff0c;\u5b83\u8ba9\u6b63\u786e\u7684\u505a\u6cd5\u66f4\u5bb9\u6613\u88ab\u60f3\u5230\u3002\u53ef\u89c4\u5219\u80fd\u4e0d\u80fd\u88ab\u9075\u5b88&#xff0c;\u8fd8\u53d6\u51b3\u4e8e\u53e6\u5916\u4e24\u4e2a\u53d8\u91cf&#xff1a;\u773c\u4e0b\u6709\u6ca1\u6709\u66f4\u7701\u4e8b\u7684\u505a\u6cd5&#xff0c;\u4ee5\u53ca\u8fdd\u89c4\u7684\u540e\u679c\u662f\u4ec0\u4e48\u3002<\/p>\n<p>\u5728\u5f00\u5934\u90a3\u4e2a\u4f8b\u5b50\u91cc&#xff0c;\u4e24\u4e2a\u53d8\u91cf\u90fd\u5bf9\u89c4\u5219\u4e0d\u5229\u3002\u66f4\u7701\u4e8b\u7684\u505a\u6cd5\u5c31\u5728\u624b\u8fb9&#xff1a;\u5bfc\u5165\u4f1a\u8bdd\u5de5\u5382&#xff0c;\u4e09\u884c\u4ee3\u7801\u89e3\u51b3\u95ee\u9898\u3002\u8fdd\u89c4\u7684\u540e\u679c\u662f\u96f6&#xff1a;\u6ca1\u6709\u4eba\u62e6&#xff0c;\u6ca1\u6709\u68c0\u67e5\u7ea2&#xff0c;\u8bc4\u5ba1\u65f6\u8fd9\u6bb5\u4ee3\u7801\u770b\u8d77\u6765\u8fd8\u633a\u5408\u7406\u3002<\/p>\n<p>\u518d\u5f80\u6df1\u4e00\u5c42\u770b&#xff0c;\u8fd8\u6709\u4e00\u4e2a\u7ed3\u6784\u6027\u95ee\u9898&#xff1a;\u5f53\u552f\u4e00\u201c\u6267\u884c\u89c4\u5219\u201d\u7684\u4eba\u662f\u6a21\u578b\u81ea\u5df1\u65f6&#xff0c;\u89c4\u5219\u7684\u89e3\u91ca\u8005\u548c\u6267\u884c\u8005\u662f\u540c\u4e00\u65b9\u3002\u5b83\u9700\u8981\u4e00\u8fb9\u5b8c\u6210\u4efb\u52a1&#xff0c;\u4e00\u8fb9\u8bb0\u5f97\u4e0d\u53bb\u505a\u90a3\u4ef6\u65b9\u4fbf\u7684\u4e8b&#xff0c;\u8fd8\u8981\u5728\u4e24\u8005\u51b2\u7a81\u65f6\u9009\u62e9\u9ebb\u70e6\u7684\u90a3\u6761\u8def\u3002\u8fd9\u4e0d\u662f\u6a21\u578b\u7684\u9053\u5fb7\u95ee\u9898&#xff0c;\u800c\u662f\u4efb\u4f55\u6267\u884c\u8005\u90fd\u4f1a\u9762\u4e34\u7684\u53d6\u820d\u3002\u4eba\u7c7b\u5de5\u7a0b\u5e08\u5728\u6ca1\u6709\u68c0\u67e5\u7684\u9879\u76ee\u91cc&#xff0c;\u884c\u4e3a\u6a21\u5f0f\u5b8c\u5168\u4e00\u6837\u3002<\/p>\n<p>\u6a21\u578b\u5728\u8fd9\u4e2a\u53d6\u820d\u4e0a\u8fd8\u6709\u4e24\u4e2a\u7279\u70b9\u503c\u5f97\u8bb0\u4f4f\u3002\u7b2c\u4e00&#xff0c;\u5b83\u8bfb\u5230\u89c4\u5219\u7684\u6548\u679c\u53d7\u4e0a\u4e0b\u6587\u5f71\u54cd&#xff0c;\u524d\u9762\u8bb2\u8fc7\u7684\u4f4d\u7f6e\u6548\u5e94\u5728\u8fd9\u91cc\u540c\u6837\u6210\u7acb&#xff1a;\u4fe1\u606f\u5728\u957f\u4e0a\u4e0b\u6587\u4e2d\u7684\u4f4d\u7f6e\u4f1a\u5f71\u54cd\u88ab\u5229\u7528\u7684\u7a0b\u5ea6&#xff08;Liu \u7b49&#xff0c;2024&#xff0c;Lost in the Middle&#xff0c;TACL 12:157\u2013173&#xff09;\u3002\u7b2c\u4e8c&#xff0c;\u6ca1\u6709\u5916\u90e8\u53cd\u9988\u65f6&#xff0c;\u5b83\u5f88\u96be\u901a\u8fc7\u81ea\u6211\u68c0\u67e5\u53d1\u73b0\u81ea\u5df1\u7684\u8d8a\u754c&#xff0c;\u8fd9\u4e00\u70b9\u5728 Huang \u7b49&#xff08;2023&#xff0c;arXiv:2310.01798&#xff09;\u7684\u7ed3\u8bba\u91cc\u8bf4\u5f97\u5f88\u76f4\u63a5&#xff1a;\u7f3a\u5c11\u5916\u90e8\u53cd\u9988&#xff0c;\u81ea\u6211\u4fee\u6b63\u5f88\u96be\u628a\u63a8\u7406\u6539\u5bf9\u3002<\/p>\n<p>\u90a3\u4e48\u662f\u4e0d\u662f\u6240\u6709\u89c4\u5219\u90fd\u80fd\u53d8\u6210\u786c\u7ea6\u675f&#xff1f;\u4e0d\u662f\u3002\u5224\u65ad\u6807\u51c6\u662f&#xff1a;\u8fd9\u6761\u89c4\u5219\u6709\u6ca1\u6709\u4e00\u4e2a\u53ef\u5224\u5b9a\u7684\u4fe1\u53f7\u3002<\/p>\n<p>\u6709\u4e9b\u89c4\u5219\u5929\u7136\u53ef\u5224\u5b9a&#xff1a;\u5bfc\u5165\u8bed\u53e5\u3001\u6587\u4ef6\u8def\u5f84\u3001\u51fd\u6570\u547d\u540d\u524d\u7f00\u3001\u63a5\u53e3\u53c2\u6570\u4e2a\u6570\u3001\u67d0\u4e2a\u76ee\u5f55\u4e0b\u662f\u5426\u5b58\u5728\u67d0\u4e2a\u6587\u4ef6\u3002\u8fd9\u4e9b\u90fd\u80fd\u88ab\u4e00\u6761\u547d\u4ee4\u6216\u4e00\u6bb5\u811a\u672c\u8bfb\u51fa\u6765\u3002<\/p>\n<p>\u6709\u4e9b\u89c4\u5219\u5f88\u96be\u5224\u5b9a&#xff1a;\u547d\u540d\u662f\u5426\u8d34\u5207\u3001\u62bd\u8c61\u662f\u5426\u5408\u7406\u3001\u8fd9\u6bb5\u903b\u8f91\u653e\u5728\u8fd9\u4e00\u5c42\u662f\u5426\u5408\u9002\u3002\u8fd9\u4e9b\u5224\u65ad\u9700\u8981\u7406\u89e3\u4e1a\u52a1\u80cc\u666f&#xff0c;\u7528\u89c4\u5219\u786c\u5199\u51fa\u6765\u4f1a\u4ea7\u751f\u5927\u91cf\u8bef\u62a5&#xff0c;\u6700\u540e\u88ab\u7ed5\u8fc7\u3002<\/p>\n<p>\u6240\u4ee5\u73b0\u5b9e\u7684\u505a\u6cd5\u662f\u5206\u5c42&#xff1a;\u53ef\u5224\u5b9a\u7684\u89c4\u5219\u5c3d\u91cf\u786c\u8d77\u6765&#xff0c;\u4e0d\u53ef\u5224\u5b9a\u7684\u89c4\u5219\u7559\u5728\u8f6f\u7ea6\u675f\u91cc&#xff0c;\u5e76\u4e14\u627f\u8ba4\u5b83\u53ea\u80fd\u63d0\u9ad8\u6982\u7387\u3002\u628a\u4e0d\u53ef\u5224\u5b9a\u7684\u89c4\u5219\u786c\u5199\u6210\u68c0\u67e5&#xff0c;\u662f\u53e6\u4e00\u79cd\u5e38\u89c1\u6d6a\u8d39&#xff0c;\u4e0b\u4e00\u7bc7\u4f1a\u8bb2\u5230\u8fd9\u4e24\u79cd\u63a7\u5236\u65b9\u5411\u7684\u533a\u522b\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u5e38\u88ab\u5ffd\u7565\u7684\u6536\u76ca&#xff1a;\u786c\u7ea6\u675f\u4f1a\u6539\u53d8\u8f6f\u7ea6\u675f\u7684\u5199\u6cd5\u3002\u5f53\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\u6709\u4e00\u6761\u68c0\u67e5\u5728\u8dd1&#xff0c;AGENTS.md \u91cc\u90a3\u6761\u89c4\u5219\u5c31\u53ef\u4ee5\u5199\u5f97\u66f4\u77ed&#xff0c;\u56e0\u4e3a\u5b83\u4e0d\u9700\u8981\u518d\u9760\u7bc7\u5e45\u53bb\u5f3a\u8c03\u3002\u89c4\u5219\u6587\u4ef6\u8d8a\u77ed&#xff0c;\u5269\u4e0b\u7684\u89c4\u5219\u8d8a\u6709\u53ef\u80fd\u88ab\u771f\u6b63\u7528\u4e0a\u3002<\/p>\n<p>\u4e24\u79cd\u7ea6\u675f\u7684\u5dee\u522b\u53ef\u4ee5\u5217\u6210\u4e00\u5f20\u8868&#xff1a;<\/p>\n<table>\n<tr>\u8f6f\u7ea6\u675f\u786c\u7ea6\u675f<\/tr>\n<tbody>\n<tr>\n<td>\u8f7d\u4f53<\/td>\n<td>AGENTS.md\u3001\u4efb\u52a1\u5355\u3001\u6ce8\u91ca\u3001\u53e3\u5934\u7ea6\u5b9a<\/td>\n<td>\u9759\u6001\u68c0\u67e5\u3001\u67b6\u6784\u6d4b\u8bd5\u3001CI \u6b65\u9aa4\u3001\u547d\u4ee4\u89c4\u5219<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6548\u65b9\u5f0f<\/td>\n<td>\u5f71\u54cd\u4eba\u548c\u6a21\u578b\u7684\u5224\u65ad<\/td>\n<td>\u8fdd\u89c4\u65f6\u6d41\u7a0b\u76f4\u63a5\u5931\u8d25<\/td>\n<\/tr>\n<tr>\n<td>\u5224\u5b9a\u8005<\/td>\n<td>\u6267\u884c\u8005\u81ea\u5df1<\/td>\n<td>\u673a\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u5931\u8d25\u6a21\u5f0f<\/td>\n<td>\u65f6\u597d\u65f6\u574f&#xff0c;\u53d6\u51b3\u4e8e\u4e0a\u4e0b\u6587\u4e0e\u5f53\u4e0b\u7684\u53d6\u820d<\/td>\n<td>\u786e\u5b9a\u3001\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr>\n<td>\u4fee\u6539\u6210\u672c<\/td>\n<td>\u6539\u4e00\u884c\u5b57<\/td>\n<td>\u6539\u68c0\u67e5\u6216\u52a0\u4f8b\u5916&#xff0c;\u5e76\u8dd1\u4e00\u904d<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u5408\u627f\u8f7d<\/td>\n<td>\u9700\u8981\u5224\u65ad\u7684\u7ea6\u5b9a<\/td>\n<td>\u6709\u53ef\u5224\u5b9a\u4fe1\u53f7\u7684\u7ea6\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u5f20\u8868\u91cc\u6700\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u4e00\u884c\u662f\u201c\u5224\u5b9a\u8005\u201d\u3002\u8f6f\u7ea6\u675f\u7684\u5224\u5b9a\u8005\u662f\u6267\u884c\u8005\u81ea\u5df1&#xff0c;\u8fd9\u610f\u5473\u7740\u5728\u6267\u884c\u8005\u8ba4\u4e3a\u201c\u8fd9\u6b21\u60c5\u51b5\u7279\u6b8a\u201d\u7684\u65f6\u5019&#xff0c;\u89c4\u5219\u5c31\u4f1a\u81ea\u52a8\u5931\u6548\u3002\u786c\u7ea6\u675f\u6ca1\u6709\u8fd9\u4e2a\u5165\u53e3&#xff0c;\u5b83\u53ea\u8ba4\u4ee3\u7801\u7684\u73b0\u5b9e\u3002<\/p>\n<h4>\u54ea\u4e9b\u89c4\u5219\u503c\u5f97\u4f18\u5148\u786c\u8d77\u6765<\/h4>\n<p>\u4e0d\u662f\u6bcf\u6761\u89c4\u5219\u90fd\u503c\u5f97\u5199\u68c0\u67e5&#xff0c;\u53ef\u4ee5\u7528\u4e09\u4e2a\u7b5b\u5b50\u6765\u6392\u5e8f\u3002<\/p>\n<p>\u7b2c\u4e00\u4e2a\u7b5b\u5b50\u662f\u8fdd\u89c4\u7684\u4ee3\u4ef7\u3002\u8de8\u5c42\u4f9d\u8d56\u7684\u4ee3\u4ef7\u5f88\u9ad8&#xff0c;\u56e0\u4e3a\u5b83\u4f1a\u968f\u7740\u65f6\u95f4\u7d2f\u79ef&#xff1a;\u4e00\u4e2a\u6587\u4ef6\u8d8a\u754c\u4e4b\u540e&#xff0c;\u540e\u9762\u5199\u4ee3\u7801\u7684\u4eba\u4f1a\u8ddf\u7740\u8d8a\u754c&#xff0c;\u7b49\u5230\u60f3\u6362\u5b9e\u73b0\u65f6\u5df2\u7ecf\u62c6\u4e0d\u52a8\u4e86\u3002\u76f8\u6bd4\u4e4b\u4e0b&#xff0c;\u201c\u51fd\u6570\u6700\u597d\u4e0d\u8981\u8d85\u8fc7\u4e94\u5341\u884c\u201d\u88ab\u8fdd\u53cd\u7684\u4ee3\u4ef7\u5f88\u5c0f&#xff0c;\u5b83\u66f4\u50cf\u662f\u98ce\u683c\u504f\u597d\u3002<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u7b5b\u5b50\u662f\u53ef\u5224\u5b9a\u6027\u3002\u5bfc\u5165\u8bed\u53e5\u3001\u6587\u4ef6\u8def\u5f84\u3001\u51fd\u6570\u7b7e\u540d\u3001\u4f9d\u8d56\u6e05\u5355&#xff0c;\u8fd9\u4e9b\u90fd\u80fd\u88ab\u76f4\u63a5\u8bfb\u51fa\u6765&#xff0c;\u5c5e\u4e8e\u5929\u7136\u53ef\u5224\u5b9a\u3002\u547d\u540d\u662f\u5426\u8fbe\u610f\u3001\u62bd\u8c61\u662f\u5426\u5408\u7406\u3001\u8fd9\u6bb5\u903b\u8f91\u8be5\u653e\u54ea\u4e00\u5c42&#xff0c;\u8fd9\u4e9b\u9700\u8981\u4e1a\u52a1\u5224\u65ad&#xff0c;\u786c\u5199\u6210\u68c0\u67e5\u4f1a\u4ea7\u751f\u5927\u91cf\u8bef\u62a5\u3002<\/p>\n<p>\u7b2c\u4e09\u4e2a\u7b5b\u5b50\u662f\u53d1\u751f\u9891\u7387\u3002\u4e00\u4e2a\u6bcf\u5e74\u88ab\u8fdd\u53cd\u4e00\u6b21\u7684\u89c4\u5219&#xff0c;\u7528\u6587\u6863\u63d0\u9192\u5c31\u591f\u4e86&#xff1b;\u4e00\u4e2a\u6bcf\u5468\u90fd\u88ab\u8fdd\u53cd\u4e00\u6b21\u7684\u89c4\u5219&#xff0c;\u503c\u5f97\u4e00\u6761\u68c0\u67e5\u3002\u9891\u7387\u9ad8\u901a\u5e38\u610f\u5473\u7740\u5b58\u5728\u7ed3\u6784\u6027\u8bf1\u56e0&#xff0c;\u6bd4\u5982\u7f3a\u5c11\u4e00\u4e2a\u65b9\u4fbf\u7684\u80fd\u529b\u5165\u53e3&#xff0c;\u8fd9\u65f6\u5019\u66f4\u597d\u7684\u505a\u6cd5\u662f\u5148\u628a\u5165\u53e3\u8865\u4e0a&#xff0c;\u518d\u52a0\u68c0\u67e5\u3002<\/p>\n<p>\u4e09\u4e2a\u7b5b\u5b50\u8fc7\u5b8c&#xff0c;\u901a\u5e38\u4f1a\u5269\u4e0b\u4e24\u4e09\u6761\u89c4\u5219\u3002\u8fd9\u4e24\u4e09\u6761\u5c31\u8db3\u591f\u5f00\u59cb\u4e86\u3002<\/p>\n<h4>\u8f6f\u7ea6\u675f\u4ec0\u4e48\u65f6\u5019\u591f\u7528&#xff0c;\u4ee5\u53ca\u600e\u4e48\u5199\u624d\u4e0d\u6d6a\u8d39<\/h4>\n<p>\u6709\u4e09\u79cd\u60c5\u51b5\u9002\u5408\u7559\u8f6f\u7ea6\u675f&#xff0c;\u4e0d\u5fc5\u6025\u7740\u5199\u68c0\u67e5\u3002<\/p>\n<p>\u7b2c\u4e00\u79cd\u662f\u8fdd\u89c4\u4ee3\u4ef7\u5f88\u5c0f\u3001\u53d1\u751f\u9891\u7387\u4e5f\u4f4e\u7684\u89c4\u5219&#xff0c;\u6bd4\u5982\u65e5\u5fd7\u6587\u6848\u7684\u5199\u6cd5\u3001\u9519\u8bef\u4fe1\u606f\u91cc\u8981\u4e0d\u8981\u5e26\u7f16\u53f7\u3002\u8fd9\u7c7b\u89c4\u5219\u7528\u4e00\u53e5\u7ea6\u5b9a\u5c31\u591f\u4e86&#xff0c;\u5199\u68c0\u67e5\u7684\u65f6\u95f4\u6bd4\u5b83\u7701\u4e0b\u6765\u7684\u65f6\u95f4\u8fd8\u591a\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd\u662f\u9700\u8981\u4e1a\u52a1\u5224\u65ad\u7684\u89c4\u5219&#xff0c;\u6bd4\u5982\u201c\u8fd9\u6bb5\u903b\u8f91\u653e\u5728\u7528\u4f8b\u5c42\u8fd8\u662f\u9886\u57df\u5c42\u201d\u3002\u5b83\u53ef\u4ee5\u88ab\u5199\u6210\u68c0\u67e5&#xff0c;\u4f46\u90a3\u4f1a\u662f\u4e00\u5806\u8106\u5f31\u7684\u6a21\u5f0f\u5339\u914d\u3002\u66f4\u5b9e\u7528\u7684\u505a\u6cd5\u662f\u628a\u5b83\u5199\u6210\u4e00\u6761\u5e26\u89e6\u53d1\u6761\u4ef6\u7684\u7ea6\u5b9a&#xff1a;\u5f53\u4f60\u53d1\u73b0\u540c\u4e00\u4e2a\u89c4\u5219\u5224\u65ad\u51fa\u73b0\u5728\u4e24\u4e2a\u4ee5\u4e0a\u7684\u7528\u4f8b\u91cc&#xff0c;\u5c31\u628a\u5b83\u632a\u8fdb\u9886\u57df\u5bf9\u8c61\u3002<\/p>\n<p>\u7b2c\u4e09\u79cd\u662f\u8fd8\u5728\u63a2\u7d22\u671f\u7684\u89c4\u5219\u3002\u65b0\u7ea6\u5b9a\u521a\u63d0\u51fa\u65f6&#xff0c;\u5148\u5199\u6210\u8f6f\u7ea6\u675f\u89c2\u5bdf\u4e24\u4e09\u5468&#xff0c;\u770b\u770b\u5b83\u662f\u4e0d\u662f\u771f\u7684\u88ab\u8fdd\u53cd\u3001\u8fdd\u53cd\u4e86\u662f\u4e0d\u662f\u771f\u7684\u5bfc\u81f4\u95ee\u9898&#xff0c;\u7136\u540e\u518d\u51b3\u5b9a\u8981\u4e0d\u8981\u5347\u7ea7\u6210\u68c0\u67e5\u3002\u8fd9\u4e2a\u987a\u5e8f\u6bd4\u5148\u5199\u68c0\u67e5\u518d\u53d1\u73b0\u89c4\u5219\u4e0d\u5bf9\u8981\u4fbf\u5b9c\u3002<\/p>\n<p>\u8f6f\u7ea6\u675f\u672c\u8eab\u4e5f\u53ef\u4ee5\u5199\u5f97\u66f4\u6709\u7528\u3002\u6709\u6548\u7684\u5199\u6cd5\u5305\u542b\u4e09\u4e2a\u90e8\u5206&#xff1a;\u89e6\u53d1\u6761\u4ef6\u3001\u5177\u4f53\u52a8\u4f5c\u3001\u9a8c\u8bc1\u65b9\u5f0f\u3002\u6bd4\u5982\u201c\u5f53\u4f60\u9700\u8981\u5728\u4e24\u4e2a\u8868\u4e4b\u95f4\u505a\u8054\u5408\u67e5\u8be2\u65f6&#xff0c;\u5148\u68c0\u67e5 repositories \u5c42\u662f\u5426\u5df2\u6709\u5bf9\u5e94\u7684\u67e5\u8be2\u65b9\u6cd5&#xff1b;\u6ca1\u6709\u5c31\u65b0\u589e\u4e00\u4e2a&#xff0c;\u4e0d\u8981\u5728\u7528\u4f8b\u5c42\u76f4\u63a5\u5199 SQL\u201d\u3002\u8fd9\u4e09\u53e5\u8bdd\u91cc\u6ca1\u6709\u5f62\u5bb9\u8bcd&#xff0c;\u8bfb\u7684\u4eba\u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u9002\u7528\u3001\u8be5\u505a\u4ec0\u4e48\u3001\u505a\u5b8c\u600e\u4e48\u786e\u8ba4\u3002<\/p>\n<p>\u5bf9\u7167\u4e00\u4e0b\u5e38\u89c1\u7684\u5199\u6cd5&#xff1a;\u201c\u6ce8\u610f\u4fdd\u6301\u6570\u636e\u8bbf\u95ee\u7684\u4e00\u81f4\u6027\u201d\u3002\u5b83\u542c\u8d77\u6765\u4e5f\u662f\u5584\u610f\u63d0\u9192&#xff0c;\u4f46\u5b83\u6ca1\u6709\u89e6\u53d1\u6761\u4ef6&#xff0c;\u4e5f\u6ca1\u6709\u52a8\u4f5c&#xff0c;\u8bfb\u5230\u7684\u4eba\u53ea\u80fd\u628a\u5b83\u5f53\u6210\u80cc\u666f\u566a\u97f3\u3002<\/p>\n<h3>\u56db\u3001\u628a\u4e00\u6761\u6587\u5b57\u89c4\u5219\u53d8\u6210\u95e8\u7981<\/h3>\n<p>\u4e0b\u9762\u8fd9\u4e2a shop \u9879\u76ee\u662f\u865a\u6784\u793a\u4f8b&#xff0c;\u4ee3\u7801\u53ef\u4ee5\u76f4\u63a5\u7167\u7740\u642d\u4e00\u904d\u3002\u76ee\u6807\u5f88\u6e05\u695a&#xff1a;\u628a\u201c\u4e0d\u5141\u8bb8\u8de8\u5c42\u8c03\u7528\u201d\u4ece\u4e00\u53e5\u8bdd\u53d8\u6210\u4e00\u6761\u4f1a\u5931\u8d25\u7684\u68c0\u67e5\u3002<\/p>\n<h4>4.1 \u8fdd\u89c4\u73b0\u573a<\/h4>\n<p>\u5148\u770b\u90a3\u6b21\u8fdd\u89c4\u7684\u6539\u52a8\u957f\u4ec0\u4e48\u6837&#xff1a;<\/p>\n<p>&#8212; a\/src\/orders\/services\/cancel_order.py<br \/>\n&#043;&#043;&#043; b\/src\/orders\/services\/cancel_order.py<br \/>\n&#064;&#064;<br \/>\n&#043;from orders.repositories.postgres import session_factory<br \/>\n&#043;<br \/>\n&#043;<br \/>\n async def cancel_order(*, order_id: str, repo, audit) -&gt; None:<br \/>\n&#8211;    await repo.save(order)<br \/>\n&#8211;    await audit.record(&#034;order.cancelled&#034;, order_id&#061;order.id)<br \/>\n&#043;    async with session_factory() as session:<br \/>\n&#043;        async with session.begin():<br \/>\n&#043;            await repo.save(order, session&#061;session)<br \/>\n&#043;            await audit.record(&#034;order.cancelled&#034;, order_id&#061;order.id, session&#061;session)<\/p>\n<p>\u6539\u52a8\u53ea\u6709\u51e0\u884c&#xff0c;\u610f\u56fe\u4e5f\u5f88\u6b63\u5f53&#xff1a;\u8ba9\u72b6\u6001\u53d8\u66f4\u548c\u5ba1\u8ba1\u4e8b\u4ef6\u843d\u5728\u540c\u4e00\u4e2a\u4e8b\u52a1\u91cc\u3002\u95ee\u9898\u662f\u5b83\u6362\u6765\u4e86\u4e24\u4e2a\u540e\u679c\u3002\u7b2c\u4e00&#xff0c;\u7528\u4f8b\u5c42\u73b0\u5728\u77e5\u9053\u4e86\u6570\u636e\u5e93\u5b9e\u73b0\u7684\u5b58\u5728&#xff0c;\u5c06\u6765\u6362\u5b58\u50a8\u5c31\u5f97\u6539\u7528\u4f8b\u5c42\u3002\u7b2c\u4e8c&#xff0c;\u6d4b\u8bd5\u73af\u5883\u91cc\u7528\u7684\u5047\u5b9e\u73b0\u6ca1\u6709 session \u53c2\u6570&#xff0c;\u6240\u4ee5\u8fd9\u6761\u8def\u5f84\u5728\u5355\u5143\u6d4b\u8bd5\u91cc\u8d70\u4e0d\u5230\u3002<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u540e\u679c\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u5355\u5143\u6d4b\u8bd5\u5168\u7eff\u3002\u5355\u5143\u6d4b\u8bd5\u6ce8\u5165\u7684\u662f\u5185\u5b58\u7248\u7684\u4ed3\u5e93\u548c\u5ba1\u8ba1\u8bb0\u5f55\u5668&#xff0c;\u5b83\u4eec\u4e0d\u9700\u8981\u4e8b\u52a1&#xff0c;\u4e5f\u4e0d\u4f1a\u56e0\u4e3a\u591a\u4e86\u4e00\u4e2a\u53c2\u6570\u800c\u5931\u8d25\u3002\u771f\u6b63\u7684\u95ee\u9898\u53ea\u5728\u96c6\u6210\u73af\u5883\u91cc\u66b4\u9732&#xff1a;\u90a3\u91cc\u7528\u7684\u662f\u771f\u5b9e\u5b9e\u73b0&#xff0c;\u800c\u771f\u5b9e\u5b9e\u73b0\u7684\u4f1a\u8bdd\u5de5\u5382\u6765\u81ea\u4e00\u4e2a\u88ab\u66ff\u6362\u6389\u7684\u6a21\u5757\u3002<\/p>\n<h4>4.2 \u627e\u5230\u53ef\u5224\u5b9a\u7684\u4fe1\u53f7<\/h4>\n<p>\u8981\u628a\u8fd9\u6761\u89c4\u5219\u786c\u8d77\u6765&#xff0c;\u7b2c\u4e00\u6b65\u662f\u627e\u5230\u4e00\u4e2a\u673a\u5668\u80fd\u8bfb\u7684\u4fe1\u53f7\u3002\u8fd9\u91cc\u6700\u5408\u9002\u7684\u4fe1\u53f7\u5c31\u662f\u5bfc\u5165\u8bed\u53e5&#xff1a;\u54ea\u4e2a\u6587\u4ef6\u5bfc\u5165\u4e86\u54ea\u4e2a\u6a21\u5757\u3002<\/p>\n<p>\u89c4\u5219\u7684\u8868\u8ff0\u4e5f\u53ef\u4ee5\u540c\u6b65\u7cbe\u786e\u4e00\u70b9&#xff0c;\u4ece\u201c\u4e0d\u8981\u8de8\u5c42\u8c03\u7528\u201d\u53d8\u6210&#xff1a;<\/p>\n<p>\u89c4\u5219&#xff1a;src\/orders\/domain \u4e0e src\/orders\/services \u4e0b\u7684\u6587\u4ef6<br \/>\n      \u4e0d\u5f97\u5bfc\u5165 orders.repositories \u4e0b\u7684\u4efb\u4f55\u6a21\u5757<\/p>\n<p>\u8fd9\u53e5\u8bdd\u6709\u4e24\u4e2a\u7ec4\u6210\u90e8\u5206&#xff1a;\u4f5c\u7528\u8303\u56f4&#xff08;\u54ea\u4e24\u4e2a\u76ee\u5f55&#xff09;\u548c\u7981\u6b62\u5bf9\u8c61&#xff08;\u54ea\u4e00\u7c7b\u6a21\u5757&#xff09;\u3002\u4e24\u90e8\u5206\u90fd\u5199\u5177\u4f53&#xff0c;\u68c0\u67e5\u624d\u53ef\u80fd\u51c6\u786e\u3002\u50cf\u201c\u4e0d\u8981\u8de8\u5c42\u8c03\u7528\u201d\u8fd9\u6837\u7684\u8868\u8ff0&#xff0c;\u8303\u56f4\u5230\u5e95\u662f\u54ea\u4e9b\u76ee\u5f55\u3001\u4ec0\u4e48\u7b97\u8de8\u5c42&#xff0c;\u90fd\u9700\u8981\u8bfb\u8005\u81ea\u5df1\u8865\u5168\u3002<\/p>\n<h4>4.3 \u7b2c\u4e00\u7248&#xff1a;\u4e00\u6761\u6b63\u5219\u547d\u4ee4<\/h4>\n<p>\u6700\u5feb\u7684\u786c\u7ea6\u675f\u662f\u628a\u5b83\u5199\u6210\u4e00\u6761\u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token keyword\">if<\/span> rg <span class=\"token parameter variable\">-n<\/span> <span class=\"token string\">&#034;from orders\\\\.repositories&#034;<\/span> src\/orders\/services src\/orders\/domain<span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n  <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;services\/domain \u7981\u6b62\u76f4\u63a5\u4f9d\u8d56 repositories \u5b9e\u73b0&#xff1b;\u8bf7\u901a\u8fc7\u4f20\u5165\u7684 repo \u63a5\u53e3\u8bbf\u95ee&#034;<\/span><br \/>\n  <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u8dd1\u8d77\u6765\u5f88\u5feb&#xff0c;\u4e5f\u80fd\u62e6\u4f4f\u6700\u5e38\u89c1\u7684\u4e00\u79cd\u5199\u6cd5\u3002\u4f46\u5b83\u7684\u8986\u76d6\u9762\u6709\u9650&#xff0c;\u4e0b\u9762\u8fd9\u4e9b\u5199\u6cd5\u5b83\u6293\u4e0d\u5230&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> orders<span class=\"token punctuation\">.<\/span>repositories<span class=\"token punctuation\">.<\/span>postgres              <span class=\"token comment\"># \u76f4\u63a5 import \u6a21\u5757<\/span><br \/>\n<span class=\"token keyword\">from<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span>repositories <span class=\"token keyword\">import<\/span> postgres              <span class=\"token comment\"># \u76f8\u5bf9\u5bfc\u5165<\/span><br \/>\n<span class=\"token keyword\">from<\/span> orders<span class=\"token punctuation\">.<\/span>repositories <span class=\"token keyword\">import<\/span> postgres <span class=\"token keyword\">as<\/span> pg   <span class=\"token comment\"># \u5e26\u522b\u540d<\/span><br \/>\nmod <span class=\"token operator\">&#061;<\/span> importlib<span class=\"token punctuation\">.<\/span>import_module<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;orders.repositories.postgres&#034;<\/span><span class=\"token punctuation\">)<\/span>   <span class=\"token comment\"># \u5b57\u7b26\u4e32\u5bfc\u5165<\/span><\/p>\n<p>\u89c4\u5219\u6587\u5b57\u91cc\u5199\u7684\u662f\u201c\u4e0d\u5f97\u5bfc\u5165\u201d&#xff0c;\u800c\u547d\u4ee4\u53ea\u8ba4\u4e00\u79cd\u5b57\u7b26\u4e32\u5f62\u6001&#xff0c;\u8fd9\u4e2a\u7f3a\u53e3\u8fdf\u65e9\u4f1a\u88ab\u586b\u4e0a\u3002\u66f4\u7a33\u7684\u505a\u6cd5\u662f\u76f4\u63a5\u5206\u6790\u8bed\u6cd5\u7ed3\u6784&#xff0c;\u800c\u4e0d\u662f\u5339\u914d\u6587\u672c\u3002<\/p>\n<h4>4.4 \u7b2c\u4e8c\u7248&#xff1a;\u4e00\u6761\u67b6\u6784\u6d4b\u8bd5<\/h4>\n<p>Python \u81ea\u5e26\u628a\u6e90\u7801\u89e3\u6790\u6210\u8bed\u6cd5\u6811\u7684\u5de5\u5177&#xff0c;\u4e0d\u9700\u8981\u8fd0\u884c\u4ee3\u7801\u5c31\u80fd\u8bfb\u51fa\u6240\u6709\u5bfc\u5165\u3002\u4e0b\u9762\u8fd9\u6761\u6d4b\u8bd5\u653e\u5728 tests\/architecture\/ \u4e0b&#xff0c;\u548c\u529f\u80fd\u6d4b\u8bd5\u4e00\u8d77\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token comment\"># tests\/architecture\/test_layer_dependencies.py<\/span><br \/>\n<span class=\"token keyword\">import<\/span> ast<br \/>\n<span class=\"token keyword\">from<\/span> pathlib <span class=\"token keyword\">import<\/span> Path<\/p>\n<p>SRC_ROOT <span class=\"token operator\">&#061;<\/span> Path<span class=\"token punctuation\">(<\/span>__file__<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>resolve<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>parents<span class=\"token punctuation\">[<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">\/<\/span> <span class=\"token string\">&#034;src&#034;<\/span><br \/>\nFORBIDDEN_PREFIX <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;orders.repositories&#034;<\/span><br \/>\nCHECKED_LAYERS <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;domain&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;services&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">imported_modules<\/span><span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">set<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u8bfb\u51fa\u8fd9\u4e2a\u6587\u4ef6\u91cc\u51fa\u73b0\u7684\u6240\u6709\u5bfc\u5165\u6a21\u5757\u540d&#xff08;\u53ea\u770b\u8bed\u6cd5&#xff0c;\u4e0d\u6267\u884c\u4ee3\u7801&#xff09;\u3002&#034;&#034;&#034;<\/span><br \/>\n    tree <span class=\"token operator\">&#061;<\/span> ast<span class=\"token punctuation\">.<\/span>parse<span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">.<\/span>read_text<span class=\"token punctuation\">(<\/span>encoding<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> filename<span class=\"token operator\">&#061;<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    modules<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">set<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">set<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> node <span class=\"token keyword\">in<\/span> ast<span class=\"token punctuation\">.<\/span>walk<span class=\"token punctuation\">(<\/span>tree<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token builtin\">isinstance<\/span><span class=\"token punctuation\">(<\/span>node<span class=\"token punctuation\">,<\/span> ast<span class=\"token punctuation\">.<\/span>Import<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            modules<span class=\"token punctuation\">.<\/span>update<span class=\"token punctuation\">(<\/span>alias<span class=\"token punctuation\">.<\/span>name <span class=\"token keyword\">for<\/span> alias <span class=\"token keyword\">in<\/span> node<span class=\"token punctuation\">.<\/span>names<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">elif<\/span> <span class=\"token builtin\">isinstance<\/span><span class=\"token punctuation\">(<\/span>node<span class=\"token punctuation\">,<\/span> ast<span class=\"token punctuation\">.<\/span>ImportFrom<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">if<\/span> node<span class=\"token punctuation\">.<\/span>level<span class=\"token punctuation\">:<\/span>                      <span class=\"token comment\"># \u76f8\u5bf9\u5bfc\u5165&#xff0c;\u5148\u8fd8\u539f\u6210\u7edd\u5bf9\u540d\u5b57<\/span><br \/>\n                package <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">list<\/span><span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">.<\/span>relative_to<span class=\"token punctuation\">(<\/span>SRC_ROOT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>with_suffix<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>parts<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">:<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                keep <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>package<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> <span class=\"token punctuation\">(<\/span>node<span class=\"token punctuation\">.<\/span>level <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                prefix <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;.&#034;<\/span><span class=\"token punctuation\">.<\/span>join<span class=\"token punctuation\">(<\/span>package<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">:<\/span>keep<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                modules<span class=\"token punctuation\">.<\/span>add<span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>prefix<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">.<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>node<span class=\"token punctuation\">.<\/span>module<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span> <span class=\"token keyword\">if<\/span> node<span class=\"token punctuation\">.<\/span>module <span class=\"token keyword\">else<\/span> prefix<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">elif<\/span> node<span class=\"token punctuation\">.<\/span>module<span class=\"token punctuation\">:<\/span><br \/>\n                modules<span class=\"token punctuation\">.<\/span>add<span class=\"token punctuation\">(<\/span>node<span class=\"token punctuation\">.<\/span>module<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> modules<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">test_domain_and_services_do_not_import_repositories<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    offenders<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">list<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> layer <span class=\"token keyword\">in<\/span> CHECKED_LAYERS<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> path <span class=\"token keyword\">in<\/span> <span class=\"token punctuation\">(<\/span>SRC_ROOT <span class=\"token operator\">\/<\/span> <span class=\"token string\">&#034;orders&#034;<\/span> <span class=\"token operator\">\/<\/span> layer<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>rglob<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;*.py&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            bad <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span><br \/>\n                m <span class=\"token keyword\">for<\/span> m <span class=\"token keyword\">in<\/span> imported_modules<span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token keyword\">if<\/span> m <span class=\"token operator\">&#061;&#061;<\/span> FORBIDDEN_PREFIX <span class=\"token keyword\">or<\/span> m<span class=\"token punctuation\">.<\/span>startswith<span class=\"token punctuation\">(<\/span>FORBIDDEN_PREFIX <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;.&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">if<\/span> bad<span class=\"token punctuation\">:<\/span><br \/>\n                offenders<span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">.<\/span>relative_to<span class=\"token punctuation\">(<\/span>SRC_ROOT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> bad<\/p>\n<p>    <span class=\"token keyword\">assert<\/span> <span class=\"token keyword\">not<\/span> offenders<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><br \/>\n        <span class=\"token string\">&#034;domain \u5c42\u548c services \u5c42\u4e0d\u5141\u8bb8\u76f4\u63a5\u4f9d\u8d56 repositories \u5b9e\u73b0&#xff0c;&#034;<\/span><br \/>\n        <span class=\"token string\">&#034;\u8bf7\u901a\u8fc7\u6ce8\u5165\u7684\u4ed3\u5e93\u63a5\u53e3\u8bbf\u95ee\u6570\u636e&#xff1a;&#034;<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token builtin\">repr<\/span><span class=\"token punctuation\">(<\/span>offenders<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u91cc\u6709\u4e09\u5904\u503c\u5f97\u89e3\u91ca\u3002\u7b2c\u4e00&#xff0c;ast.parse \u53ea\u8bfb\u8bed\u6cd5\u7ed3\u6784&#xff0c;\u4e0d\u6267\u884c\u6587\u4ef6&#xff0c;\u6240\u4ee5\u5b83\u4e0d\u9700\u8981\u6570\u636e\u5e93\u3001\u4e0d\u9700\u8981\u7f51\u7edc&#xff0c;\u4e5f\u4e0d\u4f1a\u88ab\u8fd0\u884c\u65f6\u95ee\u9898\u5e72\u6270\u3002\u7b2c\u4e8c&#xff0c;\u76f8\u5bf9\u5bfc\u5165\u9700\u8981\u8fd8\u539f&#xff1a;from ..repositories import postgres \u5149\u770b\u5b57\u9762\u662f\u770b\u4e0d\u51fa\u5c42\u7ea7\u7684&#xff0c;\u4ee3\u7801\u91cc\u7528\u5f53\u524d\u6587\u4ef6\u6240\u5728\u5305\u7684\u4f4d\u7f6e\u8fd8\u539f\u51fa\u7edd\u5bf9\u540d\u5b57\u3002\u7b2c\u4e09&#xff0c;\u65ad\u8a00\u5931\u8d25\u65f6\u8f93\u51fa\u4e86\u8fdd\u89c4\u6587\u4ef6\u8def\u5f84\u548c\u5177\u4f53\u7684\u6a21\u5757\u540d&#xff0c;\u8fd9\u5c31\u662f\u4e0b\u4e00\u8f6e\u4fee\u590d\u9700\u8981\u7684\u8f93\u5165\u3002<\/p>\n<p>\u5148\u5728\u6709\u8fdd\u89c4\u7684\u4ee3\u7801\u4e0a\u8dd1\u4e00\u6b21&#xff0c;\u786e\u8ba4\u5b83\u4f1a\u7ea2&#xff1a;<\/p>\n<p>pytest <span class=\"token parameter variable\">-q<\/span> tests\/architecture\/test_layer_dependencies.py<\/p>\n<p>FAILED tests\/architecture\/test_layer_dependencies.py::test_domain_and_services_do_not_import_repositories<br \/>\nAssertionError: domain \u5c42\u548c services \u5c42\u4e0d\u5141\u8bb8\u76f4\u63a5\u4f9d\u8d56 repositories \u5b9e\u73b0&#xff0c;\u8bf7\u901a\u8fc7\u6ce8\u5165\u7684\u4ed3\u5e93\u63a5\u53e3\u8bbf\u95ee\u6570\u636e&#xff1a;{&#039;orders\/services\/cancel_order.py&#039;: [&#039;orders.repositories.postgres&#039;]}<br \/>\n1 failed in 0.21s<\/p>\n<p>\u8fd9\u6761\u5931\u8d25\u4fe1\u606f\u7ed9\u4e86\u4e09\u6837\u4e1c\u897f&#xff1a;\u54ea\u6761\u89c4\u5219\u88ab\u8fdd\u53cd\u3001\u54ea\u4e2a\u6587\u4ef6\u8fdd\u53cd\u3001\u8fdd\u53cd\u4e86\u54ea\u4e00\u884c\u5bfc\u5165\u3002\u4fee\u7684\u4eba\u4e0d\u9700\u8981\u731c\u3002<\/p>\n<h4>4.5 \u4fee\u6cd5&#xff1a;\u8ba9\u4e8b\u52a1\u4ece\u63a5\u53e3\u8fdb\u6765<\/h4>\n<p>\u8fdd\u89c4\u7684\u52a8\u673a\u662f\u60f3\u8981\u4e00\u4e2a\u4e8b\u52a1&#xff0c;\u90a3\u4e48\u6b63\u786e\u7684\u89e3\u6cd5\u5c31\u662f\u628a\u4e8b\u52a1\u653e\u8fdb\u63a5\u53e3\u91cc&#xff0c;\u800c\u4e0d\u662f\u8ba9\u7528\u4f8b\u5c42\u81ea\u5df1\u53bb\u627e\u4f1a\u8bdd&#xff1a;<\/p>\n<p><span class=\"token comment\"># src\/orders\/services\/cancel_order.py&#xff08;\u4fee\u597d\u7684\u4e00\u7248&#xff09;<\/span><br \/>\n<span class=\"token keyword\">from<\/span> orders<span class=\"token punctuation\">.<\/span>domain<span class=\"token punctuation\">.<\/span>errors <span class=\"token keyword\">import<\/span> CancelNotAllowed<span class=\"token punctuation\">,<\/span> OrderNotFound<br \/>\n<span class=\"token keyword\">from<\/span> orders<span class=\"token punctuation\">.<\/span>domain<span class=\"token punctuation\">.<\/span>order <span class=\"token keyword\">import<\/span> OrderStatus<\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">def<\/span> <span class=\"token function\">cancel_order<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> order_id<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> repo<span class=\"token punctuation\">,<\/span> audit<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token boolean\">None<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    order <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">await<\/span> repo<span class=\"token punctuation\">.<\/span>get<span class=\"token punctuation\">(<\/span>order_id<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> order <span class=\"token keyword\">is<\/span> <span class=\"token boolean\">None<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">raise<\/span> OrderNotFound<span class=\"token punctuation\">(<\/span>order_id<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> order<span class=\"token punctuation\">.<\/span>status <span class=\"token keyword\">is<\/span> <span class=\"token keyword\">not<\/span> OrderStatus<span class=\"token punctuation\">.<\/span>PENDING<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">raise<\/span> CancelNotAllowed<span class=\"token punctuation\">(<\/span>order_id<span class=\"token operator\">&#061;<\/span>order<span class=\"token punctuation\">.<\/span><span class=\"token builtin\">id<\/span><span class=\"token punctuation\">,<\/span> status<span class=\"token operator\">&#061;<\/span>order<span class=\"token punctuation\">.<\/span>status<span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">async<\/span> <span class=\"token keyword\">with<\/span> repo<span class=\"token punctuation\">.<\/span>transaction<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        order<span class=\"token punctuation\">.<\/span>status <span class=\"token operator\">&#061;<\/span> OrderStatus<span class=\"token punctuation\">.<\/span>CANCELLED<br \/>\n        <span class=\"token keyword\">await<\/span> repo<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">await<\/span> audit<span class=\"token punctuation\">.<\/span>record<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;order.cancelled&#034;<\/span><span class=\"token punctuation\">,<\/span> order_id<span class=\"token operator\">&#061;<\/span>order<span class=\"token punctuation\">.<\/span><span class=\"token builtin\">id<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u53d8\u5316\u7684\u53ea\u6709\u4e00\u884c&#xff1a;\u4e8b\u52a1\u4ece repo.transaction() \u6765&#xff0c;\u5177\u4f53\u662f\u54ea\u4e00\u79cd\u6570\u636e\u5e93\u3001\u7528\u54ea\u4e2a\u4f1a\u8bdd\u5de5\u5382&#xff0c;\u7531\u5b9e\u73b0\u5c42\u51b3\u5b9a\u3002\u7528\u4f8b\u5c42\u4ecd\u7136\u53ea\u8ba4\u8bc6\u4ed3\u5e93\u63a5\u53e3&#xff0c;\u5185\u5b58\u5b9e\u73b0\u4e5f\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u7a7a\u7684\u4e8b\u52a1\u4e0a\u4e0b\u6587&#xff0c;\u4e8e\u662f\u5355\u5143\u6d4b\u8bd5\u548c\u96c6\u6210\u6d4b\u8bd5\u8d70\u7684\u662f\u540c\u4e00\u6761\u8def\u3002<\/p>\n<p>\u518d\u8dd1\u4e00\u6b21\u90a3\u6761\u67b6\u6784\u6d4b\u8bd5&#xff1a;<\/p>\n<p>pytest <span class=\"token parameter variable\">-q<\/span> tests\/architecture\/test_layer_dependencies.py<\/p>\n<p>1 passed in 0.19s<\/p>\n<p>\u5230\u8fd9\u91cc&#xff0c;\u89c4\u5219\u4ece\u201c\u5199\u5728\u6587\u6863\u91cc\u7684\u4e00\u53e5\u8bdd\u201d\u53d8\u6210\u4e86\u201c\u4e00\u6761\u4f1a\u5931\u8d25\u7684\u68c0\u67e5\u201d\u3002\u5b83\u7684\u5f3a\u5ea6\u53d8\u4e86&#xff1a;\u4ee5\u524d\u5b83\u9760\u6bcf\u4e2a\u4eba\u8bb0\u5f97&#xff0c;\u73b0\u5728\u5b83\u9760\u4ee3\u7801\u73b0\u5b9e\u8bf4\u8bdd\u3002<\/p>\n<p>\u987a\u4fbf\u8bf4\u660e\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u9009\u9759\u6001\u68c0\u67e5&#xff0c;\u800c\u4e0d\u662f\u5728\u8fd0\u884c\u65f6\u52a0\u4e00\u6bb5\u65ad\u8a00\u3002\u8fd0\u884c\u65f6\u68c0\u67e5\u53ea\u80fd\u8986\u76d6\u88ab\u6267\u884c\u5230\u7684\u4ee3\u7801\u8def\u5f84&#xff0c;\u4e00\u6761\u5f88\u5c11\u88ab\u8c03\u7528\u7684\u5206\u652f\u91cc\u7684\u8fdd\u89c4\u53ef\u4ee5\u6f5c\u4f0f\u5f88\u4e45&#xff1b;\u9759\u6001\u68c0\u67e5\u8bfb\u7684\u662f\u5168\u90e8\u6e90\u7801&#xff0c;\u4e0d\u53d7\u8c03\u7528\u8def\u5f84\u5f71\u54cd\u3002\u4ee3\u4ef7\u662f\u9759\u6001\u68c0\u67e5\u53ef\u80fd\u8bef\u62a5\u2014\u2014\u5b83\u770b\u5230\u4e00\u4e2a\u5bfc\u5165\u5c31\u8ba4\u4e3a\u8fdd\u89c4&#xff0c;\u54ea\u6015\u90a3\u4e2a\u5bfc\u5165\u53ea\u5728\u7c7b\u578b\u6807\u6ce8\u91cc\u7528\u5230\u3002\u8bef\u62a5\u53ef\u4ee5\u7528\u660e\u786e\u7684\u4f8b\u5916\u6761\u76ee\u5904\u7406&#xff0c;\u8fd9\u6bd4\u6f0f\u62a5\u5bb9\u6613\u63a5\u53d7\u5f97\u591a\u3002<\/p>\n<h4>4.6 \u53e6\u4e00\u4e2a\u9009\u62e9&#xff1a;\u73b0\u6210\u7684\u4f9d\u8d56\u68c0\u67e5\u5de5\u5177<\/h4>\n<p>\u624b\u5199 AST \u6d4b\u8bd5\u7684\u4f18\u70b9\u662f\u96f6\u4f9d\u8d56\u3001\u5b8c\u5168\u53ef\u63a7\u3001\u62a5\u9519\u4fe1\u606f\u7531\u4f60\u81ea\u5df1\u5199\u3002\u7f3a\u70b9\u662f\u5f53\u5c42\u6b21\u7ea6\u5b9a\u53d8\u590d\u6742\u65f6&#xff0c;\u6d4b\u8bd5\u672c\u8eab\u4f1a\u5f00\u59cb\u81a8\u80c0\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u8003\u8651\u73b0\u6210\u7684\u4f9d\u8d56\u68c0\u67e5\u5de5\u5177&#xff0c;\u4f8b\u5982 import-linter \u8fd9\u7c7b\u4e13\u95e8\u7528\u6765\u8868\u8fbe\u201c\u54ea\u4e9b\u5305\u4e0d\u80fd\u4f9d\u8d56\u54ea\u4e9b\u5305\u201d\u7684\u5de5\u5177\u3002<\/p>\n<p>\u4e24\u6761\u5b9e\u8df5\u5efa\u8bae\u3002\u7b2c\u4e00&#xff0c;\u5148\u5728\u5c0f\u8303\u56f4\u8bd5\u8dd1&#xff0c;\u786e\u8ba4\u5b83\u5bf9\u4f60\u4eec\u9879\u76ee\u7684\u76ee\u5f55\u7ed3\u6784\u7406\u89e3\u6b63\u786e&#xff0c;\u518d\u628a\u5b83\u63a5\u8fdb CI&#xff1b;\u76f4\u63a5\u4e0a\u5168\u91cf\u914d\u7f6e\u5bb9\u6613\u51fa\u73b0\u5927\u91cf\u8bef\u62a5&#xff0c;\u800c\u8bef\u62a5\u4f1a\u8ba9\u4eba\u5f00\u59cb\u7ed5\u8fc7\u68c0\u67e5\u3002\u7b2c\u4e8c&#xff0c;\u5de5\u5177\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u662f\u4e00\u79cd\u89c4\u5219\u8f7d\u4f53&#xff0c;\u6539\u914d\u7f6e\u7684\u65f6\u5019\u8981\u540c\u6b65\u6539 AGENTS.md \u91cc\u7684\u8bf4\u6cd5&#xff0c;\u5426\u5219\u4e24\u8fb9\u4f1a\u51fa\u73b0\u4e24\u5957\u4e8b\u5b9e\u3002<\/p>\n<p>\u9009\u54ea\u4e00\u79cd\u4e0d\u91cd\u8981&#xff0c;\u91cd\u8981\u7684\u662f\u6709\u5e76\u4e14\u88ab\u6267\u884c\u3002<\/p>\n<h4>4.7 \u63a5\u8fdb\u95e8\u7981\u624d\u7b97\u5b8c\u6210<\/h4>\n<p>\u4e00\u6761\u53ea\u5728\u4f60\u624b\u52a8\u8fd0\u884c\u65f6\u624d\u751f\u6548\u7684\u68c0\u67e5&#xff0c;\u5f3a\u5ea6\u4ecb\u4e8e\u8f6f\u7ea6\u675f\u548c\u786c\u7ea6\u675f\u4e4b\u95f4\u3002\u8981\u8ba9\u5b83\u53d8\u6210\u786c\u7ea6\u675f&#xff0c;\u628a\u5b83\u653e\u8fdb\u5df2\u6709\u7684\u9a8c\u8bc1\u5165\u53e3&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/usr\/bin\/env bash<\/span><br \/>\n<span class=\"token comment\"># scripts\/verify.sh<\/span><br \/>\n<span class=\"token builtin class-name\">set<\/span> <span class=\"token parameter variable\">-euo<\/span> pipefail<\/p>\n<p>pytest <span class=\"token parameter variable\">-q<\/span> tests\/architecture<br \/>\npytest <span class=\"token parameter variable\">-q<\/span> tests\/orders<br \/>\nruff check <span class=\"token builtin class-name\">.<\/span><\/p>\n<p>\u7136\u540e\u5728 CI \u91cc\u8c03\u7528\u540c\u4e00\u4e2a\u811a\u672c\u3002\u8fd9\u6837\u505a\u7684\u989d\u5916\u597d\u5904\u662f&#xff0c;\u672c\u5730\u548c CI \u8dd1\u7684\u662f\u540c\u4e00\u6761\u547d\u4ee4&#xff0c;\u51fa\u73b0\u5206\u6b67\u65f6\u5bb9\u6613\u6392\u67e5\u3002<\/p>\n<p>\u8fd9\u91cc\u987a\u4fbf\u533a\u5206\u4e24\u7c7b\u4e0d\u540c\u7684\u95e8\u7981\u3002\u67b6\u6784\u6d4b\u8bd5\u7ba1\u7684\u662f\u4ee3\u7801\u7ed3\u6784&#xff0c;\u6bd4\u5982\u201c\u8c01\u5bfc\u5165\u4e86\u8c01\u201d&#xff1b;\u547d\u4ee4\u89c4\u5219\u7ba1\u7684\u662f\u547d\u4ee4\u672c\u8eab\u80fd\u4e0d\u80fd\u8dd1&#xff0c;\u6bd4\u5982\u7981\u6b62\u5f3a\u5236\u63a8\u9001\u3001\u8981\u6c42\u6570\u636e\u5e93\u8fc1\u79fb\u5148\u5ba1\u6279\u3002\u540e\u8005\u7684\u5199\u6cd5\u662f\u653e\u5728 rules\/ \u76ee\u5f55\u4e0b\u7684 .rules \u6587\u4ef6\u91cc&#xff0c;\u7528 prefix_rule(pattern&#061;[&#8230;], decision&#061;&#034;allow|prompt|forbidden&#034;, justification&#061;&#034;&#8230;&#034;) \u63cf\u8ff0&#xff1b;\u591a\u6761\u89c4\u5219\u540c\u65f6\u5339\u914d\u65f6\u53d6\u6700\u4e25\u683c\u7684\u4e00\u6761&#xff1a;forbidden \u6bd4 prompt \u4e25\u683c&#xff0c;prompt \u6bd4 allow \u4e25\u683c\u3002\u60f3\u786e\u8ba4\u67d0\u6761\u547d\u4ee4\u4f1a\u5f97\u5230\u4ec0\u4e48\u7ed3\u679c&#xff0c;\u53ef\u4ee5\u7528 codex execpolicy check &#8211;pretty &#8211;rules &lt;\u6587\u4ef6&gt; &#8212; &lt;\u547d\u4ee4&gt; \u5148\u770b\u4e00\u773c\u3002\u8fd9\u4e24\u7c7b\u95e8\u7981\u4e92\u8865&#xff0c;\u8c01\u4e5f\u66ff\u4ee3\u4e0d\u4e86\u8c01&#xff1a;\u547d\u4ee4\u89c4\u5219\u62e6\u4e0d\u4f4f\u4e00\u6b21\u9519\u8bef\u7684\u5bfc\u5165&#xff0c;\u67b6\u6784\u6d4b\u8bd5\u4e5f\u62e6\u4e0d\u4f4f\u4e00\u6761\u5371\u9669\u547d\u4ee4\u3002<\/p>\n<h4>4.8 \u62a5\u9519\u4fe1\u606f\u8981\u7ed9\u51fa\u66ff\u4ee3\u505a\u6cd5<\/h4>\n<p>\u540c\u4e00\u6761\u68c0\u67e5&#xff0c;\u62a5\u9519\u4fe1\u606f\u5199\u5f97\u4e0d\u540c&#xff0c;\u4fee\u590d\u6548\u7387\u5dee\u522b\u5f88\u5927\u3002<\/p>\n<p>\u5dee\u7684\u5199\u6cd5&#xff1a;<\/p>\n<p>AssertionError<\/p>\n<p>\u597d\u4e00\u70b9\u7684\u5199\u6cd5&#xff1a;<\/p>\n<p>orders\/services\/cancel_order.py \u5bfc\u5165\u4e86 orders.repositories.postgres<\/p>\n<p>\u66f4\u597d\u7684\u5199\u6cd5&#xff1a;<\/p>\n<p>orders\/services\/cancel_order.py \u5bfc\u5165\u4e86 orders.repositories.postgres\u3002<br \/>\nservices \u5c42\u4e0d\u5141\u8bb8\u76f4\u63a5\u4f9d\u8d56 repositories \u5b9e\u73b0\u3002\u9700\u8981\u4e8b\u52a1\u65f6&#xff0c;\u8bf7\u4f7f\u7528 repo.transaction()\u3002<\/p>\n<p>\u4e09\u79cd\u5199\u6cd5\u7684\u5dee\u522b\u5728\u6700\u540e\u4e00\u53e5\u3002\u524d\u4e24\u79cd\u53ea\u544a\u8bc9\u6267\u884c\u8005\u201c\u4f60\u88ab\u62e6\u4f4f\u4e86\u201d&#xff0c;\u7b2c\u4e09\u79cd\u544a\u8bc9\u5b83\u5f80\u54ea\u8d70\u3002\u5bf9 Agent \u6765\u8bf4&#xff0c;\u8fd9\u4e00\u53e5\u5c24\u5176\u91cd\u8981&#xff1a;\u5b83\u770b\u4e0d\u5230\u4f60\u4eec\u7684\u53e3\u5934\u7ea6\u5b9a&#xff0c;\u53ea\u80fd\u770b\u5230\u8fd9\u6761\u9519\u8bef\u4fe1\u606f\u3002\u9519\u8bef\u4fe1\u606f\u5b9e\u9645\u4e0a\u5c31\u662f\u786c\u7ea6\u675f\u7684\u8bf4\u660e\u4e66\u3002<\/p>\n<h4>4.9 \u4f8b\u5916\u673a\u5236&#xff1a;\u7ed9\u7834\u4f8b\u7559\u4e00\u4e2a\u5165\u53e3<\/h4>\n<p>\u4efb\u4f55\u89c4\u5219\u90fd\u4f1a\u9047\u5230\u9700\u8981\u7834\u4f8b\u7684\u65f6\u523b\u3002\u6ca1\u6709\u6b63\u5f0f\u5165\u53e3&#xff0c;\u7834\u4f8b\u5c31\u4f1a\u4ee5\u4e24\u79cd\u65b9\u5f0f\u53d1\u751f&#xff1a;\u8981\u4e48\u6709\u4eba\u5077\u5077\u7ed5\u8fc7\u68c0\u67e5&#xff0c;\u8981\u4e48\u68c0\u67e5\u88ab\u6574\u4f53\u5173\u6389\u3002\u4e24\u79cd\u90fd\u6bd4\u7834\u4f8b\u672c\u8eab\u66f4\u7cdf\u3002\u6b63\u5f0f\u5165\u53e3\u53ef\u4ee5\u662f\u4e00\u6761\u767d\u540d\u5355&#xff0c;\u6bcf\u4e2a\u6761\u76ee\u90fd\u5199\u6e05\u4f4d\u7f6e\u548c\u7406\u7531&#xff1a;<\/p>\n<p>EXCEPTIONS <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\"># \u4f4d\u7f6e&#xff1a;\u7406\u7531&#xff08;\u8c01\u6279\u7684\u3001\u4ec0\u4e48\u65f6\u5019\u64a4&#xff09;<\/span><br \/>\n    <span class=\"token string\">&#034;orders\/services\/reporting.py&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u62a5\u8868\u805a\u5408\u9700\u8981\u8de8\u8868\u67e5\u8be2&#xff0c;\u8ba1\u5212\u8fc1\u5230 orders\/reports\/ \u540e\u5220\u9664&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5173\u952e\u5728\u62ec\u53f7\u91cc\u7684\u4e24\u4ef6\u4e8b&#xff1a;\u8c01\u6279\u7684\u3001\u4ec0\u4e48\u65f6\u5019\u64a4\u3002\u53ea\u5199\u7406\u7531\u7684\u4f8b\u5916\u4f1a\u6c38\u4e45\u7559\u5728\u4ee3\u7801\u91cc&#xff0c;\u4e09\u5e74\u540e\u6ca1\u4eba\u77e5\u9053\u5b83\u662f\u5426\u8fd8\u9700\u8981\u3002\u5e26\u7740\u64a4\u56de\u65f6\u95f4\u7684\u4f8b\u5916&#xff0c;\u4f1a\u81ea\u5df1\u63d0\u9192\u4f60\u56de\u5934\u5904\u7406\u3002<\/p>\n<h4>4.10 \u4e00\u6b21\u5b8c\u6574\u7684\u8bb0\u5f55<\/h4>\n<p>\u628a\u8fd9\u6b21\u6539\u9020\u4e32\u8d77\u6765&#xff0c;\u547d\u4ee4\u884c\u7684\u65f6\u95f4\u7ebf\u662f\u8fd9\u6837\u7684&#xff1a;<\/p>\n<p>$ pytest -q tests\/architecture\/test_layer_dependencies.py<br \/>\n1 failed in 0.21s                      # \u8fdd\u89c4\u5b58\u5728&#xff0c;\u68c0\u67e5\u4f1a\u7ea2<br \/>\n$ codex exec &#8211;sandbox workspace-write &#034;\u6309\u5931\u8d25\u4fe1\u606f\u4fee\u590d cancel_order&#xff0c;\u4e0d\u8981\u4fee\u6539\u67b6\u6784\u6d4b\u8bd5&#034;<br \/>\n$ pytest -q tests\/architecture\/test_layer_dependencies.py<br \/>\n1 passed in 0.19s                      # \u7ed3\u6784\u6062\u590d&#xff0c;\u89c4\u5219\u88ab\u6ee1\u8db3<br \/>\n$ bash scripts\/verify.sh<br \/>\n8 passed, 2 passed in 1.04s            # \u5168\u90e8\u95e8\u7981\u901a\u8fc7&#xff0c;\u9000\u51fa\u7801 0<\/p>\n<p>\u8fd9\u6bb5\u8bb0\u5f55\u91cc\u6709\u4e24\u6b21\u901a\u8fc7\u3002\u7b2c\u4e00\u6b21\u901a\u8fc7\u8bf4\u660e\u7ed3\u6784\u5bf9\u4e86&#xff0c;\u7b2c\u4e8c\u6b21\u901a\u8fc7\u8bf4\u660e\u6574\u4f53\u6ca1\u88ab\u7834\u574f\u3002\u4e24\u6761\u90fd\u8981&#xff0c;\u7406\u7531\u5f88\u5b9e\u9645&#xff1a;\u4fee\u7ed3\u6784\u7684\u65f6\u5019\u5f88\u5bb9\u6613\u987a\u624b\u6539\u574f\u522b\u7684\u4e1c\u897f\u3002<\/p>\n<h4>4.11 \u540c\u4e00\u5957\u529e\u6cd5\u80fd\u8986\u76d6\u7684\u5176\u5b83\u89c4\u5219<\/h4>\n<p>\u8de8\u5c42\u4f9d\u8d56\u53ea\u662f\u6700\u5e38\u89c1\u7684\u4e00\u6761\u3002\u4e0b\u9762\u4e09\u6761\u89c4\u5219\u4e5f\u80fd\u7528\u540c\u6837\u7684\u65b9\u5f0f\u786c\u8d77\u6765&#xff0c;\u5199\u6cd5\u7565\u6709\u4e0d\u540c&#xff0c;\u4f46\u9aa8\u67b6\u4e00\u6837&#xff1a;\u8303\u56f4\u3001\u7981\u6b62\u5bf9\u8c61\u3001\u5224\u5b9a\u4fe1\u53f7\u3001\u5931\u8d25\u4fe1\u606f\u3002<\/p>\n<p>\u7b2c\u4e00\u6761&#xff1a;\u751f\u6210\u4ee3\u7801\u4e0d\u80fd\u88ab\u624b\u5de5\u4fee\u6539\u3002\u5224\u5b9a\u4fe1\u53f7\u662f\u6587\u4ef6\u5934\u6ce8\u91ca\u91cc\u7684\u201c\u672c\u6587\u4ef6\u7531\u751f\u6210\u5668\u4ea7\u51fa\u201d\u6807\u8bb0&#xff0c;\u68c0\u67e5\u65b9\u5f0f\u662f\u6bd4\u5bf9\u751f\u6210\u5668\u7684\u8f93\u51fa\u4e0e\u4ed3\u5e93\u91cc\u7684\u6587\u4ef6\u662f\u5426\u4e00\u81f4\u3002\u5931\u8d25\u4fe1\u606f\u91cc\u8981\u5199\u6e05\u91cd\u65b0\u751f\u6210\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u7b2c\u4e8c\u6761&#xff1a;\u63a5\u53e3\u5c42\u4e0d\u5141\u8bb8\u5199\u4e1a\u52a1\u89c4\u5219\u3002\u5224\u5b9a\u4fe1\u53f7\u53ef\u4ee5\u662f\u201csrc\/orders\/api \u4e0b\u7684\u51fd\u6570\u4f53\u91cc\u51fa\u73b0\u72b6\u6001\u5224\u65ad\u201d&#xff0c;\u5b9e\u73b0\u65b9\u5f0f\u901a\u5e38\u9700\u8981\u4e00\u70b9\u8bed\u6cd5\u5c42\u9762\u7684\u5206\u6790&#xff0c;\u6bd4\u5982\u7edf\u8ba1\u51fd\u6570\u91cc\u7684\u6761\u4ef6\u5206\u652f\u548c\u72b6\u6001\u679a\u4e3e\u5f15\u7528\u3002\u8fd9\u6761\u68c0\u67e5\u6bd4\u5bfc\u5165\u68c0\u67e5\u590d\u6742&#xff0c;\u6240\u4ee5\u66f4\u9002\u5408\u5148\u5199\u6210\u63d0\u9192&#xff0c;\u7b49\u7a33\u5b9a\u4e4b\u540e\u518d\u5347\u7ea7\u6210\u95e8\u7981\u3002<\/p>\n<p>\u7b2c\u4e09\u6761&#xff1a;\u65b0\u589e\u63a5\u53e3\u5fc5\u987b\u5e26\u6d4b\u8bd5\u3002\u5224\u5b9a\u4fe1\u53f7\u662f\u65b0\u589e\u7684\u8def\u7531\u51fd\u6570\u4e0e\u6d4b\u8bd5\u6587\u4ef6\u4e4b\u95f4\u7684\u5bf9\u5e94\u5173\u7cfb&#xff0c;\u5b9e\u73b0\u65b9\u5f0f\u662f\u8bfb\u53d6\u6539\u52a8\u6e05\u5355&#xff0c;\u68c0\u67e5\u65b0\u589e\u7684\u8def\u7531\u8def\u5f84\u662f\u5426\u51fa\u73b0\u5728\u6d4b\u8bd5\u91cc\u3002\u5b83\u4f9d\u8d56\u7248\u672c\u63a7\u5236\u7684\u4fe1\u606f&#xff0c;\u9002\u5408\u653e\u5728 CI \u91cc\u8dd1&#xff0c;\u56e0\u4e3a\u90a3\u91cc\u80fd\u62ff\u5230\u4e24\u4e2a\u7248\u672c\u4e4b\u95f4\u7684\u5dee\u5f02\u3002<\/p>\n<p>\u8fd9\u4e09\u6761\u7684\u5171\u540c\u70b9\u662f&#xff1a;\u5b83\u4eec\u90fd\u53ef\u4ee5\u88ab\u4e00\u6761\u547d\u4ee4\u56de\u7b54\u3002\u5982\u679c\u4e00\u6761\u89c4\u5219\u8fde\u201c\u600e\u4e48\u7b97\u8fdd\u89c4\u201d\u90fd\u8bf4\u4e0d\u6e05&#xff0c;\u90a3\u5b83\u66f4\u9002\u5408\u7559\u5728\u6587\u6863\u91cc&#xff0c;\u9760\u4eba\u5224\u65ad\u3002<\/p>\n<h4>4.12 \u68c0\u67e5\u7684\u8fd0\u884c\u6210\u672c<\/h4>\n<p>\u7ed3\u6784\u68c0\u67e5\u548c\u529f\u80fd\u6d4b\u8bd5\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u5dee\u522b&#xff1a;\u5b83\u4e0d\u9700\u8981\u542f\u52a8\u6570\u636e\u5e93\u3001\u4e0d\u9700\u8981\u7f51\u7edc\u3001\u4e0d\u4f9d\u8d56\u5916\u90e8\u670d\u52a1&#xff0c;\u6240\u4ee5\u5b83\u901a\u5e38\u5728\u4e00\u79d2\u4ee5\u5185\u8dd1\u5b8c\u3002\u8fd9\u4e2a\u7279\u70b9\u8ba9\u5b83\u5f88\u9002\u5408\u653e\u5728\u6700\u524d\u9762&#xff1a;\u5f00\u53d1\u8005\u672c\u5730\u968f\u65f6\u8dd1&#xff0c;\u63d0\u4ea4\u524d\u8dd1&#xff0c;CI \u91cc\u7b2c\u4e00\u4e2a\u8dd1\u3002\u524d\u9762\u5931\u8d25\u4e86&#xff0c;\u540e\u9762\u7684\u6162\u68c0\u67e5\u5c31\u4e0d\u7528\u542f\u52a8\u3002<\/p>\n<p>\u57fa\u4e8e\u8fd9\u4e2a\u5dee\u522b&#xff0c;\u4e00\u4e2a\u5b9e\u7528\u7684\u987a\u5e8f\u662f&#xff1a;\u7ed3\u6784\u68c0\u67e5\u3001\u5feb\u901f\u5355\u5143\u6d4b\u8bd5\u3001\u6162\u7684\u96c6\u6210\u6d4b\u8bd5\u3002\u987a\u5e8f\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u53cd\u9988\u4f18\u5316&#xff0c;\u56e0\u4e3a\u8d8a\u9760\u524d\u7684\u68c0\u67e5\u8d8a\u4fbf\u5b9c&#xff0c;\u8d8a\u65e9\u505c\u4e0b\u6765\u8d8a\u7701\u65f6\u95f4\u3002\u6ce8\u610f\u8fd9\u4e0d\u610f\u5473\u7740\u540e\u9762\u7684\u68c0\u67e5\u53ef\u4ee5\u4e0d\u8dd1&#xff0c;\u53ea\u610f\u5473\u7740\u5931\u8d25\u65f6\u80fd\u66f4\u5feb\u5730\u77e5\u9053\u539f\u56e0\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4eec\u7684\u67b6\u6784\u68c0\u67e5\u8dd1\u4e00\u6b21\u8d85\u8fc7\u51e0\u79d2&#xff0c;\u901a\u5e38\u8bf4\u660e\u5b83\u5728\u505a\u522b\u7684\u4e8b&#xff1a;\u542f\u52a8\u5e94\u7528\u3001\u8fde\u6570\u636e\u5e93\u3001\u626b\u63cf\u6574\u4e2a\u4f9d\u8d56\u6811\u3002\u8fd9\u7c7b\u68c0\u67e5\u5e94\u8be5\u88ab\u62c6\u6210\u4e24\u90e8\u5206&#xff0c;\u628a\u80fd\u9759\u6001\u5224\u5b9a\u7684\u90e8\u5206\u5355\u72ec\u62ff\u51fa\u6765&#xff0c;\u8ba9\u5b83\u56de\u5230\u201c\u79d2\u7ea7\u201d\u7684\u6c34\u5e73\u3002<\/p>\n<h4>4.13 \u8ba9 Agent \u77e5\u9053\u8fd9\u6761\u68c0\u67e5\u5b58\u5728<\/h4>\n<p>\u68c0\u67e5\u5199\u597d\u4e4b\u540e\u8fd8\u6709\u4e00\u6b65\u7ecf\u5e38\u88ab\u6f0f\u6389&#xff1a;\u628a\u5b83\u7684\u5b58\u5728\u544a\u8bc9\u6267\u884c\u8005\u3002\u8fd9\u4e0d\u662f\u4e3a\u4e86\u793c\u8c8c&#xff0c;\u800c\u662f\u4e3a\u4e86\u7701\u4e00\u6b21\u8fd4\u5de5\u3002<\/p>\n<p>\u4efb\u52a1\u5355\u91cc\u52a0\u4e00\u884c\u5c31\u591f&#xff1a;<\/p>\n<p>\u9a8c\u8bc1&#xff1a;bash scripts\/verify.sh&#xff08;\u5305\u542b\u67b6\u6784\u68c0\u67e5\u4e0e\u8ba2\u5355\u6a21\u5757\u7528\u4f8b&#xff0c;\u5fc5\u987b\u5168\u90e8\u901a\u8fc7&#xff09;<br \/>\n\u7ea6\u675f&#xff1a;services \u5c42\u4e0d\u5f97\u5bfc\u5165 orders.repositories \u4e0b\u7684\u5b9e\u73b0&#xff0c;\u9700\u8981\u4e8b\u52a1\u65f6\u4f7f\u7528 repo.transaction()<\/p>\n<p>\u8fd9\u4e24\u884c\u5e26\u6765\u7684\u5dee\u522b\u5f88\u76f4\u63a5\u3002\u6ca1\u6709\u5b83\u4eec&#xff0c;Agent \u4f1a\u5148\u5199\u4e00\u7248\u81ea\u5df1\u8ba4\u4e3a\u5408\u7406\u7684\u5b9e\u73b0&#xff0c;\u7136\u540e\u88ab\u68c0\u67e5\u62e6\u4e0b&#xff0c;\u518d\u82b1\u4e00\u8f6e\u6539&#xff1b;\u6709\u4e86\u5b83\u4eec&#xff0c;\u5b83\u4e00\u5f00\u59cb\u5c31\u4f1a\u53bb\u627e\u4ed3\u5e93\u63a5\u53e3\u91cc\u6709\u6ca1\u6709\u53ef\u7528\u7684\u5165\u53e3\u3002\u524d\u4e00\u79cd\u8def\u5f84\u4e5f\u80fd\u5230\u8fbe\u7ec8\u70b9&#xff0c;\u53ea\u662f\u591a\u4e00\u6b21\u5f80\u8fd4\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u7ec6\u8282&#xff1a;\u4efb\u52a1\u5355\u91cc\u7684\u7ea6\u675f\u6700\u597d\u548c\u68c0\u67e5\u7684\u62a5\u9519\u4fe1\u606f\u7528\u540c\u4e00\u5957\u8bf4\u6cd5\u3002\u5982\u679c\u6587\u6863\u8bf4\u201c\u4e0d\u8981\u8de8\u5c42\u8c03\u7528\u201d&#xff0c;\u68c0\u67e5\u8bf4\u201c\u4e0d\u5f97\u5bfc\u5165 orders.repositories\u201d&#xff0c;\u6539\u7684\u4eba\u9700\u8981\u5728\u4e24\u79cd\u8868\u8ff0\u4e4b\u95f4\u505a\u4e00\u6b21\u7ffb\u8bd1\u3002\u63aa\u8f9e\u7edf\u4e00\u4e4b\u540e&#xff0c;\u4ece\u8bfb\u6587\u6863\u5230\u8bfb\u62a5\u9519\u662f\u8fde\u7eed\u7684\u3002<\/p>\n<h3>\u4e94\u3001\u53cd\u4f8b\u4e0e\u4ee3\u4ef7<\/h3>\n<p>\u53cd\u4f8b\u4e00&#xff1a;\u89c4\u5219\u5199\u6210\u53e3\u53f7\u3002 \u201c\u4fdd\u6301\u5206\u5c42\u6e05\u6670\u201d\u201c\u4e0d\u8981\u5199\u91cd\u590d\u4ee3\u7801\u201d\u201c\u6ce8\u610f\u547d\u540d\u201d&#xff0c;\u8fd9\u7c7b\u89c4\u5219\u8bfb\u8d77\u6765\u5f88\u50cf\u90a3\u4e48\u56de\u4e8b&#xff0c;\u4f46\u5b83\u4eec\u6ca1\u6709\u53ef\u5224\u5b9a\u7684\u4fe1\u53f7&#xff0c;\u4e5f\u6ca1\u6709\u8303\u56f4\u3002\u6267\u884c\u8005\u53ea\u80fd\u5404\u81ea\u7406\u89e3\u4e00\u904d&#xff0c;\u7136\u540e\u6309\u81ea\u5df1\u7684\u7406\u89e3\u53bb\u9075\u5b88\u3002\u534a\u5e74\u540e\u4f60\u4f1a\u53d1\u73b0&#xff0c;\u5341\u4e2a\u4eba\u6709\u5341\u79cd\u201c\u6e05\u6670\u201d\u7684\u5b9a\u4e49\u3002\u4ee3\u4ef7\u662f\u89c4\u5219\u770b\u8d77\u6765\u5f88\u591a&#xff0c;\u5b9e\u9645\u7ea6\u675f\u529b\u63a5\u8fd1\u96f6\u3002<\/p>\n<p>\u53cd\u4f8b\u4e8c&#xff1a;\u68c0\u67e5\u505a\u5f97\u592a\u5bbd\u3002 \u6709\u7684\u56e2\u961f\u4e00\u4e0a\u6765\u5c31\u5199\u201cservices \u5c42\u4e0d\u5141\u8bb8\u5bfc\u5165\u4efb\u4f55\u975e\u6807\u51c6\u5e93\u6a21\u5757\u201d&#xff0c;\u7ed3\u679c\u6bcf\u6b21\u6b63\u5e38\u5f15\u7528\u9886\u57df\u5bf9\u8c61\u90fd\u8981\u6539\u6210\u767d\u540d\u5355\u6761\u76ee\u3002\u68c0\u67e5\u9891\u7e41\u8bef\u62a5\u4e4b\u540e&#xff0c;\u5927\u5bb6\u7684\u5e94\u5bf9\u65b9\u5f0f\u662f\u5f80\u767d\u540d\u5355\u91cc\u52a0\u4e1c\u897f&#xff0c;\u4e24\u4e2a\u661f\u671f\u540e\u767d\u540d\u5355\u6bd4\u89c4\u5219\u672c\u8eab\u8fd8\u957f\u3002\u68c0\u67e5\u592a\u5bbd\u7684\u4ee3\u4ef7\u4e0d\u662f\u8bef\u62a5\u672c\u8eab&#xff0c;\u800c\u662f\u5b83\u8bad\u7ec3\u4e86\u56e2\u961f\u7ed5\u8fc7\u68c0\u67e5\u7684\u4e60\u60ef\u3002<\/p>\n<p>\u53cd\u4f8b\u4e09&#xff1a;\u68c0\u67e5\u5b58\u5728&#xff0c;\u4f46\u4e0d\u5728\u95e8\u7981\u91cc\u3002 \u67b6\u6784\u6d4b\u8bd5\u5199\u597d\u4e86&#xff0c;\u653e\u5728\u4ed3\u5e93\u91cc&#xff0c;\u4f46\u6ca1\u8fdb CI&#xff0c;\u4e5f\u6ca1\u8fdb\u63d0\u4ea4\u524d\u811a\u672c\u3002\u5b83\u4f1a\u4e00\u76f4\u5728&#xff0c;\u4e5f\u4f1a\u4e00\u76f4\u80fd\u88ab\u8fd0\u884c&#xff0c;\u4f46\u6ca1\u6709\u4efb\u4f55\u4e00\u6b21\u8fdd\u89c4\u4f1a\u88ab\u5b83\u62e6\u4f4f\u3002\u8fd9\u79cd\u72b6\u6001\u6700\u8ff7\u60d1\u4eba&#xff0c;\u56e0\u4e3a\u6240\u6709\u4eba\u90fd\u77e5\u9053\u201c\u6211\u4eec\u6709\u67b6\u6784\u6d4b\u8bd5\u201d&#xff0c;\u5374\u6ca1\u6709\u4eba\u89c1\u8fc7\u5b83\u5931\u8d25\u3002<\/p>\n<p>\u53cd\u4f8b\u56db&#xff1a;\u53ea\u6539\u6587\u6863&#xff0c;\u4e0d\u6539\u68c0\u67e5\u3002 \u89c4\u5219\u8c03\u6574\u4e86&#xff0c;\u6bd4\u5982\u5141\u8bb8 services \u5c42\u76f4\u63a5\u8c03\u7528\u67d0\u4e2a\u65b0\u7684\u67e5\u8be2\u670d\u52a1&#xff0c;\u4f46\u68c0\u67e5\u6ca1\u66f4\u65b0\u3002\u4e8e\u662f\u68c0\u67e5\u5f00\u59cb\u62a5\u9519&#xff0c;\u800c\u4eba\u4eec\u77e5\u9053\u201c\u8fd9\u4e2a\u662f\u8001\u7684\u89c4\u5219\u201d&#xff0c;\u9009\u62e9\u5ffd\u7565\u5b83\u3002\u5ffd\u7565\u4e00\u6b21\u4e4b\u540e&#xff0c;\u8fd9\u6761\u68c0\u67e5\u5c31\u518d\u4e5f\u4e0d\u4f1a\u88ab\u5f53\u771f\u4e86\u3002\u6240\u4ee5\u89c4\u5219\u53d8\u66f4\u65f6&#xff0c;\u6587\u6863\u548c\u68c0\u67e5\u8981\u4e48\u4e00\u8d77\u6539&#xff0c;\u8981\u4e48\u4e00\u8d77\u5220\u3002<\/p>\n<p>\u53cd\u4f8b\u4e94&#xff1a;\u9760\u4eba\u5de5\u8bc4\u5ba1\u5b88\u4f4f\u7ed3\u6784\u3002 \u8bc4\u5ba1\u5f53\u7136\u8981\u770b\u7ed3\u6784&#xff0c;\u4f46\u628a\u7ed3\u6784\u7ea6\u5b9a\u5b8c\u5168\u4ea4\u7ed9\u8bc4\u5ba1&#xff0c;\u7b49\u4e8e\u628a\u68c0\u67e5\u653e\u5728\u6d41\u7a0b\u672b\u5c3e&#xff0c;\u800c\u4e14\u653e\u5728\u4e00\u4e2a\u66f4\u5bb9\u6613\u75b2\u52b3\u7684\u4f4d\u7f6e\u4e0a\u3002\u8de8\u5c42\u8c03\u7528\u8fd9\u7c7b\u95ee\u9898\u5728 diff \u91cc\u5f80\u5f80\u53ea\u6709\u4e00\u884c&#xff0c;\u8bc4\u5ba1\u4eba\u5f88\u5bb9\u6613\u8df3\u8fc7&#xff1b;\u800c\u5b83\u7684\u540e\u679c\u8981\u5230\u6362\u5b9e\u73b0\u3001\u6362\u5b58\u50a8\u3001\u6362\u6d4b\u8bd5\u73af\u5883\u65f6\u624d\u4f1a\u51fa\u73b0\u3002<\/p>\n<p>\u53cd\u4f8b\u516d&#xff1a;\u68c0\u67e5\u5199\u4e86&#xff0c;\u4f46\u6ca1\u4eba\u77e5\u9053\u3002 \u67b6\u6784\u6d4b\u8bd5\u653e\u5728\u4ed3\u5e93\u91cc&#xff0c;\u53ef\u4efb\u52a1\u5355\u4e0d\u63d0\u3001AGENTS.md \u4e0d\u63d0\u3001CI \u65e5\u5fd7\u91cc\u4e5f\u6ca1\u6709\u540d\u5b57\u3002\u7ed3\u679c\u6bcf\u4e2a\u6267\u884c\u8005\u90fd\u8981\u5148\u8fdd\u89c4\u4e00\u6b21\u624d\u80fd\u53d1\u73b0\u5b83\u7684\u5b58\u5728\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0d\u4e25\u91cd&#xff0c;\u4f46\u5f88\u6d6a\u8d39&#xff1a;\u4e00\u6761\u672c\u6765\u53ef\u4ee5\u63d0\u524d\u907f\u514d\u7684\u8fd4\u5de5&#xff0c;\u88ab\u91cd\u590d\u652f\u4ed8\u4e86\u5f88\u591a\u6b21\u3002\u8865\u6cd5\u5f88\u4fbf\u5b9c&#xff0c;\u5728\u4efb\u52a1\u5355\u7684\u9a8c\u8bc1\u90a3\u4e00\u884c\u91cc\u52a0\u4e0a\u5b83\u7684\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<p>\u8fd9\u4e9b\u53cd\u4f8b\u7684\u5171\u540c\u4ee3\u4ef7\u662f\u540c\u4e00\u4ef6\u4e8b&#xff1a;\u56e2\u961f\u6210\u5458\u5bf9\u89c4\u5219\u7684\u4fe1\u4efb\u88ab\u6d88\u8017\u6389\u3002\u89c4\u5219\u7684\u610f\u4e49\u4e0d\u5728\u4e8e\u5199\u4e0b\u6765&#xff0c;\u800c\u5728\u4e8e\u5b83\u88ab\u8fdd\u53cd\u65f6\u4f1a\u53d1\u751f\u4ec0\u4e48\u3002\u5982\u679c\u8fdd\u53cd\u6ca1\u6709\u4efb\u4f55\u540e\u679c&#xff0c;\u90a3\u4e48\u8fd9\u6761\u89c4\u5219\u5c31\u4f1a\u5728\u4e0b\u4e00\u6b21\u201c\u8fd9\u6b21\u60c5\u51b5\u7279\u6b8a\u201d\u7684\u65f6\u5019\u81ea\u7136\u5931\u6548\u2014\u2014\u5f00\u5934\u90a3\u4e2a\u4e8b\u52a1\u9700\u6c42\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u201c\u7279\u6b8a\u60c5\u51b5\u201d\u3002<\/p>\n<p>\u53cd\u8fc7\u6765&#xff0c;\u786c\u7ea6\u675f\u4e5f\u6709\u5b83\u7684\u4ee3\u4ef7&#xff0c;\u8fd9\u4e00\u70b9\u4e0d\u5fc5\u56de\u907f\u3002\u5b83\u4f1a\u5360\u7528\u65f6\u95f4&#xff1a;\u5199\u68c0\u67e5\u3001\u8c03\u68c0\u67e5\u3001\u7ef4\u62a4\u4f8b\u5916\u3002\u5b83\u8fd8\u4f1a\u5e26\u6765\u4e00\u79cd\u98ce\u9669&#xff0c;\u5c31\u662f\u8ba9\u4eba\u8bef\u4ee5\u4e3a\u201c\u68c0\u67e5\u7eff\u4e86\u5c31\u4e07\u4e8b\u5927\u5409\u201d&#xff0c;\u4ece\u800c\u5ffd\u7565\u68c0\u67e5\u8986\u76d6\u4e0d\u5230\u7684\u5730\u65b9\u3002\u63a7\u5236\u9762\u7684\u4f5c\u7528\u662f\u8ba9\u53ef\u5224\u5b9a\u7684\u90e8\u5206\u81ea\u52a8\u901a\u8fc7&#xff0c;\u628a\u4eba\u7684\u6ce8\u610f\u529b\u7559\u7ed9\u9700\u8981\u5224\u65ad\u7684\u90e8\u5206&#xff0c;\u800c\u4e0d\u662f\u53d6\u4ee3\u5224\u65ad\u3002<\/p>\n<h3>\u516d\u3001\u843d\u5730\u6b65\u9aa4<\/h3>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u6311\u4e00\u6761\u6700\u503c\u5f97\u786c\u8d77\u6765\u7684\u89c4\u5219\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u4ece\u73b0\u6709\u89c4\u5219\u91cc\u9009\u4e00\u6761\u8fdd\u89c4\u4ee3\u4ef7\u6700\u9ad8\u7684&#xff0c;\u6bd4\u5982\u8de8\u5c42\u4f9d\u8d56\u3001\u7ed5\u8fc7\u9274\u6743\u3001\u76f4\u63a5\u6539\u751f\u6210\u4ee3\u7801\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u4e00\u6b21\u505a\u5341\u6761\u89c4\u5219\u4f1a\u8ba9\u4eba\u5931\u53bb\u8010\u5fc3&#xff0c;\u800c\u5148\u505a\u4e00\u6761\u80fd\u7acb\u523b\u770b\u5230\u6548\u679c\u7684\u89c4\u5219&#xff0c;\u80fd\u5e26\u52a8\u540e\u9762\u51e0\u6761\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u95ee\u4e00\u4e2a\u95ee\u9898\u2014\u2014\u5982\u679c\u8fd9\u6761\u89c4\u5219\u88ab\u8fdd\u53cd\u5e76\u4e14\u4e09\u4e2a\u6708\u540e\u624d\u88ab\u53d1\u73b0&#xff0c;\u4ee3\u4ef7\u662f\u4ec0\u4e48\u3002\u7b54\u4e0d\u51fa\u9ad8\u4ee3\u4ef7\u7684&#xff0c;\u5148\u653e\u4e00\u653e\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff0c;\u628a\u89c4\u5219\u6539\u5199\u6210\u201c\u8303\u56f4 &#043; \u7981\u6b62\u5bf9\u8c61\u201d\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u628a\u201c\u4e0d\u8981\u8de8\u5c42\u8c03\u7528\u201d\u6539\u5199\u6210\u201csrc\/orders\/domain \u4e0e src\/orders\/services \u4e0b\u7684\u6587\u4ef6\u4e0d\u5f97\u5bfc\u5165 orders.repositories \u4e0b\u7684\u6a21\u5757\u201d\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u68c0\u67e5\u53ea\u8ba4\u5177\u4f53\u7684\u8303\u56f4\u548c\u5bf9\u8c61&#xff0c;\u542b\u7cca\u7684\u8868\u8ff0\u65e0\u6cd5\u7ffb\u8bd1\u6210\u4ee3\u7801\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u628a\u6539\u5199\u540e\u7684\u89c4\u5219\u8bfb\u7ed9\u4e00\u4e2a\u4e0d\u719f\u6089\u9879\u76ee\u7684\u4eba\u542c&#xff0c;\u770b\u4ed6\u80fd\u4e0d\u80fd\u8bf4\u51fa\u201c\u54ea\u4e9b\u6587\u4ef6\u88ab\u7ba1\u3001\u4ec0\u4e48\u884c\u4e3a\u88ab\u7981\u201d\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff0c;\u627e\u5230\u53ef\u5224\u5b9a\u7684\u4fe1\u53f7\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u786e\u5b9a\u68c0\u67e5\u8bfb\u4ec0\u4e48\u2014\u2014\u5bfc\u5165\u8bed\u53e5\u3001\u6587\u4ef6\u8def\u5f84\u3001\u51fd\u6570\u7b7e\u540d\u3001\u914d\u7f6e\u9879\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u4fe1\u53f7\u51b3\u5b9a\u4e86\u68c0\u67e5\u662f\u7a33\u5b9a\u8fd8\u662f\u4f1a\u7ecf\u5e38\u8bef\u62a5\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u5148\u624b\u5de5\u5728\u4ee3\u7801\u91cc\u641c\u4e00\u904d\u8fd9\u4e2a\u4fe1\u53f7&#xff0c;\u786e\u8ba4\u5b83\u5b58\u5728\u5e76\u4e14\u5f62\u6001\u53ef\u63a7\u3002\u5982\u679c\u540c\u4e00\u4e2a\u542b\u4e49\u6709\u4e03\u516b\u79cd\u5199\u6cd5&#xff0c;\u5148\u628a\u5199\u6cd5\u7edf\u4e00&#xff0c;\u6216\u8005\u5347\u7ea7\u5230\u8bed\u6cd5\u5c42\u9762\u7684\u68c0\u67e5\u3002<\/p>\n<p>\u7b2c\u56db\u6b65&#xff0c;\u5148\u5199\u4f1a\u5931\u8d25\u7684\u68c0\u67e5\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u5728\u8fdd\u89c4\u5b58\u5728\u7684\u4ee3\u7801\u4e0a\u628a\u68c0\u67e5\u8dd1\u4e00\u904d&#xff0c;\u786e\u8ba4\u5b83\u4f1a\u7ea2&#xff0c;\u5e76\u4e14\u62a5\u9519\u4fe1\u606f\u91cc\u5305\u542b\u6587\u4ef6\u8def\u5f84\u548c\u8fdd\u89c4\u5185\u5bb9\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u4e00\u6761\u4ece\u6ca1\u7ea2\u8fc7\u7684\u68c0\u67e5&#xff0c;\u4f60\u4e0d\u77e5\u9053\u5b83\u5728\u68c0\u67e5\u4ec0\u4e48\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u770b\u62a5\u9519\u4fe1\u606f\u3002\u5982\u679c\u53ea\u6709\u201c\u65ad\u8a00\u5931\u8d25\u201d\u56db\u4e2a\u5b57&#xff0c;\u8865\u4e0a\u4f4d\u7f6e\u548c\u66ff\u4ee3\u505a\u6cd5\u3002<\/p>\n<p>\u7b2c\u4e94\u6b65&#xff0c;\u4fee\u597d\u8fdd\u89c4\u518d\u8dd1\u4e00\u6b21\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u7528\u7b26\u5408\u89c4\u5219\u7684\u65b9\u5f0f\u89e3\u51b3\u95ee\u9898&#xff0c;\u800c\u4e0d\u662f\u7ed5\u8fc7\u68c0\u67e5\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u8fd9\u4e00\u6b65\u51b3\u5b9a\u4e86\u89c4\u5219\u662f\u5426\u53ef\u4fe1\u3002\u5982\u679c\u7b2c\u4e00\u6b21\u8fdd\u89c4\u90fd\u662f\u9760\u52a0\u4f8b\u5916\u89e3\u51b3\u7684&#xff0c;\u89c4\u5219\u5c31\u767d\u5199\u4e86\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u786e\u8ba4\u4fee\u590d\u65b9\u5f0f\u662f\u5728\u6b63\u786e\u7684\u5c42\u91cc\u63d0\u4f9b\u80fd\u529b&#xff0c;\u6bd4\u5982\u628a\u4e8b\u52a1\u505a\u8fdb\u4ed3\u5e93\u63a5\u53e3&#xff0c;\u800c\u4e0d\u662f\u628a\u8fdd\u89c4\u6587\u4ef6\u52a0\u8fdb\u767d\u540d\u5355\u3002<\/p>\n<p>\u7b2c\u516d\u6b65&#xff0c;\u628a\u68c0\u67e5\u63a5\u8fdb\u5df2\u6709\u7684\u95e8\u7981\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u628a\u8fd9\u6761\u68c0\u67e5\u52a0\u8fdb scripts\/verify.sh \u548c CI&#xff0c;\u5e76\u786e\u8ba4\u5b83\u4e0d\u4f1a\u88ab\u6761\u4ef6\u8df3\u8fc7\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u53ea\u6709\u63a5\u8fdb\u6d41\u7a0b&#xff0c;\u68c0\u67e5\u624d\u6709\u540e\u679c\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u6545\u610f\u5236\u9020\u4e00\u6b21\u8fdd\u89c4&#xff0c;\u63a8\u5230\u4e00\u4e2a\u8349\u7a3f\u5206\u652f\u4e0a&#xff0c;\u770b CI \u662f\u5426\u771f\u7684\u53d8\u7ea2\u3002<\/p>\n<p>\u7b2c\u4e03\u6b65&#xff0c;\u5199\u6e05\u4f8b\u5916\u5165\u53e3\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u7ed9\u51fa\u767d\u540d\u5355\u7684\u4f4d\u7f6e\u548c\u683c\u5f0f&#xff0c;\u6bcf\u4e2a\u4f8b\u5916\u5fc5\u987b\u5199\u7406\u7531\u548c\u64a4\u56de\u6761\u4ef6\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u6ca1\u6709\u6b63\u5f0f\u5165\u53e3&#xff0c;\u7834\u4f8b\u5c31\u4f1a\u53d8\u6210\u7ed5\u8fc7\u7684\u501f\u53e3\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u7ffb\u4e00\u904d\u767d\u540d\u5355&#xff0c;\u51e1\u662f\u53ea\u6709\u7406\u7531\u6ca1\u6709\u64a4\u56de\u6761\u4ef6\u7684\u6761\u76ee&#xff0c;\u8865\u4e0a\u6216\u8005\u5220\u6389\u3002<\/p>\n<p>\u7b2c\u516b\u6b65&#xff0c;\u540c\u6b65\u66f4\u65b0\u89c4\u5219\u6587\u4ef6\u3002<\/p>\n<p>\u505a\u4ec0\u4e48&#xff1a;\u5728 AGENTS.md \u91cc\u628a\u8fd9\u6761\u89c4\u5219\u6539\u6210\u66f4\u77ed\u7684\u8868\u8ff0&#xff0c;\u5e76\u6ce8\u660e\u201c\u5df2\u7531 tests\/architecture\/test_layer_dependencies.py \u68c0\u67e5\u201d\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1a;\u8fd9\u6837 Agent \u5728\u751f\u6210\u9636\u6bb5\u5c31\u77e5\u9053\u8fb9\u754c\u5728\u54ea&#xff0c;\u4e5f\u77e5\u9053\u8fb9\u754c\u4f1a\u88ab\u9a8c\u8bc1&#xff0c;\u800c\u4e0d\u662f\u7b49\u5230\u88ab\u62e6\u4e0b\u624d\u77e5\u9053\u3002<\/p>\n<p>\u600e\u4e48\u68c0\u67e5&#xff1a;\u8bfb\u4e00\u904d\u6587\u6863\u91cc\u7684\u89c4\u5219&#xff0c;\u786e\u8ba4\u6bcf\u4e00\u6761\u90fd\u80fd\u5bf9\u5e94\u5230\u4e00\u6761\u547d\u4ee4\u6216\u8005\u660e\u786e\u6807\u6ce8\u4e3a\u201c\u9700\u8981\u4eba\u5de5\u5224\u65ad\u201d\u3002\u5bf9\u4e0d\u4e0a\u7684&#xff0c;\u8981\u4e48\u8865\u68c0\u67e5&#xff0c;\u8981\u4e48\u6807\u6ce8\u6e05\u695a\u3002<\/p>\n<p>\u628a\u516b\u6b65\u5408\u6210\u4e00\u4efd\u53ef\u4ee5\u76f4\u63a5\u590d\u5236\u7684\u6a21\u677f&#xff1a;<\/p>\n<p>\u89c4\u5219\u539f\u6587&#xff1a;____________________________________<br \/>\n\u4f5c\u7528\u8303\u56f4&#xff1a;____________________________________<br \/>\n\u7981\u6b62\u5bf9\u8c61&#xff1a;____________________________________<br \/>\n\u5224\u5b9a\u4fe1\u53f7&#xff1a;____________________________________<br \/>\n\u68c0\u67e5\u547d\u4ee4&#xff1a;____________________________________<br \/>\n\u5931\u8d25\u65f6\u7684\u66ff\u4ee3\u505a\u6cd5&#xff1a;____________________________<br \/>\n\u95e8\u7981\u4f4d\u7f6e&#xff1a;\u672c\u5730\u811a\u672c \/ pre-commit \/ CI<br \/>\n\u4f8b\u5916\u6761\u76ee\u683c\u5f0f&#xff1a;\u4f4d\u7f6e &#043; \u7406\u7531 &#043; \u8c01\u6279\u7684 &#043; \u4f55\u65f6\u64a4<br \/>\n\u89c4\u5219\u6587\u4ef6\u91cc\u7684\u8868\u8ff0&#xff1a;____________________________<\/p>\n<p>\u8fd9\u4efd\u6a21\u677f\u586b\u5b8c\u4e4b\u540e&#xff0c;\u4f60\u4f1a\u5f97\u5230\u4e00\u6761\u4ece\u6587\u5b57\u5230\u547d\u4ee4\u7684\u5b8c\u6574\u94fe\u8def\u3002\u5b83\u6bd4\u60f3\u8c61\u4e2d\u77ed&#xff0c;\u5f80\u5f80\u4e00\u5c4f\u5c31\u80fd\u653e\u4e0b&#xff1b;\u4f46\u5b83\u628a\u4e00\u4e2a\u51ed\u8fd0\u6c14\u7684\u7ea6\u5b9a&#xff0c;\u6362\u6210\u4e86\u4e00\u4e2a\u786e\u5b9a\u7684\u8fb9\u754c\u3002<\/p>\n<p>\u5982\u679c\u4e00\u6b21\u4e0a\u7ebf\u516b\u6b65\u592a\u591a&#xff0c;\u53ef\u4ee5\u53ea\u505a\u5176\u4e2d\u6700\u77ed\u7684\u95ed\u73af&#xff1a;\u6311\u4e00\u6761\u89c4\u5219\u3001\u5199\u4e00\u6761\u68c0\u67e5\u3001\u8dd1\u4e00\u6b21\u5931\u8d25\u3001\u63a5\u8fdb CI\u3002\u56db\u4ef6\u4e8b\u505a\u5b8c&#xff0c;\u7b2c\u4e00\u6761\u786c\u7ea6\u675f\u5c31\u5b58\u5728\u4e86\u3002\u7b2c\u4e8c\u6761\u3001\u7b2c\u4e09\u6761\u53ef\u4ee5\u7b49\u5230\u4e0b\u4e00\u6b21\u8fed\u4ee3&#xff0c;\u4e0d\u5fc5\u4e00\u6b21\u6027\u628a\u89c4\u5219\u5e93\u5168\u90e8\u6539\u9020\u5b8c\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u987a\u5e8f\u95ee\u9898\u503c\u5f97\u8bf4\u6e05&#xff1a;\u786c\u7ea6\u675f\u548c\u6743\u9650\u4e0d\u662f\u540c\u4e00\u4ef6\u4e8b\u3002\u6743\u9650\u9650\u5236\u7684\u662f\u201c\u80fd\u4e0d\u80fd\u78b0\u67d0\u4e2a\u6587\u4ef6\u201d&#xff0c;\u6bd4\u5982\u4e0d\u5141\u8bb8\u5199 pyproject.toml&#xff1b;\u786c\u7ea6\u675f\u68c0\u67e5\u7684\u662f\u201c\u4ee3\u7801\u5448\u73b0\u4ec0\u4e48\u5f62\u6001\u201d&#xff0c;\u6bd4\u5982\u4e0d\u5141\u8bb8\u4ece\u67d0\u4e2a\u6a21\u5757\u5bfc\u5165\u3002\u4e24\u8005\u4e92\u8865\u3002\u6743\u9650\u6321\u4e0d\u4f4f\u4e00\u6b21\u5408\u6cd5\u7684\u6587\u4ef6\u7f16\u8f91&#xff0c;\u68c0\u67e5\u4e5f\u6321\u4e0d\u4f4f\u4e00\u6b21\u88ab\u5141\u8bb8\u5374\u65b9\u5411\u9519\u8bef\u7684\u6539\u52a8\u3002\u8bbe\u8ba1\u63a7\u5236\u9762\u7684\u65f6\u5019&#xff0c;\u5148\u95ee\u201c\u8fd9\u4e2a\u52a8\u4f5c\u662f\u4e0d\u662f\u6839\u672c\u4e0d\u8be5\u53d1\u751f\u201d&#xff0c;\u5982\u679c\u662f&#xff0c;\u7528\u6743\u9650&#xff1b;\u5982\u679c\u8fd9\u4e2a\u52a8\u4f5c\u672c\u8eab\u5408\u7406\u3001\u53ea\u662f\u5f62\u6001\u4e0d\u5bf9&#xff0c;\u7528\u68c0\u67e5\u3002<\/p>\n<h3>\u4e03\u3001FAQ<\/h3>\n<p>\u95ee&#xff1a;\u6211\u628a\u89c4\u5219\u52a0\u7c97\u3001\u5199\u5f97\u66f4\u4e25\u5389&#xff0c;\u4f1a\u4e0d\u4f1a\u66f4\u6709\u7528&#xff1f;<\/p>\n<p>\u63aa\u8f9e\u7684\u5f3a\u5ea6\u786e\u5b9e\u4f1a\u5f71\u54cd\u6a21\u578b\u7684\u884c\u4e3a&#xff0c;\u6240\u4ee5\u628a\u5173\u952e\u89c4\u5219\u5199\u5728\u663e\u773c\u4f4d\u7f6e\u662f\u503c\u5f97\u7684\u3002\u4f46\u63aa\u8f9e\u6539\u53d8\u7684\u662f\u6982\u7387&#xff0c;\u4e0d\u662f\u7ed3\u679c\u3002\u4eca\u5929\u5b83\u8bfb\u5230\u89c4\u5219\u5e76\u9075\u5b88&#xff0c;\u660e\u5929\u5b83\u9047\u5230\u4e00\u4e2a\u65b0\u60c5\u51b5&#xff0c;\u53ef\u80fd\u5c31\u9009\u4e86\u66f4\u987a\u624b\u7684\u90a3\u6761\u8def&#xff0c;\u800c\u4f60\u65e0\u6cd5\u4ece\u7ed3\u679c\u4e0a\u5206\u8fa8\u8fd9\u4e24\u79cd\u72b6\u6001\u3002\u60f3\u8ba9\u8fdd\u53cd\u89c4\u5219\u53d8\u6210\u4e0d\u53ef\u80fd&#xff0c;\u53ea\u6709\u68c0\u67e5\u80fd\u505a\u5230\u3002\u6240\u4ee5\u5408\u7406\u7684\u505a\u6cd5\u662f&#xff1a;\u6587\u6863\u91cc\u5199\u6e05\u695a&#xff08;\u5e2e\u52a9\u5b83\u505a\u5bf9&#xff09;&#xff0c;\u68c0\u67e5\u91cc\u5199\u6e05\u695a&#xff08;\u4fdd\u8bc1\u8fdd\u89c4\u53ef\u89c1&#xff09;&#xff0c;\u4e24\u4ef6\u4e8b\u90fd\u8981\u505a\u3002<\/p>\n<p>\u95ee&#xff1a;\u67b6\u6784\u6d4b\u8bd5\u548c\u666e\u901a\u6d4b\u8bd5\u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/p>\n<p>\u65ad\u8a00\u7684\u5bf9\u8c61\u4e0d\u540c\u3002\u666e\u901a\u6d4b\u8bd5\u65ad\u8a00\u4e1a\u52a1\u884c\u4e3a&#xff0c;\u6bd4\u5982\u201c\u5df2\u652f\u4ed8\u8ba2\u5355\u4e0d\u80fd\u53d6\u6d88\u201d&#xff1b;\u67b6\u6784\u6d4b\u8bd5\u65ad\u8a00\u4ee3\u7801\u5f62\u6001&#xff0c;\u6bd4\u5982\u201c\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u4e0d\u80fd\u5bfc\u5165\u90a3\u4e2a\u6a21\u5757\u201d\u3002\u5b83\u4eec\u7684\u8fd0\u884c\u65b9\u5f0f\u53ef\u4ee5\u5b8c\u5168\u4e00\u6837&#xff0c;\u90fd\u653e\u5728\u540c\u4e00\u4e2a\u6d4b\u8bd5\u76ee\u5f55\u3001\u7528\u540c\u4e00\u6761\u547d\u4ee4\u8dd1\u3002\u7ef4\u62a4\u6210\u672c\u4e5f\u4e0d\u9ad8&#xff0c;\u56e0\u4e3a\u5b83\u68c0\u67e5\u7684\u662f\u7ed3\u6784&#xff0c;\u4e1a\u52a1\u53d8\u5316\u65f6\u57fa\u672c\u4e0d\u7528\u6539&#xff1b;\u771f\u6b63\u9700\u8981\u6539\u7684\u662f\u7ed3\u6784\u8c03\u6574\u7684\u65f6\u5019&#xff0c;\u800c\u90a3\u65f6\u5019\u672c\u6765\u5c31\u8be5\u6709\u4eba\u91cd\u65b0\u770b\u4e00\u904d\u89c4\u5219\u3002<\/p>\n<p>\u95ee&#xff1a;\u8fd9\u6761\u68c0\u67e5\u4f1a\u4e0d\u4f1a\u592a\u4e25&#xff0c;\u6b63\u5e38\u6539\u52a8\u4e5f\u88ab\u62e6&#xff1f;<\/p>\n<p>\u5224\u65ad\u6807\u51c6\u662f\u8bef\u62a5\u7387\u3002\u5982\u679c\u4e00\u6761\u68c0\u67e5\u7ecf\u5e38\u8ba9\u6b63\u5e38\u6539\u52a8\u505c\u4e0b\u6765&#xff0c;\u8bf4\u660e\u5b83\u7ea6\u675f\u7684\u5bf9\u8c61\u592a\u5bbd\u6216\u8005\u4fe1\u53f7\u9009\u5f97\u4e0d\u597d&#xff0c;\u9700\u8981\u6536\u7a84&#xff0c;\u800c\u4e0d\u662f\u653e\u4efb\u5b83\u4e00\u76f4\u7ea2\u7740\u3002\u4e00\u4e2a\u53ef\u64cd\u4f5c\u7684\u68c0\u9a8c\u65b9\u6cd5&#xff1a;\u5728\u6700\u8fd1\u4e8c\u5341\u6b21\u6539\u52a8\u4e0a\u8dd1\u4e00\u904d\u8fd9\u6761\u68c0\u67e5&#xff0c;\u770b\u6709\u591a\u5c11\u6b21\u4f1a\u8ba9\u5408\u6cd5\u6539\u52a8\u5931\u8d25\u3002\u5982\u679c\u6709&#xff0c;\u5148\u4fee\u68c0\u67e5&#xff1b;\u5982\u679c\u6ca1\u6709&#xff0c;\u5c31\u628a\u5b83\u63a5\u8fdb\u95e8\u7981\u3002<\/p>\n<p>\u95ee&#xff1a;\u624b\u5199\u68c0\u67e5\u8fd8\u662f\u7528\u73b0\u6210\u5de5\u5177&#xff1f;<\/p>\n<p>\u5148\u7528\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u843d\u5730\u3002\u5982\u679c\u53ea\u6709\u4e00\u4e24\u6761\u4f9d\u8d56\u89c4\u5219&#xff0c;\u624b\u5199\u4e00\u6bb5\u8bed\u6cd5\u68c0\u67e5\u6216\u8005\u4e00\u6761\u641c\u7d22\u547d\u4ee4\u5c31\u591f\u4e86&#xff0c;\u96f6\u4f9d\u8d56\u3001\u62a5\u9519\u4fe1\u606f\u81ea\u5df1\u5199\u3002\u5f53\u89c4\u5219\u53d8\u591a\u3001\u5c42\u6b21\u5173\u7cfb\u53d8\u590d\u6742\u65f6&#xff0c;\u518d\u6362\u6210\u4e13\u95e8\u8868\u8fbe\u4f9d\u8d56\u5173\u7cfb\u7684\u5de5\u5177&#xff0c;\u4f8b\u5982 import-linter \u8fd9\u7c7b\u3002\u4e0d\u8981\u4e00\u4e0a\u6765\u5c31\u628a\u914d\u7f6e\u5199\u6210\u4e00\u5927\u5768&#xff0c;\u8bef\u62a5\u4f1a\u6d88\u8017\u56e2\u961f\u5bf9\u68c0\u67e5\u7684\u4fe1\u4efb\u3002<\/p>\n<p>\u95ee&#xff1a;\u68c0\u67e5\u5e94\u8be5\u653e\u5728\u54ea\u4e2a\u76ee\u5f55\u4e0b&#xff1f;<\/p>\n<p>\u653e\u5728\u6d4b\u8bd5\u76ee\u5f55\u91cc\u6700\u7701\u4e8b&#xff0c;\u56e0\u4e3a\u5b83\u548c\u529f\u80fd\u6d4b\u8bd5\u5171\u7528\u540c\u4e00\u5957\u8fd0\u884c\u65b9\u5f0f\u548c\u95e8\u7981\u3002\u6bd4\u5982 tests\/architecture\/\u3002\u8fd9\u6837\u505a\u8fd8\u6709\u4e00\u4e2a\u597d\u5904&#xff1a;\u4efb\u4f55\u4eba\u6253\u5f00\u6d4b\u8bd5\u76ee\u5f55\u5c31\u80fd\u770b\u5230\u9879\u76ee\u6709\u54ea\u4e9b\u7ed3\u6784\u7ea6\u5b9a&#xff0c;\u4e0d\u9700\u8981\u989d\u5916\u7ef4\u62a4\u4e00\u4efd\u201c\u67b6\u6784\u6587\u6863\u201d\u3002\u5982\u679c\u56e2\u961f\u66f4\u4e60\u60ef\u7528\u72ec\u7acb\u811a\u672c&#xff0c;\u653e\u5728 scripts\/ \u4e0b\u4e5f\u53ef\u4ee5&#xff0c;\u524d\u63d0\u662f\u5b83\u540c\u6837\u88ab\u95e8\u7981\u8c03\u7528\u3002<\/p>\n<p>\u95ee&#xff1a;\u6211\u7528\u7684\u662f\u522b\u7684\u8bed\u8a00&#xff0c;\u8fd9\u5957\u601d\u8def\u80fd\u7528\u5417&#xff1f;<\/p>\n<p>\u80fd&#xff0c;\u601d\u8def\u548c\u8bed\u8a00\u65e0\u5173\u3002\u9700\u8981\u66ff\u6362\u7684\u53ea\u662f\u8bfb\u53d6\u4ee3\u7801\u7ed3\u6784\u7684\u5de5\u5177&#xff1a;Java\u3001Go\u3001TypeScript\u3001C# \u90fd\u6709\u80fd\u5728\u4e0d\u8fd0\u884c\u7a0b\u5e8f\u7684\u60c5\u51b5\u4e0b\u5206\u6790\u5bfc\u5165\u6216\u5f15\u7528\u7684\u529e\u6cd5&#xff0c;\u5f88\u591a\u8bed\u8a00\u751f\u6001\u91cc\u4e5f\u6709\u4e13\u95e8\u7684\u4f9d\u8d56\u89c4\u5219\u68c0\u67e5\u5de5\u5177\u3002\u5224\u65ad\u6807\u51c6\u59cb\u7ec8\u662f\u540c\u4e24\u6761&#xff1a;\u4fe1\u53f7\u53ef\u5224\u5b9a\u3001\u8fdd\u89c4\u6709\u540e\u679c\u3002<\/p>\n<p>\u95ee&#xff1a;\u4f8b\u5916\u6761\u76ee\u8d8a\u6765\u8d8a\u591a\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u4f8b\u5916\u53d8\u591a\u901a\u5e38\u8bf4\u660e\u4e24\u4ef6\u4e8b\u4e4b\u4e00&#xff1a;\u89c4\u5219\u672c\u8eab\u9700\u8981\u8c03\u6574&#xff0c;\u6216\u8005\u9879\u76ee\u91cc\u786e\u5b9e\u51fa\u73b0\u4e86\u65b0\u7684\u5408\u7406\u7528\u6cd5\u3002\u5904\u7406\u65b9\u5f0f\u662f\u5b9a\u671f\u56de\u770b\u767d\u540d\u5355&#xff0c;\u770b\u6bcf\u6761\u4f8b\u5916\u7684\u64a4\u56de\u6761\u4ef6\u662f\u5426\u5df2\u7ecf\u6ee1\u8db3&#xff1b;\u5982\u679c\u67d0\u7c7b\u4f8b\u5916\u91cd\u590d\u51fa\u73b0\u4e09\u6b21\u4ee5\u4e0a&#xff0c;\u5c31\u5e94\u8be5\u628a\u5b83\u4ece\u4f8b\u5916\u5347\u7ea7\u6210\u89c4\u5219\u7684\u4e00\u90e8\u5206&#xff0c;\u800c\u4e0d\u662f\u7ee7\u7eed\u96f6\u6563\u5730\u52a0\u6761\u76ee\u3002<\/p>\n<p>\u95ee&#xff1a;\u65e2\u7136\u6709\u68c0\u67e5\u4e86&#xff0c;AGENTS.md \u91cc\u8fd8\u8981\u5199\u8fd9\u6761\u89c4\u5219\u5417&#xff1f;<\/p>\n<p>\u8981&#xff0c;\u4f46\u53ef\u4ee5\u5199\u5f97\u66f4\u77ed\u3002\u6587\u6863\u7684\u4f5c\u7528\u662f\u8ba9\u6267\u884c\u8005\u5728\u52a8\u624b\u4e4b\u524d\u5c31\u77e5\u9053\u8fb9\u754c&#xff0c;\u907f\u514d\u5148\u5199\u51fa\u4e00\u7248\u8fdd\u89c4\u5b9e\u73b0\u518d\u8fd4\u5de5\u3002\u4e00\u53e5\u8bdd\u5c31\u591f&#xff0c;\u6bd4\u5982\u201cservices \u5c42\u4e0d\u76f4\u63a5\u4f9d\u8d56 repositories \u5b9e\u73b0&#xff0c;\u5177\u4f53\u68c0\u67e5\u89c1 tests\/architecture\/test_layer_dependencies.py\u201d\u3002\u8fd9\u6837\u65e2\u7701\u4e86\u7bc7\u5e45&#xff0c;\u4e5f\u8ba9\u8bfb\u8005\u77e5\u9053\u53bb\u54ea\u513f\u770b\u7ec6\u8282\u3002<\/p>\n<p>\u95ee&#xff1a;\u56e2\u961f\u91cc\u6709\u4eba\u8bf4\u5199\u68c0\u67e5\u662f\u6d6a\u8d39\u65f6\u95f4&#xff0c;\u600e\u4e48\u56de\u5e94&#xff1f;<\/p>\n<p>\u7528\u4e00\u4e2a\u5177\u4f53\u6570\u5b57\u56de\u5e94\u4f1a\u6bd4\u8f83\u5bb9\u6613&#xff1a;\u628a\u6700\u8fd1\u4e00\u6b21\u540c\u7c7b\u8fdd\u89c4\u7684\u6392\u67e5\u65f6\u95f4\u7b97\u51fa\u6765&#xff0c;\u4ece\u53d1\u73b0\u5230\u5b9a\u4f4d\u5230\u4fee\u597d&#xff0c;\u7b97\u8fdb\u522b\u4eba\u88ab\u6253\u65ad\u7684\u65f6\u95f4\u3002\u7136\u540e\u518d\u5bf9\u6bd4\u5199\u8fd9\u6761\u68c0\u67e5\u9700\u8981\u7684\u65f6\u95f4&#xff0c;\u901a\u5e38\u6bd4\u6392\u67e5\u4e00\u6b21\u8fdd\u89c4\u4fbf\u5b9c\u5f97\u591a\u3002\u8fd9\u4e0d\u662f\u8981\u8bc1\u660e\u201c\u68c0\u67e5\u4e00\u5b9a\u5212\u7b97\u201d&#xff0c;\u800c\u662f\u628a\u8ba8\u8bba\u4ece\u6001\u5ea6\u6362\u6210\u65f6\u95f4\u8d26\u3002\u5982\u679c\u8fd9\u6761\u89c4\u5219\u51e0\u4e4e\u4e0d\u4f1a\u88ab\u8fdd\u53cd&#xff0c;\u90a3\u4e5f\u786e\u5b9e\u4e0d\u5fc5\u5199\u68c0\u67e5\u2014\u2014\u90a3\u5c31\u628a\u5b83\u4ece\u89c4\u5219\u91cc\u964d\u7ea7\u6210\u5efa\u8bae\u3002<\/p>\n<p>\u95ee&#xff1a;\u68c0\u67e5\u672c\u8eab\u5199\u9519\u4e86&#xff0c;\u628a\u5408\u6cd5\u4ee3\u7801\u5224\u6210\u8fdd\u89c4\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u8fd9\u662f\u6700\u5e38\u89c1\u7684\u7b2c\u4e00\u6b21\u7ffb\u8f66\u65b9\u5f0f&#xff0c;\u5904\u7406\u539f\u5219\u662f\u201c\u5148\u6539\u68c0\u67e5&#xff0c;\u518d\u5408\u4ee3\u7801\u201d\u3002\u5177\u4f53\u505a\u6cd5&#xff1a;\u5728\u68c0\u67e5\u91cc\u52a0\u4e00\u4e2a\u6700\u5c0f\u7684\u590d\u73b0\u7528\u4f8b&#xff0c;\u8bf4\u660e\u8fd9\u6b21\u4e3a\u4ec0\u4e48\u8bef\u62a5&#xff1b;\u4fee\u6539\u68c0\u67e5\u8ba9\u8fd9\u4e2a\u7528\u4f8b\u901a\u8fc7&#xff1b;\u91cd\u65b0\u5728\u5386\u53f2\u4ee3\u7801\u4e0a\u8dd1\u4e00\u904d&#xff0c;\u786e\u8ba4\u6ca1\u6709\u5f15\u5165\u65b0\u8bef\u62a5\u3002\u4e0d\u8981\u901a\u8fc7\u7ed9\u5408\u6cd5\u4ee3\u7801\u52a0\u4f8b\u5916\u6765\u7ed5\u5f00\u5b83&#xff0c;\u90a3\u6837\u4f60\u4f1a\u5931\u53bb\u5bf9\u767d\u540d\u5355\u7684\u4fe1\u4efb\u3002<\/p>\n<p>\u95ee&#xff1a;\u8fd9\u6761\u89c4\u5219\u5e94\u8be5\u53ea\u5199\u8fdb AGENTS.md&#xff0c;\u8fd8\u662f\u4e5f\u5199\u8fdb\u4efb\u52a1\u5355&#xff1f;<\/p>\n<p>\u4e24\u8005\u90fd\u53ef\u4ee5\u5199&#xff0c;\u4f46\u4f5c\u7528\u4e0d\u540c\u3002AGENTS.md \u91cc\u7684\u7248\u672c\u662f\u957f\u671f\u7ea6\u5b9a&#xff0c;\u544a\u8bc9\u4efb\u4f55\u4e00\u6b21\u4efb\u52a1\u201c\u8fd9\u4e2a\u9879\u76ee\u7684\u8fb9\u754c\u5728\u54ea\u91cc\u201d&#xff1b;\u4efb\u52a1\u5355\u91cc\u7684\u7248\u672c\u662f\u672c\u6b21\u5f3a\u8c03&#xff0c;\u9002\u5408\u90a3\u4e9b\u7279\u522b\u5bb9\u6613\u5728\u672c\u6b21\u6539\u52a8\u91cc\u88ab\u89e6\u78b0\u7684\u8fb9\u754c\u3002\u5982\u679c\u67d0\u6761\u89c4\u5219\u7ecf\u5e38\u9700\u8981\u5199\u8fdb\u4efb\u52a1\u5355&#xff0c;\u8bf4\u660e\u5b83\u53ef\u80fd\u7f3a\u5c11\u4e00\u6761\u68c0\u67e5&#xff0c;\u6216\u8005\u9879\u76ee\u91cc\u7f3a\u5c11\u4e00\u4e2a\u65b9\u4fbf\u7684\u6b63\u786e\u5165\u53e3\u3002<\/p>\n<p>\u95ee&#xff1a;\u89c4\u5219\u5f88\u591a\u7684\u9879\u76ee&#xff0c;\u600e\u4e48\u6392\u4f18\u5148\u7ea7&#xff1f;<\/p>\n<p>\u6309\u201c\u8fdd\u89c4\u4ee3\u4ef7 \u00d7 \u53ef\u5224\u5b9a\u6027 \u00d7 \u53d1\u751f\u9891\u7387\u201d\u6392\u5e8f&#xff0c;\u5148\u505a\u4e58\u79ef\u6700\u9ad8\u7684\u90a3\u4e00\u6761\u3002\u7ecf\u9a8c\u4e0a&#xff0c;\u8de8\u5c42\u4f9d\u8d56\u3001\u7ed5\u8fc7\u516c\u5171\u5165\u53e3\u3001\u624b\u5de5\u4fee\u6539\u751f\u6210\u6587\u4ef6\u8fd9\u4e09\u7c7b\u89c4\u5219\u6392\u5f97\u6bd4\u8f83\u9760\u524d&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u4e00\u65e6\u88ab\u8fdd\u53cd&#xff0c;\u4f1a\u6301\u7eed\u5438\u5f15\u66f4\u591a\u8fdd\u89c4&#xff0c;\u800c\u4e14\u90fd\u80fd\u88ab\u9759\u6001\u5224\u5b9a\u3002\u98ce\u683c\u7c7b\u89c4\u5219\u901a\u5e38\u6392\u5f97\u5f88\u9760\u540e&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u65e2\u4e0d\u5e38\u88ab\u8fdd\u53cd&#xff0c;\u8fdd\u53cd\u7684\u4ee3\u4ef7\u4e5f\u5c0f\u3002<\/p>\n<p>\u95ee&#xff1a;\u4e00\u6761\u68c0\u67e5\u5199\u5b8c\u4e4b\u540e&#xff0c;\u591a\u4e45\u9700\u8981\u56de\u5934\u770b\u770b\u5b83&#xff1f;<\/p>\n<p>\u7ed9\u5b83\u4e00\u4e2a\u56fa\u5b9a\u7684\u590d\u67e5\u70b9&#xff0c;\u6bd4\u5982\u6bcf\u5b63\u5ea6&#xff0c;\u6216\u8005\u6bcf\u6b21\u7ed3\u6784\u8c03\u6574\u4e4b\u540e\u3002\u590d\u67e5\u4e09\u4ef6\u4e8b&#xff1a;\u5b83\u8fd8\u5728 CI \u91cc\u8dd1\u5417&#xff1f;\u5b83\u7684\u4f8b\u5916\u6761\u76ee\u6709\u6ca1\u6709\u53ef\u4ee5\u5220\u6389\u7684&#xff1f;\u5b83\u7684\u89c4\u5219\u8868\u8ff0\u548c\u68c0\u67e5\u5b9e\u73b0\u8fd8\u6709\u6ca1\u6709\u4e00\u81f4&#xff1f;\u8fd9\u4e09\u4ef6\u4e8b\u90fd\u4e0d\u9700\u8981\u5f88\u957f\u65f6\u95f4&#xff0c;\u4f46\u5982\u679c\u4e0d\u505a&#xff0c;\u68c0\u67e5\u4f1a\u6162\u6162\u53d8\u6210\u6446\u8bbe\u2014\u2014\u6700\u5e38\u89c1\u7684\u5f62\u5f0f\u662f\u5b83\u8fd8\u5728\u8dd1&#xff0c;\u53ea\u662f\u6ca1\u4eba\u518d\u770b\u5b83\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u95ee&#xff1a;\u6587\u6863\u548c\u68c0\u67e5\u4f1a\u4e0d\u4f1a\u4e92\u76f8\u91cd\u590d&#xff0c;\u9020\u6210\u7ef4\u62a4\u8d1f\u62c5&#xff1f;<\/p>\n<p>\u4f1a\u6709\u4e00\u70b9\u91cd\u590d&#xff0c;\u4f46\u8fd9\u4e00\u4efd\u91cd\u590d\u503c\u5f97\u7559\u3002\u6587\u6863\u90a3\u4e00\u4efd\u662f\u7ed9\u4eba\u5728\u52a8\u624b\u4e4b\u524d\u770b\u7684&#xff0c;\u68c0\u67e5\u90a3\u4e00\u4efd\u662f\u7ed9\u673a\u5668\u5728\u52a8\u624b\u4e4b\u540e\u7528\u7684\u3002\u4e3a\u4e86\u907f\u514d\u4e24\u8fb9\u8d8a\u5199\u8d8a\u8fdc&#xff0c;\u53ef\u4ee5\u8ba9\u6587\u6863\u91cc\u7684\u5b57\u6570\u5c11\u4e8e\u68c0\u67e5\u91cc\u7684\u4fe1\u606f&#xff1a;\u6587\u6863\u5199\u201c\u4e00\u53e5\u8bdd &#043; \u68c0\u67e5\u6587\u4ef6\u8def\u5f84\u201d&#xff0c;\u7ec6\u8282\u5168\u653e\u68c0\u67e5\u3002\u8fd9\u6837\u66f4\u65b0\u65f6\u4e3b\u8981\u6539\u68c0\u67e5&#xff0c;\u6587\u6863\u91cc\u90a3\u53e5\u8bdd\u8bf4\u6e05\u53bb\u5411\u5c31\u884c\u3002\u771f\u6b63\u9700\u8981\u907f\u514d\u7684\u662f\u4e24\u4efd\u5404\u81ea\u7ef4\u62a4\u4e00\u5927\u6bb5\u7ec6\u8282&#xff0c;\u90a3\u79cd\u60c5\u51b5\u4e0b\u51e0\u4e4e\u4e00\u5b9a\u4f1a\u5206\u53c9\u3002<\/p>\n<h3>\u516b\u3001\u52a8\u624b\u7ec3\u4e60\u4e0e\u5c0f\u7ed3<\/h3>\n<p>\u8fd9\u6b21\u7684\u7ec3\u4e60\u4ea7\u51fa\u662f\u4e00\u4e2a\u201c\u89c4\u5219\u8f6c\u68c0\u67e5\u201d\u7684\u5bf9\u7167\u8868&#xff0c;\u52a0\u4e0a\u4e00\u6761\u771f\u6b63\u80fd\u8dd1\u7684\u68c0\u67e5\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u4ece\u4f60\u9879\u76ee\u91cc\u6311\u4e09\u6761\u6587\u5b57\u89c4\u5219&#xff0c;\u6309\u4e0b\u9762\u7684\u6a21\u677f\u586b\u4e00\u904d&#xff1a;<\/p>\n<p>\u89c4\u5219 1&#xff1a;________________________________<br \/>\n  \u53ef\u5224\u5b9a\u4fe1\u53f7&#xff1a;______________  \u68c0\u67e5\u65b9\u5f0f&#xff1a;______________<br \/>\n\u89c4\u5219 2&#xff1a;________________________________<br \/>\n  \u53ef\u5224\u5b9a\u4fe1\u53f7&#xff1a;______________  \u68c0\u67e5\u65b9\u5f0f&#xff1a;______________<br \/>\n\u89c4\u5219 3&#xff1a;________________________________<br \/>\n  \u53ef\u5224\u5b9a\u4fe1\u53f7&#xff1a;______________  \u68c0\u67e5\u65b9\u5f0f&#xff1a;______________<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff0c;\u4ece\u4e09\u6761\u91cc\u9009\u4fe1\u53f7\u6700\u660e\u786e\u7684\u90a3\u4e00\u6761&#xff0c;\u628a\u5b83\u5199\u6210\u4e00\u6761\u771f\u7684\u80fd\u8dd1\u7684\u68c0\u67e5\u3002\u53ef\u4ee5\u662f\u6d4b\u8bd5&#xff0c;\u53ef\u4ee5\u662f\u4e00\u6bb5\u811a\u672c&#xff0c;\u4e5f\u53ef\u4ee5\u662f\u4e00\u6761\u641c\u7d22\u547d\u4ee4&#xff0c;\u53ea\u8981\u5b83\u80fd\u5728\u8fdd\u89c4\u65f6\u4ee5\u975e 0 \u9000\u51fa\u7801\u5931\u8d25\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff0c;\u505a\u4e24\u6b21\u9a8c\u8bc1&#xff1a;\u5728\u5f53\u524d\u7684\u8fdd\u89c4\u4ee3\u7801\u4e0a\u8dd1&#xff08;\u5982\u679c\u6709&#xff09;&#xff0c;\u786e\u8ba4\u5b83\u4f1a\u7ea2&#xff1b;\u4fee\u597d\u4e4b\u540e\u8dd1&#xff0c;\u786e\u8ba4\u5b83\u4f1a\u7eff\u3002\u4e24\u6b21\u90fd\u505a\u5b8c&#xff0c;\u8fd9\u6761\u89c4\u5219\u624d\u7b97\u4ece\u6587\u5b57\u53d8\u6210\u4e86\u786c\u7ea6\u675f\u3002<\/p>\n<p>\u81ea\u68c0\u65f6\u95ee\u56db\u4e2a\u95ee\u9898&#xff1a;\u8fd9\u6761\u89c4\u5219\u7684\u9002\u7528\u8303\u56f4\u5199\u6e05\u4e86\u5417&#xff1f;\u8fdd\u89c4\u65f6\u7ed9\u51fa\u7684\u4fe1\u606f\u91cc\u6709\u4f4d\u7f6e\u548c\u66ff\u4ee3\u505a\u6cd5\u5417&#xff1f;\u8fd9\u6761\u68c0\u67e5\u5728 CI \u91cc\u662f\u5fc5\u987b\u901a\u8fc7\u7684\u5417&#xff1f;\u4f8b\u5916\u6709\u6ca1\u6709\u64a4\u56de\u6761\u4ef6&#xff1f;\u56db\u4e2a\u95ee\u9898\u90fd\u80fd\u56de\u7b54&#xff0c;\u8fd9\u6761\u89c4\u5219\u5c31\u7ad9\u5f97\u4f4f\u4e86\u3002<\/p>\n<p>\u518d\u8865\u4e00\u4e2a\u66f4\u5b9e\u9645\u7684\u9a8c\u6536\u52a8\u4f5c&#xff1a;\u628a\u8fd9\u6761\u68c0\u67e5\u62ff\u7ed9\u4e00\u4e2a\u6ca1\u53c2\u4e0e\u7684\u4eba&#xff08;\u6216\u8005\u53e6\u4e00\u4e2a Agent&#xff09;\u770b&#xff0c;\u53ea\u7ed9\u5b83\u8fd9\u6761\u68c0\u67e5\u7684\u62a5\u9519\u4fe1\u606f&#xff0c;\u8ba9\u5b83\u8bf4\u51fa\u201c\u5e94\u8be5\u600e\u4e48\u6539\u201d\u3002\u5982\u679c\u5b83\u80fd\u8bf4\u5bf9&#xff0c;\u8bf4\u660e\u4f60\u7684\u9519\u8bef\u4fe1\u606f\u5728\u627f\u62c5\u89c4\u5219\u8bf4\u660e\u4e66\u7684\u89d2\u8272&#xff1b;\u5982\u679c\u5b83\u8bf4\u7684\u662f\u201c\u6211\u77e5\u9053\u4e86\u201d&#xff0c;\u4f46\u52a8\u624b\u65b9\u5411\u4e0d\u5bf9&#xff0c;\u8bf4\u660e\u9519\u8bef\u4fe1\u606f\u91cc\u7f3a\u4e86\u66ff\u4ee3\u505a\u6cd5\u90a3\u4e00\u6bb5\u3002<\/p>\n<p>\u56de\u5230\u5f00\u5934\u90a3\u4e2a\u4e8b\u52a1\u9700\u6c42\u3002\u5982\u679c\u5f53\u65f6\u5b58\u5728\u4e00\u6761\u67b6\u6784\u68c0\u67e5&#xff0c;Agent \u7b2c\u4e00\u6b21\u5c1d\u8bd5\u5bfc\u5165\u4f1a\u8bdd\u5de5\u5382\u65f6\u5c31\u4f1a\u6536\u5230\u4e00\u6761\u660e\u786e\u7684\u5931\u8d25\u4fe1\u606f&#xff0c;\u91cc\u9762\u5199\u7740\u5e94\u8be5\u6539\u7528\u4ed3\u5e93\u63a5\u53e3\u63d0\u4f9b\u7684\u80fd\u529b\u3002\u5b83\u4e0d\u9700\u8981\u80cc\u4e0b\u89c4\u5219&#xff0c;\u4e5f\u4e0d\u4f1a\u5728\u4e09\u4e2a\u6708\u540e\u53d1\u73b0\u89c4\u5219\u662f\u4e00\u53e5\u7a7a\u8bdd\u3002\u89c4\u5219\u7684\u610f\u4e49\u4ece\u6765\u4e0d\u5728\u6587\u4ef6\u91cc&#xff0c;\u800c\u5728\u5b83\u88ab\u8fdd\u53cd\u7684\u90a3\u4e00\u523b\u6709\u6ca1\u6709\u4e1c\u897f\u53d1\u751f\u3002<\/p>\n<p>\u6709\u4e00\u53e5\u8bdd\u503c\u5f97\u8bb0\u4e0b\u6765&#xff1a;\u8f6f\u7ea6\u675f\u8d1f\u8d23\u8ba9\u6b63\u786e\u7684\u4e8b\u66f4\u5bb9\u6613\u53d1\u751f&#xff0c;\u786c\u7ea6\u675f\u8d1f\u8d23\u8ba9\u9519\u8bef\u7684\u4e8b\u65e0\u6cd5\u5b8c\u6210\u3002\u4e24\u53e5\u8bdd\u90fd\u5f88\u91cd\u8981&#xff0c;\u4f46\u5982\u679c\u4f60\u53ea\u80fd\u5148\u505a\u4e00\u4ef6&#xff0c;\u5148\u505a\u540e\u9762\u90a3\u4ef6&#xff0c;\u56e0\u4e3a\u5b83\u66f4\u786e\u5b9a\u3002\u786e\u5b9a\u4e86\u8fb9\u754c\u4e4b\u540e&#xff0c;\u518d\u56de\u5934\u628a\u6587\u6863\u5199\u77ed\u3001\u5199\u51c6&#xff0c;\u6548\u679c\u4f1a\u6bd4\u4e00\u5f00\u59cb\u5c31\u628a\u89c4\u5219\u5217\u6210\u957f\u6e05\u5355\u597d\u5f97\u591a\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u4f1a\u63a5\u7740\u8fd9\u4e2a\u95ee\u9898\u5f80\u4e0b\u8d70\u4e00\u6b65&#xff1a;\u540c\u4e00\u4e2a\u56e2\u961f\u91cc&#xff0c;\u6709\u4e9b\u9519\u8bef\u786e\u5b9e\u53ea\u80fd\u9760\u201c\u63d0\u524d\u8bf4\u6e05\u201d\u6765\u51cf\u5c11&#xff0c;\u6709\u4e9b\u9519\u8bef\u53ea\u80fd\u9760\u201c\u4e8b\u540e\u68c0\u67e5\u201d\u6765\u53d1\u73b0\u3002\u5206\u6e05\u8fd9\u4e24\u79cd\u60c5\u51b5&#xff0c;\u4f60\u624d\u77e5\u9053\u8be5\u8865\u6587\u6863\u8fd8\u662f\u8be5\u8865\u95e8\u7981\u3002<\/p>\n<p>\u8fd9\u4e00\u7bc7\u8bb2\u7684\u662f\u628a\u6587\u5b57\u53d8\u6210\u68c0\u67e5\u3002\u4e0b\u4e00\u7bc7\u8981\u5904\u7406\u4e00\u4e2a\u76f8\u8fd1\u4f46\u65b9\u5411\u76f8\u53cd\u7684\u95ee\u9898&#xff1a;\u6709\u4e9b\u9519\u8bef\u5e94\u8be5\u5c3d\u91cf\u5728\u53d1\u751f\u4e4b\u524d\u5c31\u51cf\u5c11&#xff0c;\u6709\u4e9b\u9519\u8bef\u53ea\u80fd\u5728\u53d1\u751f\u4e4b\u540e\u88ab\u8bc6\u522b&#xff0c;\u8fd9\u4e24\u79cd\u63a7\u5236\u7684\u533a\u522b\u51b3\u5b9a\u4e86\u4f60\u5e94\u8be5\u8865\u6587\u6863\u8fd8\u662f\u8865\u95e8\u7981\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4e00\u6761\u5199\u5728\u6587\u4ef6\u7b2c\u4e00\u884c\u7684\u89c4\u5219&#xff0c;\u4e09\u4e2a\u6708\u540e\u88ab\u8fdd\u53cd\u4e86<br \/>\n\u8fd8\u662f shop \u8ba2\u5355\u670d\u52a1\u3002\u9879\u76ee\u5f00\u5de5\u90a3\u5929&#xff0c;\u4f60\u4eec\u5728 AGENTS.md \u7684\u201c\u4ec0\u4e48\u4e0d\u80fd\u505a\u201d\u4e00\u8282\u5199\u4e0b\u7b2c\u4e00\u6761\u89c4\u5219&#xff1a;<br \/>\n&#8211; \u4e0d\u5141\u8bb8 domain \u5c42\u548c services \u5c42\u76f4\u63a5\u4f9d\u8d56\u6570\u636e\u5e93\u9a71\u52a8\u6216 repositories \u7684\u5b9e\u73b0\u7ec6\u8282\u8fd9\u6761\u89c4\u5219\u4e00\u76f4\u6709\u6548\u3002\u5b83\u5199\u5728\u9879\u76ee\u6839\u76ee\u5f55&#xff0c;\u4efb\u4f55\u4e00\u6b21\u4efb\u52a1\u5f00\u59cb\u524d&#xff0c;Agent \u90fd\u4f1a\u8bfb\u5230\u5b83\u3002\u4e09\u4e2a\u6708\u91cc&#xff0c;\u5927\u5927\u5c0f\u5c0f\u7684\u6539\u52a8\u90fd\u9075\u5b88\u4e86\u8fd9\u6761\u7ea6\u5b9a&amp;#xff0<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11653,50,323,207,427],"topic":[],"class_list":["post-110691","post","type-post","status-publish","format-standard","hentry","category-server","tag-11653","tag-50","tag-323","tag-207","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/110691.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4e00\u6761\u5199\u5728\u6587\u4ef6\u7b2c\u4e00\u884c\u7684\u89c4\u5219&#xff0c;\u4e09\u4e2a\u6708\u540e\u88ab\u8fdd\u53cd\u4e86 \u8fd8\u662f shop \u8ba2\u5355\u670d\u52a1\u3002\u9879\u76ee\u5f00\u5de5\u90a3\u5929&#xff0c;\u4f60\u4eec\u5728 AGENTS.md \u7684\u201c\u4ec0\u4e48\u4e0d\u80fd\u505a\u201d\u4e00\u8282\u5199\u4e0b\u7b2c\u4e00\u6761\u89c4\u5219&#xff1a; - \u4e0d\u5141\u8bb8 domain \u5c42\u548c services \u5c42\u76f4\u63a5\u4f9d\u8d56\u6570\u636e\u5e93\u9a71\u52a8\u6216 repositories \u7684\u5b9e\u73b0\u7ec6\u8282\u8fd9\u6761\u89c4\u5219\u4e00\u76f4\u6709\u6548\u3002\u5b83\u5199\u5728\u9879\u76ee\u6839\u76ee\u5f55&#xff0c;\u4efb\u4f55\u4e00\u6b21\u4efb\u52a1\u5f00\u59cb\u524d&#xff0c;Agent \u90fd\u4f1a\u8bfb\u5230\u5b83\u3002\u4e09\u4e2a\u6708\u91cc&#xff0c;\u5927\u5927\u5c0f\u5c0f\u7684\u6539\u52a8\u90fd\u9075\u5b88\u4e86\u8fd9\u6761\u7ea6\u5b9a&amp;#xff0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/110691.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-29T00:32:44+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110691.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/110691.html\",\"name\":\"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-29T00:32:44+00:00\",\"dateModified\":\"2026-09-29T00:32:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/110691.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/110691.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110691.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/110691.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4e00\u6761\u5199\u5728\u6587\u4ef6\u7b2c\u4e00\u884c\u7684\u89c4\u5219&#xff0c;\u4e09\u4e2a\u6708\u540e\u88ab\u8fdd\u53cd\u4e86 \u8fd8\u662f shop \u8ba2\u5355\u670d\u52a1\u3002\u9879\u76ee\u5f00\u5de5\u90a3\u5929&#xff0c;\u4f60\u4eec\u5728 AGENTS.md \u7684\u201c\u4ec0\u4e48\u4e0d\u80fd\u505a\u201d\u4e00\u8282\u5199\u4e0b\u7b2c\u4e00\u6761\u89c4\u5219&#xff1a; - \u4e0d\u5141\u8bb8 domain \u5c42\u548c services \u5c42\u76f4\u63a5\u4f9d\u8d56\u6570\u636e\u5e93\u9a71\u52a8\u6216 repositories \u7684\u5b9e\u73b0\u7ec6\u8282\u8fd9\u6761\u89c4\u5219\u4e00\u76f4\u6709\u6548\u3002\u5b83\u5199\u5728\u9879\u76ee\u6839\u76ee\u5f55&#xff0c;\u4efb\u4f55\u4e00\u6b21\u4efb\u52a1\u5f00\u59cb\u524d&#xff0c;Agent \u90fd\u4f1a\u8bfb\u5230\u5b83\u3002\u4e09\u4e2a\u6708\u91cc&#xff0c;\u5927\u5927\u5c0f\u5c0f\u7684\u6539\u52a8\u90fd\u9075\u5b88\u4e86\u8fd9\u6761\u7ea6\u5b9a&amp;#xff0","og_url":"https:\/\/www.wsisp.com\/helps\/110691.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-29T00:32:44+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/110691.html","url":"https:\/\/www.wsisp.com\/helps\/110691.html","name":"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-29T00:32:44+00:00","dateModified":"2026-09-29T00:32:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/110691.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/110691.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/110691.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8f6f\u7ea6\u675f\u4e0e\u786c\u7ea6\u675f\uff1aAGENTS.md \u5199\u4e86\u201c\u7981\u6b62\u8de8\u5c42\u8c03\u7528\u201d\uff0c\u591f\u5417\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=110691"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110691\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=110691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=110691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=110691"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=110691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}