[{"data":1,"prerenderedAt":4761},["ShallowReactive",2],{"article-/topics/ai/ai-agent-policy-engine-rule-layering":3,"related-ai":1110,"content-query-SrtQD3tuB5":3877},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":12,"image":17,"imageQuery":18,"pexelsPhotoId":19,"pexelsUrl":20,"featured":6,"readingTime":21,"body":22,"_type":1104,"_id":1105,"_source":1106,"_file":1107,"_stem":1108,"_extension":1109},"/topics/ai/ai-agent-policy-engine-rule-layering","ai",false,"","AI agent Policy Engine 规则分层：权限、合规、风险和豁免如何在系统里表达","AI agent 的 policy 不能只写在 prompt 里。本文讲清权限、合规、风险、豁免规则的分层设计、执行顺序、解释输出和审计要求。","2026-05-07","HTMLPAGE 团队",[13,14,15,16],"AI agent","Policy Engine","规则引擎","工程实践","/images/articles/ai-agent-policy-engine-rule-layering-featured.jpg","cybersecurity compliance planning laptop",19285776,"https://www.pexels.com/photo/a-man-sitting-in-the-dark-19285776/",20,{"type":23,"children":24,"toc":1087},"root",[25,33,38,75,82,162,167,172,178,183,203,208,213,231,236,242,247,260,265,278,283,311,317,322,396,401,406,439,444,450,455,473,478,490,495,501,506,511,520,525,531,536,545,550,593,598,603,612,617,623,628,638,643,648,722,727,733,738,761,766,772,777,864,869,875,880,885,913,918,924,1041,1046,1051,1056],{"type":26,"tag":27,"props":28,"children":29},"element","p",{},[30],{"type":31,"value":32},"text","很多 AI agent 项目的规则都先写在 prompt 里：不要越权，不要泄露，不要做高风险动作。问题是，prompt 里的规则只对“新生成的意图”有影响，对系统执行、历史恢复、工具调用、人工审批和日志审计几乎没有约束力。",{"type":26,"tag":27,"props":34,"children":35},{},[36],{"type":31,"value":37},"一旦进入真实业务，规则必须从“语言提醒”升级为“系统可执行的 policy”。",{"type":26,"tag":27,"props":39,"children":40},{},[41,43,50,52,58,59,65,67,73],{"type":31,"value":42},"建议先配合 ",{"type":26,"tag":44,"props":45,"children":47},"a",{"href":46},"/topics/ai/ai-agent-security-permission-control",[48],{"type":31,"value":49},"AI Agent 安全与权限控制",{"type":31,"value":51},"、",{"type":26,"tag":44,"props":53,"children":55},{"href":54},"/topics/ai/ai-agent-data-redaction-privacy-practice",[56],{"type":31,"value":57},"AI agent 数据脱敏实践",{"type":31,"value":51},{"type":26,"tag":44,"props":60,"children":62},{"href":61},"/topics/ai/ai-agent-human-review-console-design",[63],{"type":31,"value":64},"AI agent 人工审批控制台设计",{"type":31,"value":66}," 和 ",{"type":26,"tag":44,"props":68,"children":70},{"href":69},"/topics/ai/ai-agent-incident-response-runbook",[71],{"type":31,"value":72},"AI Agent 事故响应手册",{"type":31,"value":74}," 一起看。",{"type":26,"tag":76,"props":77,"children":79},"h2",{"id":78},"先给结论policy-至少分-4-层",[80],{"type":31,"value":81},"先给结论：Policy 至少分 4 层",{"type":26,"tag":83,"props":84,"children":85},"table",{},[86,105],{"type":26,"tag":87,"props":88,"children":89},"thead",{},[90],{"type":26,"tag":91,"props":92,"children":93},"tr",{},[94,100],{"type":26,"tag":95,"props":96,"children":97},"th",{},[98],{"type":31,"value":99},"层级",{"type":26,"tag":95,"props":101,"children":102},{},[103],{"type":31,"value":104},"解决什么",{"type":26,"tag":106,"props":107,"children":108},"tbody",{},[109,123,136,149],{"type":26,"tag":91,"props":110,"children":111},{},[112,118],{"type":26,"tag":113,"props":114,"children":115},"td",{},[116],{"type":31,"value":117},"Permission",{"type":26,"tag":113,"props":119,"children":120},{},[121],{"type":31,"value":122},"当前用户或系统是否有资格做这件事",{"type":26,"tag":91,"props":124,"children":125},{},[126,131],{"type":26,"tag":113,"props":127,"children":128},{},[129],{"type":31,"value":130},"Compliance",{"type":26,"tag":113,"props":132,"children":133},{},[134],{"type":31,"value":135},"是否触发合规和数据限制",{"type":26,"tag":91,"props":137,"children":138},{},[139,144],{"type":26,"tag":113,"props":140,"children":141},{},[142],{"type":31,"value":143},"Risk",{"type":26,"tag":113,"props":145,"children":146},{},[147],{"type":31,"value":148},"这一步风险是否高到必须人工确认",{"type":26,"tag":91,"props":150,"children":151},{},[152,157],{"type":26,"tag":113,"props":153,"children":154},{},[155],{"type":31,"value":156},"Exception",{"type":26,"tag":113,"props":158,"children":159},{},[160],{"type":31,"value":161},"是否存在有记录的豁免或特例",{"type":26,"tag":27,"props":163,"children":164},{},[165],{"type":31,"value":166},"把这些规则混成一句“谨慎处理”，最后只会让模型背锅。",{"type":26,"tag":27,"props":168,"children":169},{},[170],{"type":31,"value":171},"再进一步，真正可落地的 policy engine 不只是“把规则拆成四层”，还要解决三件事：规则从哪里来、谁能改、线上如何解释和回滚。没有治理面，规则层次再清楚，也会在几次迭代后变得不可控。",{"type":26,"tag":76,"props":173,"children":175},{"id":174},"一permission-规则先判断能不能做",[176],{"type":31,"value":177},"一、Permission 规则先判断“能不能做”",{"type":26,"tag":27,"props":179,"children":180},{},[181],{"type":31,"value":182},"Permission 层主要回答：",{"type":26,"tag":184,"props":185,"children":186},"ul",{},[187,193,198],{"type":26,"tag":188,"props":189,"children":190},"li",{},[191],{"type":31,"value":192},"当前用户是否能读这份资料",{"type":26,"tag":188,"props":194,"children":195},{},[196],{"type":31,"value":197},"当前 agent 是否能调用这个工具",{"type":26,"tag":188,"props":199,"children":200},{},[201],{"type":31,"value":202},"当前环境是否允许写入这个系统",{"type":26,"tag":27,"props":204,"children":205},{},[206],{"type":31,"value":207},"这是最适合做成硬阻断的一层。如果 permission 不通过，后面的 risk 和 compliance 根本没必要继续算。",{"type":26,"tag":27,"props":209,"children":210},{},[211],{"type":31,"value":212},"Permission 层最怕的是来源分散。用户权限、agent 工具权限、环境权限如果来自三套不同配置，最终很难解释“为什么这次被拒”。所以 permission 规则最好明确区分来源：",{"type":26,"tag":184,"props":214,"children":215},{},[216,221,226],{"type":26,"tag":188,"props":217,"children":218},{},[219],{"type":31,"value":220},"身份权限：当前用户或服务账号能做什么",{"type":26,"tag":188,"props":222,"children":223},{},[224],{"type":31,"value":225},"工具权限：当前 agent/toolset 是否允许这个动作",{"type":26,"tag":188,"props":227,"children":228},{},[229],{"type":31,"value":230},"环境权限：当前环境是否允许写外部系统",{"type":26,"tag":27,"props":232,"children":233},{},[234],{"type":31,"value":235},"这样 policy 输出时，才能准确告诉系统是哪一层没过。",{"type":26,"tag":76,"props":237,"children":239},{"id":238},"二compliance-规则判断即使有权限是否也不该这样做",[240],{"type":31,"value":241},"二、Compliance 规则判断“即使有权限，是否也不该这样做”",{"type":26,"tag":27,"props":243,"children":244},{},[245],{"type":31,"value":246},"很多团队把 permission 和 compliance 混在一起。区别在于：",{"type":26,"tag":184,"props":248,"children":249},{},[250,255],{"type":26,"tag":188,"props":251,"children":252},{},[253],{"type":31,"value":254},"permission 是“有没有资格”",{"type":26,"tag":188,"props":256,"children":257},{},[258],{"type":31,"value":259},"compliance 是“是否满足额外限制”",{"type":26,"tag":27,"props":261,"children":262},{},[263],{"type":31,"value":264},"例如：",{"type":26,"tag":184,"props":266,"children":267},{},[268,273],{"type":26,"tag":188,"props":269,"children":270},{},[271],{"type":31,"value":272},"用户有权限看某条客户记录，但这条记录的某些字段不能进入模型上下文",{"type":26,"tag":188,"props":274,"children":275},{},[276],{"type":31,"value":277},"agent 有权限生成外发文案，但某些内容必须先通过合规检查",{"type":26,"tag":27,"props":279,"children":280},{},[281],{"type":31,"value":282},"compliance 不一定直接拒绝，也可能要求改走脱敏、摘要或人工复核路径。",{"type":26,"tag":27,"props":284,"children":285},{},[286,288,295,296,302,303,309],{"type":31,"value":287},"如果 compliance 规则会随地区、客户类型或数据等级变化，建议把规则上下文也做成显式输入，而不是散在业务代码里。例如：",{"type":26,"tag":289,"props":290,"children":292},"code",{"className":291},[],[293],{"type":31,"value":294},"region=cn",{"type":31,"value":51},{"type":26,"tag":289,"props":297,"children":299},{"className":298},[],[300],{"type":31,"value":301},"data_class=restricted",{"type":31,"value":51},{"type":26,"tag":289,"props":304,"children":306},{"className":305},[],[307],{"type":31,"value":308},"customer_tier=enterprise",{"type":31,"value":310},"。否则同一条 policy 很容易在不同入口表现不一致。",{"type":26,"tag":76,"props":312,"children":314},{"id":313},"三risk-规则判断需不需要升级处理",[315],{"type":31,"value":316},"三、Risk 规则判断“需不需要升级处理”",{"type":26,"tag":27,"props":318,"children":319},{},[320],{"type":31,"value":321},"不是所有风险都该直接阻断。很多时候更合适的是升级到人工或特殊流程。",{"type":26,"tag":83,"props":323,"children":324},{},[325,341],{"type":26,"tag":87,"props":326,"children":327},{},[328],{"type":26,"tag":91,"props":329,"children":330},{},[331,336],{"type":26,"tag":95,"props":332,"children":333},{},[334],{"type":31,"value":335},"风险级别",{"type":26,"tag":95,"props":337,"children":338},{},[339],{"type":31,"value":340},"常见动作",{"type":26,"tag":106,"props":342,"children":343},{},[344,357,370,383],{"type":26,"tag":91,"props":345,"children":346},{},[347,352],{"type":26,"tag":113,"props":348,"children":349},{},[350],{"type":31,"value":351},"low",{"type":26,"tag":113,"props":353,"children":354},{},[355],{"type":31,"value":356},"自动继续",{"type":26,"tag":91,"props":358,"children":359},{},[360,365],{"type":26,"tag":113,"props":361,"children":362},{},[363],{"type":31,"value":364},"medium",{"type":26,"tag":113,"props":366,"children":367},{},[368],{"type":31,"value":369},"记录并继续，必要时提示",{"type":26,"tag":91,"props":371,"children":372},{},[373,378],{"type":26,"tag":113,"props":374,"children":375},{},[376],{"type":31,"value":377},"high",{"type":26,"tag":113,"props":379,"children":380},{},[381],{"type":31,"value":382},"进入人工确认",{"type":26,"tag":91,"props":384,"children":385},{},[386,391],{"type":26,"tag":113,"props":387,"children":388},{},[389],{"type":31,"value":390},"critical",{"type":26,"tag":113,"props":392,"children":393},{},[394],{"type":31,"value":395},"直接阻断",{"type":26,"tag":27,"props":397,"children":398},{},[399],{"type":31,"value":400},"Risk 层的重点不是“尽量不让 agent 做事”，而是给不同风险配置不同门槛。",{"type":26,"tag":27,"props":402,"children":403},{},[404],{"type":31,"value":405},"为了让 risk 真正可操作，建议把风险输出拆成两个部分：",{"type":26,"tag":184,"props":407,"children":408},{},[409,428],{"type":26,"tag":188,"props":410,"children":411},{},[412,418,420,426],{"type":26,"tag":289,"props":413,"children":415},{"className":414},[],[416],{"type":31,"value":417},"riskScore",{"type":31,"value":419}," 或 ",{"type":26,"tag":289,"props":421,"children":423},{"className":422},[],[424],{"type":31,"value":425},"riskLevel",{"type":31,"value":427},"：给决策引擎和报表使用",{"type":26,"tag":188,"props":429,"children":430},{},[431,437],{"type":26,"tag":289,"props":432,"children":434},{"className":433},[],[435],{"type":31,"value":436},"riskReasons[]",{"type":31,"value":438},"：给审批台和审计使用",{"type":26,"tag":27,"props":440,"children":441},{},[442],{"type":31,"value":443},"没有原因的风险等级，很难让人接受，也很难在误报时修正。",{"type":26,"tag":76,"props":445,"children":447},{"id":446},"四exception-规则必须显式记录而不是靠人临时放行",[448],{"type":31,"value":449},"四、Exception 规则必须显式记录，而不是靠人临时放行",{"type":26,"tag":27,"props":451,"children":452},{},[453],{"type":31,"value":454},"真实业务里总会出现特例：",{"type":26,"tag":184,"props":456,"children":457},{},[458,463,468],{"type":26,"tag":188,"props":459,"children":460},{},[461],{"type":31,"value":462},"某个项目临时允许某工具越过默认限制",{"type":26,"tag":188,"props":464,"children":465},{},[466],{"type":31,"value":467},"某类客户在特定时间段内允许加急流程",{"type":26,"tag":188,"props":469,"children":470},{},[471],{"type":31,"value":472},"某条规则在测试环境里临时放宽",{"type":26,"tag":27,"props":474,"children":475},{},[476],{"type":31,"value":477},"这些豁免如果只靠口头约定或本地配置，后面一定难以审计。Exception 至少要记录：",{"type":26,"tag":479,"props":480,"children":485},"pre",{"className":481,"code":483,"language":484,"meta":7},[482],"language-json","{\n  \"exceptionId\": \"ex_123\",\n  \"scope\": \"project_456\",\n  \"ruleId\": \"risk.external_send.requires_review\",\n  \"approvedBy\": \"ops_lead\",\n  \"expiresAt\": \"2026-05-10T00:00:00Z\",\n  \"reason\": \"活动期间临时放宽\"\n}\n","json",[486],{"type":26,"tag":289,"props":487,"children":488},{"__ignoreMap":7},[489],{"type":31,"value":483},{"type":26,"tag":27,"props":491,"children":492},{},[493],{"type":31,"value":494},"豁免规则最好永远是“加在显式规则之后的受控覆盖”，而不是直接把原规则删掉。否则系统最后只会留下一个结果，看不出到底是规则本身允许，还是有人临时放宽过。",{"type":26,"tag":76,"props":496,"children":498},{"id":497},"五规则版本和发布来源要可追踪",[499],{"type":31,"value":500},"五、规则版本和发布来源要可追踪",{"type":26,"tag":27,"props":502,"children":503},{},[504],{"type":31,"value":505},"当 policy 越来越多时，另一个关键问题会出现：线上这次决策，到底用了哪版规则集？如果查不出来，任何审计和回滚都会很痛苦。",{"type":26,"tag":27,"props":507,"children":508},{},[509],{"type":31,"value":510},"建议每次 policy 执行都至少带上：",{"type":26,"tag":479,"props":512,"children":515},{"className":513,"code":514,"language":484,"meta":7},[482],"{\n  \"policyBundleId\": \"bundle_2026_05_07_01\",\n  \"policyBundleVersion\": \"2026-05-07.1\",\n  \"ruleSource\": \"central_registry\",\n  \"environment\": \"prod\"\n}\n",[516],{"type":26,"tag":289,"props":517,"children":518},{"__ignoreMap":7},[519],{"type":31,"value":514},{"type":26,"tag":27,"props":521,"children":522},{},[523],{"type":31,"value":524},"这样当规则误拦截或漏拦截时，团队能快速定位是某次 bundle 发布的问题，而不是笼统地说“policy 最近变了”。",{"type":26,"tag":76,"props":526,"children":528},{"id":527},"六policy-engine-输出要能被系统消费不只是显示给人看",[529],{"type":31,"value":530},"六、Policy Engine 输出要能被系统消费，不只是显示给人看",{"type":26,"tag":27,"props":532,"children":533},{},[534],{"type":31,"value":535},"一个可执行的 policy 结果至少要包含：",{"type":26,"tag":479,"props":537,"children":540},{"className":538,"code":539,"language":484,"meta":7},[482],"{\n  \"allowed\": false,\n  \"decision\": \"human_review\",\n  \"matchedRules\": [\n    \"permission.tool.send_email.denied\",\n    \"risk.external_send.high\"\n  ],\n  \"userMessage\": \"当前动作需要更高权限或人工确认。\",\n  \"auditCode\": \"POLICY_REVIEW_REQUIRED\"\n}\n",[541],{"type":26,"tag":289,"props":542,"children":543},{"__ignoreMap":7},[544],{"type":31,"value":539},{"type":26,"tag":27,"props":546,"children":547},{},[548],{"type":31,"value":549},"其中：",{"type":26,"tag":184,"props":551,"children":552},{},[553,564,575],{"type":26,"tag":188,"props":554,"children":555},{},[556,562],{"type":26,"tag":289,"props":557,"children":559},{"className":558},[],[560],{"type":31,"value":561},"decision",{"type":31,"value":563}," 给工作流引擎用",{"type":26,"tag":188,"props":565,"children":566},{},[567,573],{"type":26,"tag":289,"props":568,"children":570},{"className":569},[],[571],{"type":31,"value":572},"userMessage",{"type":31,"value":574}," 给前端或运营用",{"type":26,"tag":188,"props":576,"children":577},{},[578,584,585,591],{"type":26,"tag":289,"props":579,"children":581},{"className":580},[],[582],{"type":31,"value":583},"matchedRules",{"type":31,"value":66},{"type":26,"tag":289,"props":586,"children":588},{"className":587},[],[589],{"type":31,"value":590},"auditCode",{"type":31,"value":592}," 给审计和排查用",{"type":26,"tag":27,"props":594,"children":595},{},[596],{"type":31,"value":597},"如果 policy 结果只是一段人类可读文本，系统仍然无法稳定执行。",{"type":26,"tag":27,"props":599,"children":600},{},[601],{"type":31,"value":602},"如果这套结果还要进入人工审批台，建议再补一个 explanation packet：",{"type":26,"tag":479,"props":604,"children":607},{"className":605,"code":606,"language":484,"meta":7},[482],"{\n  \"decision\": \"human_review\",\n  \"matchedRules\": [\"risk.external_send.high\"],\n  \"primaryReason\": \"external send with high impact\",\n  \"recommendedActions\": [\"approve\", \"reject\", \"edit_and_resume\"]\n}\n",[608],{"type":26,"tag":289,"props":609,"children":610},{"__ignoreMap":7},[611],{"type":31,"value":606},{"type":26,"tag":27,"props":613,"children":614},{},[615],{"type":31,"value":616},"这会比单纯展示规则 id 更适合给人快速理解。",{"type":26,"tag":76,"props":618,"children":620},{"id":619},"七规则执行顺序很重要",[621],{"type":31,"value":622},"七、规则执行顺序很重要",{"type":26,"tag":27,"props":624,"children":625},{},[626],{"type":31,"value":627},"一个常见顺序是：",{"type":26,"tag":479,"props":629,"children":633},{"className":630,"code":632,"language":31,"meta":7},[631],"language-text","permission -> compliance -> risk -> exception merge -> final decision\n",[634],{"type":26,"tag":289,"props":635,"children":636},{"__ignoreMap":7},[637],{"type":31,"value":632},{"type":26,"tag":27,"props":639,"children":640},{},[641],{"type":31,"value":642},"不要一开始就先跑 risk 分析，再发现其实这个动作根本没权限。顺序错了，不仅浪费成本，还会让决策解释变得混乱。",{"type":26,"tag":27,"props":644,"children":645},{},[646],{"type":31,"value":647},"同时要先定义“谁有最终优先级”。一个可执行的优先级原则通常类似这样：",{"type":26,"tag":83,"props":649,"children":650},{},[651,667],{"type":26,"tag":87,"props":652,"children":653},{},[654],{"type":26,"tag":91,"props":655,"children":656},{},[657,662],{"type":26,"tag":95,"props":658,"children":659},{},[660],{"type":31,"value":661},"条件",{"type":26,"tag":95,"props":663,"children":664},{},[665],{"type":31,"value":666},"结果",{"type":26,"tag":106,"props":668,"children":669},{},[670,683,696,709],{"type":26,"tag":91,"props":671,"children":672},{},[673,678],{"type":26,"tag":113,"props":674,"children":675},{},[676],{"type":31,"value":677},"permission deny",{"type":26,"tag":113,"props":679,"children":680},{},[681],{"type":31,"value":682},"直接 deny",{"type":26,"tag":91,"props":684,"children":685},{},[686,691],{"type":26,"tag":113,"props":687,"children":688},{},[689],{"type":31,"value":690},"compliance require_redaction",{"type":26,"tag":113,"props":692,"children":693},{},[694],{"type":31,"value":695},"改写输入后重新评估",{"type":26,"tag":91,"props":697,"children":698},{},[699,704],{"type":26,"tag":113,"props":700,"children":701},{},[702],{"type":31,"value":703},"risk high",{"type":26,"tag":113,"props":705,"children":706},{},[707],{"type":31,"value":708},"human_review",{"type":26,"tag":91,"props":710,"children":711},{},[712,717],{"type":26,"tag":113,"props":713,"children":714},{},[715],{"type":31,"value":716},"exception approved",{"type":26,"tag":113,"props":718,"children":719},{},[720],{"type":31,"value":721},"在规定范围内覆盖前面结果",{"type":26,"tag":27,"props":723,"children":724},{},[725],{"type":31,"value":726},"重点不是规则写成哪种 DSL，而是同一动作在多条规则命中时，系统必须给出唯一且可解释的结论。",{"type":26,"tag":76,"props":728,"children":730},{"id":729},"八规则变更必须进回归不要只测一两个-happy-path",[731],{"type":31,"value":732},"八、规则变更必须进回归，不要只测一两个 happy path",{"type":26,"tag":27,"props":734,"children":735},{},[736],{"type":31,"value":737},"Policy engine 很容易在一次看似无害的规则调整后，把别的场景一起带坏。建议至少保留这几类回归样本：",{"type":26,"tag":184,"props":739,"children":740},{},[741,746,751,756],{"type":26,"tag":188,"props":742,"children":743},{},[744],{"type":31,"value":745},"permission deny 的硬阻断样本",{"type":26,"tag":188,"props":747,"children":748},{},[749],{"type":31,"value":750},"compliance 改写后允许继续的样本",{"type":26,"tag":188,"props":752,"children":753},{},[754],{"type":31,"value":755},"risk high 进入人工审批的样本",{"type":26,"tag":188,"props":757,"children":758},{},[759],{"type":31,"value":760},"exception 覆盖后允许放行的样本",{"type":26,"tag":27,"props":762,"children":763},{},[764],{"type":31,"value":765},"规则系统最怕“每条规则自己都对，组合起来却错了”。",{"type":26,"tag":76,"props":767,"children":769},{"id":768},"九上线后要看-policy-指标而不只是拦截数",[770],{"type":31,"value":771},"九、上线后要看 policy 指标，而不只是拦截数",{"type":26,"tag":27,"props":773,"children":774},{},[775],{"type":31,"value":776},"建议持续观察：",{"type":26,"tag":83,"props":778,"children":779},{},[780,796],{"type":26,"tag":87,"props":781,"children":782},{},[783],{"type":26,"tag":91,"props":784,"children":785},{},[786,791],{"type":26,"tag":95,"props":787,"children":788},{},[789],{"type":31,"value":790},"指标",{"type":26,"tag":95,"props":792,"children":793},{},[794],{"type":31,"value":795},"用途",{"type":26,"tag":106,"props":797,"children":798},{},[799,812,825,838,851],{"type":26,"tag":91,"props":800,"children":801},{},[802,807],{"type":26,"tag":113,"props":803,"children":804},{},[805],{"type":31,"value":806},"policy deny 比例",{"type":26,"tag":113,"props":808,"children":809},{},[810],{"type":31,"value":811},"判断是否过严或异常放大",{"type":26,"tag":91,"props":813,"children":814},{},[815,820],{"type":26,"tag":113,"props":816,"children":817},{},[818],{"type":31,"value":819},"human_review 触发率",{"type":26,"tag":113,"props":821,"children":822},{},[823],{"type":31,"value":824},"判断风险门槛是否合理",{"type":26,"tag":91,"props":826,"children":827},{},[828,833],{"type":26,"tag":113,"props":829,"children":830},{},[831],{"type":31,"value":832},"exception 覆盖占比",{"type":26,"tag":113,"props":834,"children":835},{},[836],{"type":31,"value":837},"判断系统是否过度依赖豁免",{"type":26,"tag":91,"props":839,"children":840},{},[841,846],{"type":26,"tag":113,"props":842,"children":843},{},[844],{"type":31,"value":845},"explain packet 缺失率",{"type":26,"tag":113,"props":847,"children":848},{},[849],{"type":31,"value":850},"判断解释链路是否完整",{"type":26,"tag":91,"props":852,"children":853},{},[854,859],{"type":26,"tag":113,"props":855,"children":856},{},[857],{"type":31,"value":858},"规则版本回滚次数",{"type":26,"tag":113,"props":860,"children":861},{},[862],{"type":31,"value":863},"判断 policy 发布是否稳定",{"type":26,"tag":27,"props":865,"children":866},{},[867],{"type":31,"value":868},"如果 exception 覆盖占比持续升高，通常意味着基础规则已经脱离业务现实，需要重构而不是继续打补丁。",{"type":26,"tag":76,"props":870,"children":872},{"id":871},"十失败案例prompt-说要谨慎系统却没有真正阻断",[873],{"type":31,"value":874},"十、失败案例：prompt 说要谨慎，系统却没有真正阻断",{"type":26,"tag":27,"props":876,"children":877},{},[878],{"type":31,"value":879},"一个外发 Agent 的 prompt 明确写了“发送前请谨慎确认”。但因为系统没有 policy engine，模型某次误判“这次可以自动发送”，工具层又没有二次校验，结果通知真的发出去了。",{"type":26,"tag":27,"props":881,"children":882},{},[883],{"type":31,"value":884},"修复后，他们把发送动作改成：",{"type":26,"tag":184,"props":886,"children":887},{},[888,893,898,903],{"type":26,"tag":188,"props":889,"children":890},{},[891],{"type":31,"value":892},"permission 先验证用户和 agent 的外发资格",{"type":26,"tag":188,"props":894,"children":895},{},[896],{"type":31,"value":897},"compliance 检查是否包含敏感字段",{"type":26,"tag":188,"props":899,"children":900},{},[901],{"type":31,"value":902},"risk 判断是否属于高风险外发",{"type":26,"tag":188,"props":904,"children":905},{},[906,908],{"type":31,"value":907},"结果统一输出 ",{"type":26,"tag":289,"props":909,"children":911},{"className":910},[],[912],{"type":31,"value":708},{"type":26,"tag":27,"props":914,"children":915},{},[916],{"type":31,"value":917},"从那以后，“请谨慎”才真正变成系统行为，而不是一句愿望。",{"type":26,"tag":76,"props":919,"children":921},{"id":920},"十一policy-engine-checklist",[922],{"type":31,"value":923},"十一、Policy Engine Checklist",{"type":26,"tag":184,"props":925,"children":928},{"className":926},[927],"contains-task-list",[929,942,951,960,969,978,987,996,1005,1014,1023,1032],{"type":26,"tag":188,"props":930,"children":933},{"className":931},[932],"task-list-item",[934,940],{"type":26,"tag":935,"props":936,"children":939},"input",{"disabled":937,"type":938},true,"checkbox",[],{"type":31,"value":941}," 是否区分 permission、compliance、risk、exception 四层",{"type":26,"tag":188,"props":943,"children":945},{"className":944},[932],[946,949],{"type":26,"tag":935,"props":947,"children":948},{"disabled":937,"type":938},[],{"type":31,"value":950}," permission、tool、environment 权限来源是否可区分",{"type":26,"tag":188,"props":952,"children":954},{"className":953},[932],[955,958],{"type":26,"tag":935,"props":956,"children":957},{"disabled":937,"type":938},[],{"type":31,"value":959}," policy 结果是否结构化输出",{"type":26,"tag":188,"props":961,"children":963},{"className":962},[932],[964,967],{"type":26,"tag":935,"props":965,"children":966},{"disabled":937,"type":938},[],{"type":31,"value":968}," 是否记录 policy bundle 版本和规则来源",{"type":26,"tag":188,"props":970,"children":972},{"className":971},[932],[973,976],{"type":26,"tag":935,"props":974,"children":975},{"disabled":937,"type":938},[],{"type":31,"value":977}," 是否有明确执行顺序",{"type":26,"tag":188,"props":979,"children":981},{"className":980},[932],[982,985],{"type":26,"tag":935,"props":983,"children":984},{"disabled":937,"type":938},[],{"type":31,"value":986}," 多条规则命中时是否有唯一优先级和合并规则",{"type":26,"tag":188,"props":988,"children":990},{"className":989},[932],[991,994],{"type":26,"tag":935,"props":992,"children":993},{"disabled":937,"type":938},[],{"type":31,"value":995}," exception 是否有审批、范围和过期时间",{"type":26,"tag":188,"props":997,"children":999},{"className":998},[932],[1000,1003],{"type":26,"tag":935,"props":1001,"children":1002},{"disabled":937,"type":938},[],{"type":31,"value":1004}," risk 输出是否包含 reasons，便于审批与审计",{"type":26,"tag":188,"props":1006,"children":1008},{"className":1007},[932],[1009,1012],{"type":26,"tag":935,"props":1010,"children":1011},{"disabled":937,"type":938},[],{"type":31,"value":1013}," 高风险动作是否能稳定转人工而不是靠 prompt 提醒",{"type":26,"tag":188,"props":1015,"children":1017},{"className":1016},[932],[1018,1021],{"type":26,"tag":935,"props":1019,"children":1020},{"disabled":937,"type":938},[],{"type":31,"value":1022}," auditCode 是否可用于告警和审计",{"type":26,"tag":188,"props":1024,"children":1026},{"className":1025},[932],[1027,1030],{"type":26,"tag":935,"props":1028,"children":1029},{"disabled":937,"type":938},[],{"type":31,"value":1031}," 规则变更是否覆盖 deny / review / exception 等关键回归样本",{"type":26,"tag":188,"props":1033,"children":1035},{"className":1034},[932],[1036,1039],{"type":26,"tag":935,"props":1037,"children":1038},{"disabled":937,"type":938},[],{"type":31,"value":1040}," 规则变更是否进入回归测试",{"type":26,"tag":76,"props":1042,"children":1044},{"id":1043},"结语",[1045],{"type":31,"value":1043},{"type":26,"tag":27,"props":1047,"children":1048},{},[1049],{"type":31,"value":1050},"AI agent 的 policy 设计，本质上是在把“组织规则”翻译成“系统规则”。只有 permission、compliance、risk 和 exception 分层明确，agent 才能既有边界、又不至于处处卡死。",{"type":26,"tag":27,"props":1052,"children":1053},{},[1054],{"type":31,"value":1055},"延伸阅读：",{"type":26,"tag":184,"props":1057,"children":1058},{},[1059,1066,1073,1080],{"type":26,"tag":188,"props":1060,"children":1061},{},[1062],{"type":26,"tag":44,"props":1063,"children":1064},{"href":46},[1065],{"type":31,"value":49},{"type":26,"tag":188,"props":1067,"children":1068},{},[1069],{"type":26,"tag":44,"props":1070,"children":1071},{"href":54},[1072],{"type":31,"value":57},{"type":26,"tag":188,"props":1074,"children":1075},{},[1076],{"type":26,"tag":44,"props":1077,"children":1078},{"href":61},[1079],{"type":31,"value":64},{"type":26,"tag":188,"props":1081,"children":1082},{},[1083],{"type":26,"tag":44,"props":1084,"children":1085},{"href":69},[1086],{"type":31,"value":72},{"title":7,"searchDepth":1088,"depth":1088,"links":1089},3,[1090,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],{"id":78,"depth":1091,"text":81},2,{"id":174,"depth":1091,"text":177},{"id":238,"depth":1091,"text":241},{"id":313,"depth":1091,"text":316},{"id":446,"depth":1091,"text":449},{"id":497,"depth":1091,"text":500},{"id":527,"depth":1091,"text":530},{"id":619,"depth":1091,"text":622},{"id":729,"depth":1091,"text":732},{"id":768,"depth":1091,"text":771},{"id":871,"depth":1091,"text":874},{"id":920,"depth":1091,"text":923},{"id":1043,"depth":1091,"text":1043},"markdown","content:topics:ai:ai-agent-policy-engine-rule-layering.md","content","topics/ai/ai-agent-policy-engine-rule-layering.md","topics/ai/ai-agent-policy-engine-rule-layering","md",[1111,2266,3216],{"_path":1112,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1113,"description":1114,"date":1115,"topic":5,"author":11,"tags":1116,"image":1122,"imageAlt":1123,"pexelsPhotoId":1124,"pexelsUrl":1125,"readingTime":1126,"body":1127,"_type":1104,"_id":2263,"_source":1106,"_file":2264,"_stem":2265,"_extension":1109},"/topics/ai/cursor-keyboard-shortcuts-cheatsheet","Cursor 快捷键速查表（macOS/Windows）：从“会用”到“能提效”的 10 个工作流","把 Cursor 常用快捷键按任务分组（查代码、改代码、多文件、对话、审查与回滚），给出可直接照抄的工作流与最小回归清单，避免“快捷键背了也没变快”。","2026-03-02",[1117,1118,1119,1120,1121],"Cursor","快捷键","AI IDE","VS Code","开发效率","/images/topics/ai/cursor-keyboard-shortcuts-cheatsheet.jpg","彩色机械键盘与鼠标的工作台面",34563105,"https://www.pexels.com/photo/colorful-mechanical-keyboard-and-mouse-setup-34563105/",12,{"type":23,"children":1128,"toc":2237},[1129,1134,1152,1157,1186,1191,1227,1231,1237,1242,1275,1280,1303,1306,1312,1317,1535,1544,1547,1553,1560,1579,1587,1608,1613,1619,1634,1665,1670,1683,1689,1708,1726,1734,1739,1745,1750,1771,1779,1785,1790,1813,1818,1824,1837,1843,1861,1879,1885,1896,1914,1920,1931,1937,1942,1985,1988,1994,2002,2055,2058,2064,2070,2075,2080,2103,2121,2126,2151,2154,2160,2166,2171,2177,2182,2188,2193,2196,2202],{"type":26,"tag":27,"props":1130,"children":1131},{},[1132],{"type":31,"value":1133},"如果你在搜“Cursor 快捷键”，你大概率不是想背一张表，而是想解决这类问题：",{"type":26,"tag":184,"props":1135,"children":1136},{},[1137,1142,1147],{"type":26,"tag":188,"props":1138,"children":1139},{},[1140],{"type":31,"value":1141},"为什么我用了 AI，还是很慢？（对话来回太多、改动不可控）",{"type":26,"tag":188,"props":1143,"children":1144},{},[1145],{"type":31,"value":1146},"为什么它“看起来懂了”，却改错文件/改出回归？（上下文与范围没锁住）",{"type":26,"tag":188,"props":1148,"children":1149},{},[1150],{"type":31,"value":1151},"多文件改动怎么做得安全？（验收、回滚、最小回归集）",{"type":26,"tag":27,"props":1153,"children":1154},{},[1155],{"type":31,"value":1156},"这篇文章给你两份东西：",{"type":26,"tag":1158,"props":1159,"children":1160},"ol",{},[1161,1174],{"type":26,"tag":188,"props":1162,"children":1163},{},[1164,1166,1172],{"type":31,"value":1165},"一张",{"type":26,"tag":1167,"props":1168,"children":1169},"strong",{},[1170],{"type":31,"value":1171},"按任务分组",{"type":31,"value":1173},"的快捷键表（不是按功能堆在一起）",{"type":26,"tag":188,"props":1175,"children":1176},{},[1177,1179,1184],{"type":31,"value":1178},"一套“从需求到落地”的",{"type":26,"tag":1167,"props":1180,"children":1181},{},[1182],{"type":31,"value":1183},"最小闭环工作流",{"type":31,"value":1185},"（每一步都有快捷键）",{"type":26,"tag":27,"props":1187,"children":1188},{},[1189],{"type":31,"value":1190},"想看系统玩法：",{"type":26,"tag":184,"props":1192,"children":1193},{},[1194,1205,1216],{"type":26,"tag":188,"props":1195,"children":1196},{},[1197,1199],{"type":31,"value":1198},"入门教程看：",{"type":26,"tag":44,"props":1200,"children":1202},{"href":1201},"/topics/ai/cursor-tutorial",[1203],{"type":31,"value":1204},"Cursor 使用教程（2026）",{"type":26,"tag":188,"props":1206,"children":1207},{},[1208,1210],{"type":31,"value":1209},"进阶玩法看：",{"type":26,"tag":44,"props":1211,"children":1213},{"href":1212},"/topics/ai/cursor-editor-guide",[1214],{"type":31,"value":1215},"Cursor 编辑器深度玩法",{"type":26,"tag":188,"props":1217,"children":1218},{},[1219,1221],{"type":31,"value":1220},"规则与忽略看：",{"type":26,"tag":44,"props":1222,"children":1224},{"href":1223},"/topics/ai/cursor-rules-cursorrules",[1225],{"type":31,"value":1226},"Cursor Rules 与 .cursorrules",{"type":26,"tag":1228,"props":1229,"children":1230},"hr",{},[],{"type":26,"tag":76,"props":1232,"children":1234},{"id":1233},"先给结论提效不是按得快而是闭环更短",[1235],{"type":31,"value":1236},"先给结论：提效不是“按得快”，而是“闭环更短”",{"type":26,"tag":27,"props":1238,"children":1239},{},[1240],{"type":31,"value":1241},"你可以把 Cursor 的快捷键理解为 3 条流水线：",{"type":26,"tag":184,"props":1243,"children":1244},{},[1245,1255,1265],{"type":26,"tag":188,"props":1246,"children":1247},{},[1248,1253],{"type":26,"tag":1167,"props":1249,"children":1250},{},[1251],{"type":31,"value":1252},"改一小段",{"type":31,"value":1254},"（内联编辑）：把改动限制在一个函数/一段样式",{"type":26,"tag":188,"props":1256,"children":1257},{},[1258,1263],{"type":26,"tag":1167,"props":1259,"children":1260},{},[1261],{"type":31,"value":1262},"改一组文件",{"type":31,"value":1264},"（Composer）：把改动限制在一组明确文件，并要求输出 diff + 验收点",{"type":26,"tag":188,"props":1266,"children":1267},{},[1268,1273],{"type":26,"tag":1167,"props":1269,"children":1270},{},[1271],{"type":31,"value":1272},"聊清楚再动手",{"type":31,"value":1274},"（侧边对话）：先对齐目标、范围、验收、回滚",{"type":26,"tag":27,"props":1276,"children":1277},{},[1278],{"type":31,"value":1279},"当你觉得“它乱改/改太大”时，往往不是快捷键没记住，而是缺了两件事：",{"type":26,"tag":184,"props":1281,"children":1282},{},[1283,1293],{"type":26,"tag":188,"props":1284,"children":1285},{},[1286,1288],{"type":31,"value":1287},"没有在动手前锁定",{"type":26,"tag":1167,"props":1289,"children":1290},{},[1291],{"type":31,"value":1292},"范围",{"type":26,"tag":188,"props":1294,"children":1295},{},[1296,1298],{"type":31,"value":1297},"没有在接受改动前准备",{"type":26,"tag":1167,"props":1299,"children":1300},{},[1301],{"type":31,"value":1302},"验收/回滚",{"type":26,"tag":1228,"props":1304,"children":1305},{},[],{"type":26,"tag":76,"props":1307,"children":1309},{"id":1308},"快捷键速查表按任务分组",[1310],{"type":31,"value":1311},"快捷键速查表（按任务分组）",{"type":26,"tag":27,"props":1313,"children":1314},{},[1315],{"type":31,"value":1316},"说明：下表按“你正在做什么”组织，而不是按“功能名字”组织。不同版本快捷键可能略有差异，但核心逻辑一致。",{"type":26,"tag":83,"props":1318,"children":1319},{},[1320,1346],{"type":26,"tag":87,"props":1321,"children":1322},{},[1323],{"type":26,"tag":91,"props":1324,"children":1325},{},[1326,1331,1336,1341],{"type":26,"tag":95,"props":1327,"children":1328},{},[1329],{"type":31,"value":1330},"任务",{"type":26,"tag":95,"props":1332,"children":1333},{},[1334],{"type":31,"value":1335},"macOS",{"type":26,"tag":95,"props":1337,"children":1338},{},[1339],{"type":31,"value":1340},"Windows",{"type":26,"tag":95,"props":1342,"children":1343},{},[1344],{"type":31,"value":1345},"你该在什么时候用",{"type":26,"tag":106,"props":1347,"children":1348},{},[1349,1380,1411,1442,1473,1504],{"type":26,"tag":91,"props":1350,"children":1351},{},[1352,1357,1366,1375],{"type":26,"tag":113,"props":1353,"children":1354},{},[1355],{"type":31,"value":1356},"改一小段（最安全）",{"type":26,"tag":113,"props":1358,"children":1359},{},[1360],{"type":26,"tag":289,"props":1361,"children":1363},{"className":1362},[],[1364],{"type":31,"value":1365},"Cmd + K",{"type":26,"tag":113,"props":1367,"children":1368},{},[1369],{"type":26,"tag":289,"props":1370,"children":1372},{"className":1371},[],[1373],{"type":31,"value":1374},"Ctrl + K",{"type":26,"tag":113,"props":1376,"children":1377},{},[1378],{"type":31,"value":1379},"只想改一个函数/一段 CSS，不想动别的",{"type":26,"tag":91,"props":1381,"children":1382},{},[1383,1388,1397,1406],{"type":26,"tag":113,"props":1384,"children":1385},{},[1386],{"type":31,"value":1387},"打开 AI 对话（先对齐再动手）",{"type":26,"tag":113,"props":1389,"children":1390},{},[1391],{"type":26,"tag":289,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":31,"value":1396},"Cmd + L",{"type":26,"tag":113,"props":1398,"children":1399},{},[1400],{"type":26,"tag":289,"props":1401,"children":1403},{"className":1402},[],[1404],{"type":31,"value":1405},"Ctrl + L",{"type":26,"tag":113,"props":1407,"children":1408},{},[1409],{"type":31,"value":1410},"需要澄清目标、制定步骤、给验收点",{"type":26,"tag":91,"props":1412,"children":1413},{},[1414,1419,1428,1437],{"type":26,"tag":113,"props":1415,"children":1416},{},[1417],{"type":31,"value":1418},"多文件编辑（有组织地改一组文件）",{"type":26,"tag":113,"props":1420,"children":1421},{},[1422],{"type":26,"tag":289,"props":1423,"children":1425},{"className":1424},[],[1426],{"type":31,"value":1427},"Cmd + I",{"type":26,"tag":113,"props":1429,"children":1430},{},[1431],{"type":26,"tag":289,"props":1432,"children":1434},{"className":1433},[],[1435],{"type":31,"value":1436},"Ctrl + I",{"type":26,"tag":113,"props":1438,"children":1439},{},[1440],{"type":31,"value":1441},"改动涉及多个文件：组件+样式+测试",{"type":26,"tag":91,"props":1443,"children":1444},{},[1445,1450,1459,1468],{"type":26,"tag":113,"props":1446,"children":1447},{},[1448],{"type":31,"value":1449},"把选中代码加入对话上下文",{"type":26,"tag":113,"props":1451,"children":1452},{},[1453],{"type":26,"tag":289,"props":1454,"children":1456},{"className":1455},[],[1457],{"type":31,"value":1458},"Cmd + Shift + L",{"type":26,"tag":113,"props":1460,"children":1461},{},[1462],{"type":26,"tag":289,"props":1463,"children":1465},{"className":1464},[],[1466],{"type":31,"value":1467},"Ctrl + Shift + L",{"type":26,"tag":113,"props":1469,"children":1470},{},[1471],{"type":31,"value":1472},"让 AI 只看你选的片段（降低噪音）",{"type":26,"tag":91,"props":1474,"children":1475},{},[1476,1481,1490,1499],{"type":26,"tag":113,"props":1477,"children":1478},{},[1479],{"type":31,"value":1480},"接受当前建议",{"type":26,"tag":113,"props":1482,"children":1483},{},[1484],{"type":26,"tag":289,"props":1485,"children":1487},{"className":1486},[],[1488],{"type":31,"value":1489},"Cmd + Y",{"type":26,"tag":113,"props":1491,"children":1492},{},[1493],{"type":26,"tag":289,"props":1494,"children":1496},{"className":1495},[],[1497],{"type":31,"value":1498},"Ctrl + Y",{"type":26,"tag":113,"props":1500,"children":1501},{},[1502],{"type":31,"value":1503},"你已经准备好验收/回滚，并确认改动范围",{"type":26,"tag":91,"props":1505,"children":1506},{},[1507,1512,1521,1530],{"type":26,"tag":113,"props":1508,"children":1509},{},[1510],{"type":31,"value":1511},"拒绝当前建议",{"type":26,"tag":113,"props":1513,"children":1514},{},[1515],{"type":26,"tag":289,"props":1516,"children":1518},{"className":1517},[],[1519],{"type":31,"value":1520},"Cmd + N",{"type":26,"tag":113,"props":1522,"children":1523},{},[1524],{"type":26,"tag":289,"props":1525,"children":1527},{"className":1526},[],[1528],{"type":31,"value":1529},"Ctrl + N",{"type":26,"tag":113,"props":1531,"children":1532},{},[1533],{"type":31,"value":1534},"改得太大、改错方向，立刻收手",{"type":26,"tag":1536,"props":1537,"children":1538},"blockquote",{},[1539],{"type":26,"tag":27,"props":1540,"children":1541},{},[1542],{"type":31,"value":1543},"小技巧：把“改一小段”当默认路径。只有当你能清晰写出“会改哪几类文件、怎么验收”时再进入多文件。",{"type":26,"tag":1228,"props":1545,"children":1546},{},[],{"type":26,"tag":76,"props":1548,"children":1550},{"id":1549},"_10-个可直接照抄的提效工作流每个都能闭环",[1551],{"type":31,"value":1552},"10 个可直接照抄的提效工作流（每个都能闭环）",{"type":26,"tag":1554,"props":1555,"children":1557},"h3",{"id":1556},"工作流-1需求计划小步改新手最稳",[1558],{"type":31,"value":1559},"工作流 1：需求→计划→小步改（新手最稳）",{"type":26,"tag":1158,"props":1561,"children":1562},{},[1563,1574],{"type":26,"tag":188,"props":1564,"children":1565},{},[1566,1572],{"type":26,"tag":289,"props":1567,"children":1569},{"className":1568},[],[1570],{"type":31,"value":1571},"Cmd/Ctrl + L",{"type":31,"value":1573}," 打开对话",{"type":26,"tag":188,"props":1575,"children":1576},{},[1577],{"type":31,"value":1578},"先发这段（可复制）：",{"type":26,"tag":1536,"props":1580,"children":1581},{},[1582],{"type":26,"tag":27,"props":1583,"children":1584},{},[1585],{"type":31,"value":1586},"目标：……\n范围：只修改以下文件/模块：……\n非目标：……（明确不做）\n验收：……（可测试/可手动检查）\n输出格式：先给计划，再逐步执行；每一步写出 diff 摘要。",{"type":26,"tag":1158,"props":1588,"children":1589},{"start":1088},[1590,1595],{"type":26,"tag":188,"props":1591,"children":1592},{},[1593],{"type":31,"value":1594},"让 AI 先给“计划（3~6 步）”，你确认后再执行",{"type":26,"tag":188,"props":1596,"children":1597},{},[1598,1600,1606],{"type":31,"value":1599},"任何一步涉及改代码：优先回到编辑区，选中片段用 ",{"type":26,"tag":289,"props":1601,"children":1603},{"className":1602},[],[1604],{"type":31,"value":1605},"Cmd/Ctrl + K",{"type":31,"value":1607}," 小步改",{"type":26,"tag":27,"props":1609,"children":1610},{},[1611],{"type":31,"value":1612},"为什么有效：你把“想法”变成了“可执行约束”，这就是 GEO（面向 AI/模型的可理解结构）。",{"type":26,"tag":1554,"props":1614,"children":1616},{"id":1615},"工作流-2只改一个函数高频低风险",[1617],{"type":31,"value":1618},"工作流 2：只改一个函数（高频、低风险）",{"type":26,"tag":184,"props":1620,"children":1621},{},[1622],{"type":26,"tag":188,"props":1623,"children":1624},{},[1625,1627,1632],{"type":31,"value":1626},"选中函数 → ",{"type":26,"tag":289,"props":1628,"children":1630},{"className":1629},[],[1631],{"type":31,"value":1605},{"type":31,"value":1633}," → 输入指令：",{"type":26,"tag":1536,"props":1635,"children":1636},{},[1637,1642],{"type":26,"tag":27,"props":1638,"children":1639},{},[1640],{"type":31,"value":1641},"把这段改成更可读：",{"type":26,"tag":184,"props":1643,"children":1644},{},[1645,1650,1655,1660],{"type":26,"tag":188,"props":1646,"children":1647},{},[1648],{"type":31,"value":1649},"用 async/await",{"type":26,"tag":188,"props":1651,"children":1652},{},[1653],{"type":31,"value":1654},"错误处理不要吞掉",{"type":26,"tag":188,"props":1656,"children":1657},{},[1658],{"type":31,"value":1659},"添加类型（若可推断）",{"type":26,"tag":188,"props":1661,"children":1662},{},[1663],{"type":31,"value":1664},"不要改函数签名",{"type":26,"tag":27,"props":1666,"children":1667},{},[1668],{"type":31,"value":1669},"验收方式（强制）：",{"type":26,"tag":184,"props":1671,"children":1672},{},[1673,1678],{"type":26,"tag":188,"props":1674,"children":1675},{},[1676],{"type":31,"value":1677},"输出前后函数行为一致（输入/输出）",{"type":26,"tag":188,"props":1679,"children":1680},{},[1681],{"type":31,"value":1682},"失败分支有可观测日志（不要悄悄 return null）",{"type":26,"tag":1554,"props":1684,"children":1686},{"id":1685},"工作流-3多文件改动先定文件清单",[1687],{"type":31,"value":1688},"工作流 3：多文件改动（先定“文件清单”）",{"type":26,"tag":1158,"props":1690,"children":1691},{},[1692,1703],{"type":26,"tag":188,"props":1693,"children":1694},{},[1695,1701],{"type":26,"tag":289,"props":1696,"children":1698},{"className":1697},[],[1699],{"type":31,"value":1700},"Cmd/Ctrl + I",{"type":31,"value":1702}," 进入多文件",{"type":26,"tag":188,"props":1704,"children":1705},{},[1706],{"type":31,"value":1707},"先让 AI 输出：",{"type":26,"tag":184,"props":1709,"children":1710},{},[1711,1716,1721],{"type":26,"tag":188,"props":1712,"children":1713},{},[1714],{"type":31,"value":1715},"预计会改哪些文件（最多 5 个）",{"type":26,"tag":188,"props":1717,"children":1718},{},[1719],{"type":31,"value":1720},"每个文件改什么",{"type":26,"tag":188,"props":1722,"children":1723},{},[1724],{"type":31,"value":1725},"每一步怎么验收",{"type":26,"tag":1158,"props":1727,"children":1728},{"start":1088},[1729],{"type":26,"tag":188,"props":1730,"children":1731},{},[1732],{"type":31,"value":1733},"你确认文件清单后再开始生成改动",{"type":26,"tag":27,"props":1735,"children":1736},{},[1737],{"type":31,"value":1738},"关键点：多文件最容易翻车的是“它把你没想到的文件也改了”。所以文件清单是第一道闸门。",{"type":26,"tag":1554,"props":1740,"children":1742},{"id":1741},"工作流-4把上下文噪音砍掉防跑偏",[1743],{"type":31,"value":1744},"工作流 4：把“上下文噪音”砍掉（防跑偏）",{"type":26,"tag":27,"props":1746,"children":1747},{},[1748],{"type":31,"value":1749},"当你怀疑它在胡说/乱改时：",{"type":26,"tag":184,"props":1751,"children":1752},{},[1753,1766],{"type":26,"tag":188,"props":1754,"children":1755},{},[1756,1758,1764],{"type":31,"value":1757},"只选择关键代码片段 → ",{"type":26,"tag":289,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":31,"value":1763},"Cmd/Ctrl + Shift + L",{"type":31,"value":1765}," 加入对话",{"type":26,"tag":188,"props":1767,"children":1768},{},[1769],{"type":31,"value":1770},"然后在对话里要求：",{"type":26,"tag":1536,"props":1772,"children":1773},{},[1774],{"type":26,"tag":27,"props":1775,"children":1776},{},[1777],{"type":31,"value":1778},"只基于我提供的代码片段回答，不要假设其它文件存在。",{"type":26,"tag":1554,"props":1780,"children":1782},{"id":1781},"工作流-5生成变更说明让-code-review-变快",[1783],{"type":31,"value":1784},"工作流 5：生成变更说明（让 code review 变快）",{"type":26,"tag":27,"props":1786,"children":1787},{},[1788],{"type":31,"value":1789},"改完后在对话里让它输出：",{"type":26,"tag":184,"props":1791,"children":1792},{},[1793,1798,1803,1808],{"type":26,"tag":188,"props":1794,"children":1795},{},[1796],{"type":31,"value":1797},"改动摘要（3~7 条）",{"type":26,"tag":188,"props":1799,"children":1800},{},[1801],{"type":31,"value":1802},"风险点（依赖/边界条件）",{"type":26,"tag":188,"props":1804,"children":1805},{},[1806],{"type":31,"value":1807},"回滚方式",{"type":26,"tag":188,"props":1809,"children":1810},{},[1811],{"type":31,"value":1812},"验收步骤",{"type":26,"tag":27,"props":1814,"children":1815},{},[1816],{"type":31,"value":1817},"这套结构能直接贴进 PR 描述。",{"type":26,"tag":1554,"props":1819,"children":1821},{"id":1820},"工作流-6写最小回归集不写回归-等事故",[1822],{"type":31,"value":1823},"工作流 6：写“最小回归集”（不写回归 = 等事故）",{"type":26,"tag":27,"props":1825,"children":1826},{},[1827,1829,1835],{"type":31,"value":1828},"每次改动都至少做 10 条最小回归（见下文清单）。你可以把它写在 ",{"type":26,"tag":289,"props":1830,"children":1832},{"className":1831},[],[1833],{"type":31,"value":1834},"README",{"type":31,"value":1836}," 或团队 wiki。",{"type":26,"tag":1554,"props":1838,"children":1840},{"id":1839},"工作流-7把接受建议变成最后一步",[1841],{"type":31,"value":1842},"工作流 7：把“接受建议”变成最后一步",{"type":26,"tag":27,"props":1844,"children":1845},{},[1846,1852,1854,1859],{"type":26,"tag":289,"props":1847,"children":1849},{"className":1848},[],[1850],{"type":31,"value":1851},"Cmd/Ctrl + Y",{"type":31,"value":1853}," 应该是",{"type":26,"tag":1167,"props":1855,"children":1856},{},[1857],{"type":31,"value":1858},"最后一步",{"type":31,"value":1860},"：",{"type":26,"tag":184,"props":1862,"children":1863},{},[1864,1869,1874],{"type":26,"tag":188,"props":1865,"children":1866},{},[1867],{"type":31,"value":1868},"你已经看过 diff",{"type":26,"tag":188,"props":1870,"children":1871},{},[1872],{"type":31,"value":1873},"你能说清楚“怎么验收”",{"type":26,"tag":188,"props":1875,"children":1876},{},[1877],{"type":31,"value":1878},"你知道“怎么回滚”",{"type":26,"tag":1554,"props":1880,"children":1882},{"id":1881},"工作流-8拒绝建议不是失败是风控动作",[1883],{"type":31,"value":1884},"工作流 8：拒绝建议不是失败，是风控动作",{"type":26,"tag":27,"props":1886,"children":1887},{},[1888,1894],{"type":26,"tag":289,"props":1889,"children":1891},{"className":1890},[],[1892],{"type":31,"value":1893},"Cmd/Ctrl + N",{"type":31,"value":1895}," 的使用时机：",{"type":26,"tag":184,"props":1897,"children":1898},{},[1899,1904,1909],{"type":26,"tag":188,"props":1900,"children":1901},{},[1902],{"type":31,"value":1903},"它开始改你没提过的东西（范围漂移）",{"type":26,"tag":188,"props":1905,"children":1906},{},[1907],{"type":31,"value":1908},"它改了 10 个文件但你只想改 1 个",{"type":26,"tag":188,"props":1910,"children":1911},{},[1912],{"type":31,"value":1913},"它为了“更优雅”引入新依赖/新抽象",{"type":26,"tag":1554,"props":1915,"children":1917},{"id":1916},"工作流-9重复任务做成模板提示词不是一次性",[1918],{"type":31,"value":1919},"工作流 9：重复任务做成模板（提示词不是一次性）",{"type":26,"tag":27,"props":1921,"children":1922},{},[1923,1925,1929],{"type":31,"value":1924},"把高频任务（比如“写组件+样式+验收”）固化成模板，放进 Rules（见：",{"type":26,"tag":44,"props":1926,"children":1927},{"href":1223},[1928],{"type":31,"value":1226},{"type":31,"value":1930},"）。",{"type":26,"tag":1554,"props":1932,"children":1934},{"id":1933},"工作流-10把快捷键表做成你自己的任务表",[1935],{"type":31,"value":1936},"工作流 10：把“快捷键表”做成你自己的任务表",{"type":26,"tag":27,"props":1938,"children":1939},{},[1940],{"type":31,"value":1941},"你不需要记住所有快捷键，只需要记住：",{"type":26,"tag":184,"props":1943,"children":1944},{},[1945,1955,1965,1975],{"type":26,"tag":188,"props":1946,"children":1947},{},[1948,1950],{"type":31,"value":1949},"小步改：",{"type":26,"tag":289,"props":1951,"children":1953},{"className":1952},[],[1954],{"type":31,"value":1605},{"type":26,"tag":188,"props":1956,"children":1957},{},[1958,1960],{"type":31,"value":1959},"先对齐：",{"type":26,"tag":289,"props":1961,"children":1963},{"className":1962},[],[1964],{"type":31,"value":1571},{"type":26,"tag":188,"props":1966,"children":1967},{},[1968,1970],{"type":31,"value":1969},"多文件：",{"type":26,"tag":289,"props":1971,"children":1973},{"className":1972},[],[1974],{"type":31,"value":1700},{"type":26,"tag":188,"props":1976,"children":1977},{},[1978,1980],{"type":31,"value":1979},"上下文聚焦：",{"type":26,"tag":289,"props":1981,"children":1983},{"className":1982},[],[1984],{"type":31,"value":1763},{"type":26,"tag":1228,"props":1986,"children":1987},{},[],{"type":26,"tag":76,"props":1989,"children":1991},{"id":1990},"必交付物-1最小回归任务清单10-条通用",[1992],{"type":31,"value":1993},"必交付物 1：最小回归任务清单（10 条，通用）",{"type":26,"tag":1536,"props":1995,"children":1996},{},[1997],{"type":26,"tag":27,"props":1998,"children":1999},{},[2000],{"type":31,"value":2001},"这份清单的意义：让每次 AI 改动都能“被验证”。否则你只是把不可控变成了更快的不可控。",{"type":26,"tag":1158,"props":2003,"children":2004},{},[2005,2010,2015,2020,2025,2030,2035,2040,2045,2050],{"type":26,"tag":188,"props":2006,"children":2007},{},[2008],{"type":31,"value":2009},"关键路径能跑通（手动点击/请求一次）",{"type":26,"tag":188,"props":2011,"children":2012},{},[2013],{"type":31,"value":2014},"错误路径能触发（模拟一次失败输入）",{"type":26,"tag":188,"props":2016,"children":2017},{},[2018],{"type":31,"value":2019},"控制台无新增错误（至少关注 1 次真实操作）",{"type":26,"tag":188,"props":2021,"children":2022},{},[2023],{"type":31,"value":2024},"关键 UI 未错位（移动端/桌面端各看一眼）",{"type":26,"tag":188,"props":2026,"children":2027},{},[2028],{"type":31,"value":2029},"刷新后状态正确（尤其是表单/列表）",{"type":26,"tag":188,"props":2031,"children":2032},{},[2033],{"type":31,"value":2034},"路由跳转没断（从入口到目标页）",{"type":26,"tag":188,"props":2036,"children":2037},{},[2038],{"type":31,"value":2039},"相关接口未改变契约（字段名/类型）",{"type":26,"tag":188,"props":2041,"children":2042},{},[2043],{"type":31,"value":2044},"性能没有明显退化（首屏、交互卡顿）",{"type":26,"tag":188,"props":2046,"children":2047},{},[2048],{"type":31,"value":2049},"回滚方案可执行（知道回滚哪几个文件/commit）",{"type":26,"tag":188,"props":2051,"children":2052},{},[2053],{"type":31,"value":2054},"写下“这次改动解决了什么、风险是什么”（可贴 PR）",{"type":26,"tag":1228,"props":2056,"children":2057},{},[],{"type":26,"tag":76,"props":2059,"children":2061},{"id":2060},"必交付物-2失败案例复盘真实会发生",[2062],{"type":31,"value":2063},"必交付物 2：失败案例复盘（真实会发生）",{"type":26,"tag":1554,"props":2065,"children":2067},{"id":2066},"现象快捷键用得很熟但交付还是慢",[2068],{"type":31,"value":2069},"现象：快捷键用得很熟，但交付还是慢",{"type":26,"tag":27,"props":2071,"children":2072},{},[2073],{"type":31,"value":2074},"典型原因：你把 Cursor 当成“更聪明的搜索框”，不断对话，直到它给出你想要的答案。",{"type":26,"tag":27,"props":2076,"children":2077},{},[2078],{"type":31,"value":2079},"复现路径：",{"type":26,"tag":184,"props":2081,"children":2082},{},[2083,2088,2093,2098],{"type":26,"tag":188,"props":2084,"children":2085},{},[2086],{"type":31,"value":2087},"你直接说“把页面做得更好看、更高级”",{"type":26,"tag":188,"props":2089,"children":2090},{},[2091],{"type":31,"value":2092},"AI 开始大改样式、抽象组件、甚至引入新依赖",{"type":26,"tag":188,"props":2094,"children":2095},{},[2096],{"type":31,"value":2097},"你为了省事按了“接受建议”",{"type":26,"tag":188,"props":2099,"children":2100},{},[2101],{"type":31,"value":2102},"最后发现：设计没统一、移动端崩、甚至埋了性能问题",{"type":26,"tag":27,"props":2104,"children":2105},{},[2106,2108,2112,2114,2119],{"type":31,"value":2107},"根因：缺少",{"type":26,"tag":1167,"props":2109,"children":2110},{},[2111],{"type":31,"value":1292},{"type":31,"value":2113},"与",{"type":26,"tag":1167,"props":2115,"children":2116},{},[2117],{"type":31,"value":2118},"验收",{"type":31,"value":2120},"。",{"type":26,"tag":27,"props":2122,"children":2123},{},[2124],{"type":31,"value":2125},"修复方式（可照抄）：",{"type":26,"tag":184,"props":2127,"children":2128},{},[2129,2134,2146],{"type":26,"tag":188,"props":2130,"children":2131},{},[2132],{"type":31,"value":2133},"把需求拆成 3 个可验证目标：例如“按钮样式统一”“首屏 CTA 更明显”“移动端间距不挤”",{"type":26,"tag":188,"props":2135,"children":2136},{},[2137,2139,2144],{"type":31,"value":2138},"每个目标只用 ",{"type":26,"tag":289,"props":2140,"children":2142},{"className":2141},[],[2143],{"type":31,"value":1605},{"type":31,"value":2145}," 改一个局部",{"type":26,"tag":188,"props":2147,"children":2148},{},[2149],{"type":31,"value":2150},"每次接受建议前跑一遍“最小回归集”",{"type":26,"tag":1228,"props":2152,"children":2153},{},[],{"type":26,"tag":76,"props":2155,"children":2157},{"id":2156},"faq高频问题",[2158],{"type":31,"value":2159},"FAQ（高频问题）",{"type":26,"tag":1554,"props":2161,"children":2163},{"id":2162},"q1我应该先记快捷键还是先学工作流",[2164],{"type":31,"value":2165},"Q1：我应该先记快捷键还是先学工作流？",{"type":26,"tag":27,"props":2167,"children":2168},{},[2169],{"type":31,"value":2170},"先学工作流。快捷键只是把工作流的步骤变短。",{"type":26,"tag":1554,"props":2172,"children":2174},{"id":2173},"q2为什么我一用多文件就容易翻车",[2175],{"type":31,"value":2176},"Q2：为什么我一用多文件就容易翻车？",{"type":26,"tag":27,"props":2178,"children":2179},{},[2180],{"type":31,"value":2181},"因为多文件意味着范围更大、依赖更多、验收更难。先锁定“文件清单 + 每步验收”，再让它动手。",{"type":26,"tag":1554,"props":2183,"children":2185},{"id":2184},"q3有没有万能提示词",[2186],{"type":31,"value":2187},"Q3：有没有“万能提示词”？",{"type":26,"tag":27,"props":2189,"children":2190},{},[2191],{"type":31,"value":2192},"没有，但有“万能结构”：目标、范围、非目标、验收、输出格式。",{"type":26,"tag":1228,"props":2194,"children":2195},{},[],{"type":26,"tag":76,"props":2197,"children":2199},{"id":2198},"延伸阅读建议按顺序",[2200],{"type":31,"value":2201},"延伸阅读（建议按顺序）",{"type":26,"tag":184,"props":2203,"children":2204},{},[2205,2212,2219,2226],{"type":26,"tag":188,"props":2206,"children":2207},{},[2208],{"type":26,"tag":44,"props":2209,"children":2210},{"href":1201},[2211],{"type":31,"value":1204},{"type":26,"tag":188,"props":2213,"children":2214},{},[2215],{"type":26,"tag":44,"props":2216,"children":2217},{"href":1212},[2218],{"type":31,"value":1215},{"type":26,"tag":188,"props":2220,"children":2221},{},[2222],{"type":26,"tag":44,"props":2223,"children":2224},{"href":1223},[2225],{"type":31,"value":1226},{"type":26,"tag":188,"props":2227,"children":2228},{},[2229,2231],{"type":31,"value":2230},"如果你更关心“网页制作落地”：看这篇 ",{"type":26,"tag":44,"props":2232,"children":2234},{"href":2233},"/topics/practical-tips/htmlpage-quick-landing-page",[2235],{"type":31,"value":2236},"3 分钟用 HTMLPAGE 做落地页",{"title":7,"searchDepth":1088,"depth":1088,"links":2238},[2239,2240,2241,2253,2254,2257,2262],{"id":1233,"depth":1091,"text":1236},{"id":1308,"depth":1091,"text":1311},{"id":1549,"depth":1091,"text":1552,"children":2242},[2243,2244,2245,2246,2247,2248,2249,2250,2251,2252],{"id":1556,"depth":1088,"text":1559},{"id":1615,"depth":1088,"text":1618},{"id":1685,"depth":1088,"text":1688},{"id":1741,"depth":1088,"text":1744},{"id":1781,"depth":1088,"text":1784},{"id":1820,"depth":1088,"text":1823},{"id":1839,"depth":1088,"text":1842},{"id":1881,"depth":1088,"text":1884},{"id":1916,"depth":1088,"text":1919},{"id":1933,"depth":1088,"text":1936},{"id":1990,"depth":1091,"text":1993},{"id":2060,"depth":1091,"text":2063,"children":2255},[2256],{"id":2066,"depth":1088,"text":2069},{"id":2156,"depth":1091,"text":2159,"children":2258},[2259,2260,2261],{"id":2162,"depth":1088,"text":2165},{"id":2173,"depth":1088,"text":2176},{"id":2184,"depth":1088,"text":2187},{"id":2198,"depth":1091,"text":2201},"content:topics:ai:cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet.md","topics/ai/cursor-keyboard-shortcuts-cheatsheet",{"_path":2267,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":2268,"description":2269,"date":2270,"topic":5,"author":11,"tags":2271,"image":2275,"imageAlt":2276,"pexelsPhotoId":2277,"pexelsUrl":2278,"readingTime":2279,"body":2280,"_type":1104,"_id":3213,"_source":1106,"_file":3214,"_stem":3215,"_extension":1109},"/topics/ai/cursor-vs-copilot-vscode-workflow","Cursor vs GitHub Copilot vs VS Code：怎么选、怎么搭配、怎么把风险关在笼子里","用“任务类型×风险×验收成本”的选择矩阵解释 Cursor/Copilot/VS Code 的差异，并给出一套可落地的协作工作流（范围闸门、最小回归集、回滚策略）。","2026-03-01",[1117,2272,1120,2273,2274],"GitHub Copilot","AI 编程","工作流","/images/topics/ai/cursor-vs-copilot-vscode-workflow.jpg","团队在电脑前进行协作讨论",1181371,"https://www.pexels.com/photo/man-wearing-blue-dress-shirt-1181371/",15,{"type":23,"children":2281,"toc":3191},[2282,2287,2292,2310,2315,2333,2336,2342,2347,2378,2383,2386,2392,2400,2604,2612,2625,2628,2634,2640,2653,2658,2671,2677,2682,2715,2721,2726,2744,2747,2753,2758,2764,2769,2802,2808,2821,2826,2839,2845,2857,2863,2868,2881,2886,2889,2895,2900,3021,3024,3030,3040,3049,3067,3076,3084,3093,3111,3114,3120,3126,3131,3137,3142,3145,3150],{"type":26,"tag":27,"props":2283,"children":2284},{},[2285],{"type":31,"value":2286},"“Cursor 和 Copilot 到底有什么区别？”",{"type":26,"tag":27,"props":2288,"children":2289},{},[2290],{"type":31,"value":2291},"这个问题问得越早越好，因为你一旦把工具选错，后面所有痛苦都不是“提示词不够好”，而是：",{"type":26,"tag":184,"props":2293,"children":2294},{},[2295,2300,2305],{"type":26,"tag":188,"props":2296,"children":2297},{},[2298],{"type":31,"value":2299},"改动不可控（范围漂移、改错文件）",{"type":26,"tag":188,"props":2301,"children":2302},{},[2303],{"type":31,"value":2304},"验收成本爆炸（不知道要测什么）",{"type":26,"tag":188,"props":2306,"children":2307},{},[2308],{"type":31,"value":2309},"团队协作崩盘（没有闸门、没有回滚）",{"type":26,"tag":27,"props":2311,"children":2312},{},[2313],{"type":31,"value":2314},"这篇文章用一张选择矩阵 + 一套可执行工作流，帮你做到两件事：",{"type":26,"tag":1158,"props":2316,"children":2317},{},[2318,2323],{"type":26,"tag":188,"props":2319,"children":2320},{},[2321],{"type":31,"value":2322},"知道什么时候用 Cursor、什么时候用 Copilot、什么时候“纯 VS Code 更快”",{"type":26,"tag":188,"props":2324,"children":2325},{},[2326,2328],{"type":31,"value":2327},"就算用 AI，也能把风险关在笼子里：",{"type":26,"tag":1167,"props":2329,"children":2330},{},[2331],{"type":31,"value":2332},"可审查、可验证、可回滚",{"type":26,"tag":1228,"props":2334,"children":2335},{},[],{"type":26,"tag":76,"props":2337,"children":2339},{"id":2338},"结论先说三者不是互斥而是分工",[2340],{"type":31,"value":2341},"结论先说：三者不是互斥，而是分工",{"type":26,"tag":27,"props":2343,"children":2344},{},[2345],{"type":31,"value":2346},"你可以把它们看成三层能力：",{"type":26,"tag":184,"props":2348,"children":2349},{},[2350,2359,2369],{"type":26,"tag":188,"props":2351,"children":2352},{},[2353,2357],{"type":26,"tag":1167,"props":2354,"children":2355},{},[2356],{"type":31,"value":1120},{"type":31,"value":2358},"：编辑器与生态（调试、插件、任务、终端、语言服务）",{"type":26,"tag":188,"props":2360,"children":2361},{},[2362,2367],{"type":26,"tag":1167,"props":2363,"children":2364},{},[2365],{"type":31,"value":2366},"Copilot",{"type":31,"value":2368},"：代码补全与局部建议（“我正在写这一行/这一段”）",{"type":26,"tag":188,"props":2370,"children":2371},{},[2372,2376],{"type":26,"tag":1167,"props":2373,"children":2374},{},[2375],{"type":31,"value":1117},{"type":31,"value":2377},"：以项目为单位的 AI 协作（对话、索引、多文件编辑、规则）",{"type":26,"tag":27,"props":2379,"children":2380},{},[2381],{"type":31,"value":2382},"最常见的误区是：把“局部补全能力”当作“能做架构与多文件落地”。",{"type":26,"tag":1228,"props":2384,"children":2385},{},[],{"type":26,"tag":76,"props":2387,"children":2389},{"id":2388},"选择矩阵按任务类型选工具不是按偏好",[2390],{"type":31,"value":2391},"选择矩阵：按任务类型选工具（不是按偏好）",{"type":26,"tag":1536,"props":2393,"children":2394},{},[2395],{"type":26,"tag":27,"props":2396,"children":2397},{},[2398],{"type":31,"value":2399},"你只要把自己的任务放进表格，就能得到推荐路径。",{"type":26,"tag":83,"props":2401,"children":2402},{},[2403,2435],{"type":26,"tag":87,"props":2404,"children":2405},{},[2406],{"type":26,"tag":91,"props":2407,"children":2408},{},[2409,2414,2420,2425,2430],{"type":26,"tag":95,"props":2410,"children":2411},{},[2412],{"type":31,"value":2413},"任务类型",{"type":26,"tag":95,"props":2415,"children":2417},{"align":2416},"right",[2418],{"type":31,"value":2419},"风险",{"type":26,"tag":95,"props":2421,"children":2422},{"align":2416},[2423],{"type":31,"value":2424},"验收成本",{"type":26,"tag":95,"props":2426,"children":2427},{},[2428],{"type":31,"value":2429},"更推荐",{"type":26,"tag":95,"props":2431,"children":2432},{},[2433],{"type":31,"value":2434},"为什么",{"type":26,"tag":106,"props":2436,"children":2437},{},[2438,2465,2498,2524,2551,2578],{"type":26,"tag":91,"props":2439,"children":2440},{},[2441,2446,2451,2455,2460],{"type":26,"tag":113,"props":2442,"children":2443},{},[2444],{"type":31,"value":2445},"写一段代码/补一个 if",{"type":26,"tag":113,"props":2447,"children":2448},{"align":2416},[2449],{"type":31,"value":2450},"低",{"type":26,"tag":113,"props":2452,"children":2453},{"align":2416},[2454],{"type":31,"value":2450},{"type":26,"tag":113,"props":2456,"children":2457},{},[2458],{"type":31,"value":2459},"Copilot / Cursor 内联编辑",{"type":26,"tag":113,"props":2461,"children":2462},{},[2463],{"type":31,"value":2464},"局部建议足够，成本最低",{"type":26,"tag":91,"props":2466,"children":2467},{},[2468,2473,2478,2482,2493],{"type":26,"tag":113,"props":2469,"children":2470},{},[2471],{"type":31,"value":2472},"重构一个函数",{"type":26,"tag":113,"props":2474,"children":2475},{"align":2416},[2476],{"type":31,"value":2477},"中",{"type":26,"tag":113,"props":2479,"children":2480},{"align":2416},[2481],{"type":31,"value":2477},{"type":26,"tag":113,"props":2483,"children":2484},{},[2485,2487],{"type":31,"value":2486},"Cursor ",{"type":26,"tag":289,"props":2488,"children":2490},{"className":2489},[],[2491],{"type":31,"value":2492},"内联编辑",{"type":26,"tag":113,"props":2494,"children":2495},{},[2496],{"type":31,"value":2497},"需要解释、需要约束输出",{"type":26,"tag":91,"props":2499,"children":2500},{},[2501,2506,2510,2514,2519],{"type":26,"tag":113,"props":2502,"children":2503},{},[2504],{"type":31,"value":2505},"改一个组件 + 样式",{"type":26,"tag":113,"props":2507,"children":2508},{"align":2416},[2509],{"type":31,"value":2477},{"type":26,"tag":113,"props":2511,"children":2512},{"align":2416},[2513],{"type":31,"value":2477},{"type":26,"tag":113,"props":2515,"children":2516},{},[2517],{"type":31,"value":2518},"Cursor（小范围多文件）",{"type":26,"tag":113,"props":2520,"children":2521},{},[2522],{"type":31,"value":2523},"需要同时改模板与样式",{"type":26,"tag":91,"props":2525,"children":2526},{},[2527,2532,2537,2541,2546],{"type":26,"tag":113,"props":2528,"children":2529},{},[2530],{"type":31,"value":2531},"改 3~5 个文件（组件+api+测试）",{"type":26,"tag":113,"props":2533,"children":2534},{"align":2416},[2535],{"type":31,"value":2536},"高",{"type":26,"tag":113,"props":2538,"children":2539},{"align":2416},[2540],{"type":31,"value":2536},{"type":26,"tag":113,"props":2542,"children":2543},{},[2544],{"type":31,"value":2545},"Cursor Composer + 闸门",{"type":26,"tag":113,"props":2547,"children":2548},{},[2549],{"type":31,"value":2550},"需要计划、验收、回滚",{"type":26,"tag":91,"props":2552,"children":2553},{},[2554,2559,2564,2568,2573],{"type":26,"tag":113,"props":2555,"children":2556},{},[2557],{"type":31,"value":2558},"重写一段架构/引入新依赖",{"type":26,"tag":113,"props":2560,"children":2561},{"align":2416},[2562],{"type":31,"value":2563},"很高",{"type":26,"tag":113,"props":2565,"children":2566},{"align":2416},[2567],{"type":31,"value":2563},{"type":26,"tag":113,"props":2569,"children":2570},{},[2571],{"type":31,"value":2572},"先人脑设计 + VS Code 实现",{"type":26,"tag":113,"props":2574,"children":2575},{},[2576],{"type":31,"value":2577},"AI 易发散，最好先设计再执行",{"type":26,"tag":91,"props":2579,"children":2580},{},[2581,2586,2590,2594,2599],{"type":26,"tag":113,"props":2582,"children":2583},{},[2584],{"type":31,"value":2585},"排查线上问题/性能抖动",{"type":26,"tag":113,"props":2587,"children":2588},{"align":2416},[2589],{"type":31,"value":2536},{"type":26,"tag":113,"props":2591,"children":2592},{"align":2416},[2593],{"type":31,"value":2563},{"type":26,"tag":113,"props":2595,"children":2596},{},[2597],{"type":31,"value":2598},"VS Code + 工具链优先，AI 辅助归纳",{"type":26,"tag":113,"props":2600,"children":2601},{},[2602],{"type":31,"value":2603},"需要证据，不要“猜”",{"type":26,"tag":27,"props":2605,"children":2606},{},[2607],{"type":26,"tag":1167,"props":2608,"children":2609},{},[2610],{"type":31,"value":2611},"一句话规则：",{"type":26,"tag":184,"props":2613,"children":2614},{},[2615,2620],{"type":26,"tag":188,"props":2616,"children":2617},{},[2618],{"type":31,"value":2619},"当你的改动可以用“10 条最小回归集”覆盖时，用 Cursor。",{"type":26,"tag":188,"props":2621,"children":2622},{},[2623],{"type":31,"value":2624},"当你的改动无法验证时，先别让 AI 动手。",{"type":26,"tag":1228,"props":2626,"children":2627},{},[],{"type":26,"tag":76,"props":2629,"children":2631},{"id":2630},"差异拆解到底差在哪里",[2632],{"type":31,"value":2633},"差异拆解：到底差在哪里？",{"type":26,"tag":1554,"props":2635,"children":2637},{"id":2636},"_1-上下文来源补全-vs-项目索引",[2638],{"type":31,"value":2639},"1) 上下文来源：补全 vs 项目索引",{"type":26,"tag":184,"props":2641,"children":2642},{},[2643,2648],{"type":26,"tag":188,"props":2644,"children":2645},{},[2646],{"type":31,"value":2647},"Copilot 更擅长：你正在写的这几行、当前文件的局部上下文",{"type":26,"tag":188,"props":2649,"children":2650},{},[2651],{"type":31,"value":2652},"Cursor 更擅长：项目级索引 + 多文件关联理解",{"type":26,"tag":27,"props":2654,"children":2655},{},[2656],{"type":31,"value":2657},"因此：",{"type":26,"tag":184,"props":2659,"children":2660},{},[2661,2666],{"type":26,"tag":188,"props":2662,"children":2663},{},[2664],{"type":31,"value":2665},"写代码片段：Copilot 速度更快",{"type":26,"tag":188,"props":2667,"children":2668},{},[2669],{"type":31,"value":2670},"改一坨工程：Cursor 更有胜算（但更需要闸门）",{"type":26,"tag":1554,"props":2672,"children":2674},{"id":2673},"_2-交互方式你能不能控制范围",[2675],{"type":31,"value":2676},"2) 交互方式：你能不能控制范围",{"type":26,"tag":27,"props":2678,"children":2679},{},[2680],{"type":31,"value":2681},"范围控制的三个层级：",{"type":26,"tag":1158,"props":2683,"children":2684},{},[2685,2695,2705],{"type":26,"tag":188,"props":2686,"children":2687},{},[2688,2690],{"type":31,"value":2689},"内联编辑（选中一段）→ ",{"type":26,"tag":1167,"props":2691,"children":2692},{},[2693],{"type":31,"value":2694},"最强范围控制",{"type":26,"tag":188,"props":2696,"children":2697},{},[2698,2700],{"type":31,"value":2699},"Composer 多文件（先列文件清单）→ ",{"type":26,"tag":1167,"props":2701,"children":2702},{},[2703],{"type":31,"value":2704},"可控但要闸门",{"type":26,"tag":188,"props":2706,"children":2707},{},[2708,2710],{"type":31,"value":2709},"大对话（泛目标）→ ",{"type":26,"tag":1167,"props":2711,"children":2712},{},[2713],{"type":31,"value":2714},"最容易跑偏",{"type":26,"tag":1554,"props":2716,"children":2718},{"id":2717},"_3-输出形态建议-vs-可审查的变更",[2719],{"type":31,"value":2720},"3) 输出形态：建议 vs 可审查的变更",{"type":26,"tag":27,"props":2722,"children":2723},{},[2724],{"type":31,"value":2725},"最好的 AI 输出不是“给我一段代码”，而是：",{"type":26,"tag":184,"props":2727,"children":2728},{},[2729,2734,2739],{"type":26,"tag":188,"props":2730,"children":2731},{},[2732],{"type":31,"value":2733},"改动摘要（做了什么）",{"type":26,"tag":188,"props":2735,"children":2736},{},[2737],{"type":31,"value":2738},"diff 级别的可审查变更",{"type":26,"tag":188,"props":2740,"children":2741},{},[2742],{"type":31,"value":2743},"验收步骤与回滚方案",{"type":26,"tag":1228,"props":2745,"children":2746},{},[],{"type":26,"tag":76,"props":2748,"children":2750},{"id":2749},"一套可落地的团队工作流把风险关住",[2751],{"type":31,"value":2752},"一套可落地的团队工作流（把风险关住）",{"type":26,"tag":27,"props":2754,"children":2755},{},[2756],{"type":31,"value":2757},"下面这套流程，你可以直接写进团队规范：",{"type":26,"tag":1554,"props":2759,"children":2761},{"id":2760},"step-1先写任务单geo-友好结构",[2762],{"type":31,"value":2763},"Step 1：先写任务单（GEO 友好结构）",{"type":26,"tag":27,"props":2765,"children":2766},{},[2767],{"type":31,"value":2768},"模板：",{"type":26,"tag":184,"props":2770,"children":2771},{},[2772,2777,2782,2787,2792,2797],{"type":26,"tag":188,"props":2773,"children":2774},{},[2775],{"type":31,"value":2776},"目标：……",{"type":26,"tag":188,"props":2778,"children":2779},{},[2780],{"type":31,"value":2781},"背景：……",{"type":26,"tag":188,"props":2783,"children":2784},{},[2785],{"type":31,"value":2786},"范围：只改这些文件/模块：……",{"type":26,"tag":188,"props":2788,"children":2789},{},[2790],{"type":31,"value":2791},"非目标：不做哪些事情：……",{"type":26,"tag":188,"props":2793,"children":2794},{},[2795],{"type":31,"value":2796},"验收：如何判断完成（可测试/可观察）：……",{"type":26,"tag":188,"props":2798,"children":2799},{},[2800],{"type":31,"value":2801},"回滚：如果失败怎么撤回：……",{"type":26,"tag":1554,"props":2803,"children":2805},{"id":2804},"step-2用范围闸门限制-ai",[2806],{"type":31,"value":2807},"Step 2：用“范围闸门”限制 AI",{"type":26,"tag":184,"props":2809,"children":2810},{},[2811,2816],{"type":26,"tag":188,"props":2812,"children":2813},{},[2814],{"type":31,"value":2815},"单文件改动：优先 Cursor 内联编辑",{"type":26,"tag":188,"props":2817,"children":2818},{},[2819],{"type":31,"value":2820},"多文件改动：必须先让 AI 输出“文件清单（≤5）+ 每步验收”",{"type":26,"tag":27,"props":2822,"children":2823},{},[2824],{"type":31,"value":2825},"如果 AI 输出的文件清单超过 5 个：",{"type":26,"tag":184,"props":2827,"children":2828},{},[2829,2834],{"type":26,"tag":188,"props":2830,"children":2831},{},[2832],{"type":31,"value":2833},"不是它太强，是任务太大",{"type":26,"tag":188,"props":2835,"children":2836},{},[2837],{"type":31,"value":2838},"你需要拆任务，而不是继续推进",{"type":26,"tag":1554,"props":2840,"children":2842},{"id":2841},"step-3最小回归集10-条",[2843],{"type":31,"value":2844},"Step 3：最小回归集（10 条）",{"type":26,"tag":27,"props":2846,"children":2847},{},[2848,2850,2855],{"type":31,"value":2849},"每次接受改动前必须跑（可参考：",{"type":26,"tag":44,"props":2851,"children":2852},{"href":1112},[2853],{"type":31,"value":2854},"Cursor 快捷键速查表",{"type":31,"value":2856}," 里的清单）。",{"type":26,"tag":1554,"props":2858,"children":2860},{"id":2859},"step-4回滚策略不用等事故才想",[2861],{"type":31,"value":2862},"Step 4：回滚策略（不用等事故才想）",{"type":26,"tag":27,"props":2864,"children":2865},{},[2866],{"type":31,"value":2867},"回滚最常见的两条路：",{"type":26,"tag":184,"props":2869,"children":2870},{},[2871,2876],{"type":26,"tag":188,"props":2872,"children":2873},{},[2874],{"type":31,"value":2875},"git 回滚 commit",{"type":26,"tag":188,"props":2877,"children":2878},{},[2879],{"type":31,"value":2880},"对关键文件保留前版本（至少能快速恢复）",{"type":26,"tag":27,"props":2882,"children":2883},{},[2884],{"type":31,"value":2885},"你需要做到：任何一轮 AI 改动都能在 5 分钟内撤回。",{"type":26,"tag":1228,"props":2887,"children":2888},{},[],{"type":26,"tag":76,"props":2890,"children":2892},{"id":2891},"必交付物对比矩阵可复制",[2893],{"type":31,"value":2894},"必交付物：对比矩阵（可复制）",{"type":26,"tag":27,"props":2896,"children":2897},{},[2898],{"type":31,"value":2899},"下面这张表可以直接贴到你的团队 wiki：",{"type":26,"tag":83,"props":2901,"children":2902},{},[2903,2926],{"type":26,"tag":87,"props":2904,"children":2905},{},[2906],{"type":26,"tag":91,"props":2907,"children":2908},{},[2909,2914,2918,2922],{"type":26,"tag":95,"props":2910,"children":2911},{},[2912],{"type":31,"value":2913},"维度",{"type":26,"tag":95,"props":2915,"children":2916},{},[2917],{"type":31,"value":1120},{"type":26,"tag":95,"props":2919,"children":2920},{},[2921],{"type":31,"value":2366},{"type":26,"tag":95,"props":2923,"children":2924},{},[2925],{"type":31,"value":1117},{"type":26,"tag":106,"props":2927,"children":2928},{},[2929,2952,2975,2998],{"type":26,"tag":91,"props":2930,"children":2931},{},[2932,2937,2942,2947],{"type":26,"tag":113,"props":2933,"children":2934},{},[2935],{"type":31,"value":2936},"强项",{"type":26,"tag":113,"props":2938,"children":2939},{},[2940],{"type":31,"value":2941},"工具链、调试、生态",{"type":26,"tag":113,"props":2943,"children":2944},{},[2945],{"type":31,"value":2946},"补全与局部建议",{"type":26,"tag":113,"props":2948,"children":2949},{},[2950],{"type":31,"value":2951},"项目上下文、多文件落地",{"type":26,"tag":91,"props":2953,"children":2954},{},[2955,2960,2965,2970],{"type":26,"tag":113,"props":2956,"children":2957},{},[2958],{"type":31,"value":2959},"适合任务",{"type":26,"tag":113,"props":2961,"children":2962},{},[2963],{"type":31,"value":2964},"排查、调试、验证",{"type":26,"tag":113,"props":2966,"children":2967},{},[2968],{"type":31,"value":2969},"写一段、补一段",{"type":26,"tag":113,"props":2971,"children":2972},{},[2973],{"type":31,"value":2974},"改一段、改一组文件",{"type":26,"tag":91,"props":2976,"children":2977},{},[2978,2983,2988,2993],{"type":26,"tag":113,"props":2979,"children":2980},{},[2981],{"type":31,"value":2982},"最大风险",{"type":26,"tag":113,"props":2984,"children":2985},{},[2986],{"type":31,"value":2987},"无",{"type":26,"tag":113,"props":2989,"children":2990},{},[2991],{"type":31,"value":2992},"过度依赖建议",{"type":26,"tag":113,"props":2994,"children":2995},{},[2996],{"type":31,"value":2997},"范围漂移、多文件回归",{"type":26,"tag":91,"props":2999,"children":3000},{},[3001,3006,3011,3016],{"type":26,"tag":113,"props":3002,"children":3003},{},[3004],{"type":31,"value":3005},"必须搭配",{"type":26,"tag":113,"props":3007,"children":3008},{},[3009],{"type":31,"value":3010},"规范与检查",{"type":26,"tag":113,"props":3012,"children":3013},{},[3014],{"type":31,"value":3015},"代码评审",{"type":26,"tag":113,"props":3017,"children":3018},{},[3019],{"type":31,"value":3020},"闸门 + 最小回归集",{"type":26,"tag":1228,"props":3022,"children":3023},{},[],{"type":26,"tag":76,"props":3025,"children":3027},{"id":3026},"失败案例多文件看似成功实际埋雷",[3028],{"type":31,"value":3029},"失败案例：多文件“看似成功”，实际埋雷",{"type":26,"tag":27,"props":3031,"children":3032},{},[3033,3038],{"type":26,"tag":1167,"props":3034,"children":3035},{},[3036],{"type":31,"value":3037},"现象",{"type":31,"value":3039},"：AI 说“我已经把所有地方都改了”，你也接受了，结果上线后 404 或样式错位。",{"type":26,"tag":27,"props":3041,"children":3042},{},[3043,3048],{"type":26,"tag":1167,"props":3044,"children":3045},{},[3046],{"type":31,"value":3047},"复现条件",{"type":31,"value":1860},{"type":26,"tag":184,"props":3050,"children":3051},{},[3052,3057,3062],{"type":26,"tag":188,"props":3053,"children":3054},{},[3055],{"type":31,"value":3056},"你给了一个大目标（例如“把所有按钮统一成主题色”）",{"type":26,"tag":188,"props":3058,"children":3059},{},[3060],{"type":31,"value":3061},"它改了组件、样式、甚至主题配置",{"type":26,"tag":188,"props":3063,"children":3064},{},[3065],{"type":31,"value":3066},"你没有按页面模块走一遍，直接合并",{"type":26,"tag":27,"props":3068,"children":3069},{},[3070,3075],{"type":26,"tag":1167,"props":3071,"children":3072},{},[3073],{"type":31,"value":3074},"根因",{"type":31,"value":1860},{"type":26,"tag":184,"props":3077,"children":3078},{},[3079],{"type":26,"tag":188,"props":3080,"children":3081},{},[3082],{"type":31,"value":3083},"改动范围大，但验收仍按“小改动”的方式做（只看一处）",{"type":26,"tag":27,"props":3085,"children":3086},{},[3087,3092],{"type":26,"tag":1167,"props":3088,"children":3089},{},[3090],{"type":31,"value":3091},"修复",{"type":31,"value":1860},{"type":26,"tag":184,"props":3094,"children":3095},{},[3096,3101,3106],{"type":26,"tag":188,"props":3097,"children":3098},{},[3099],{"type":31,"value":3100},"强制把任务拆成“模块级目标”：Hero、Feature、Pricing、Form",{"type":26,"tag":188,"props":3102,"children":3103},{},[3104],{"type":31,"value":3105},"每个模块改完就验收一次",{"type":26,"tag":188,"props":3107,"children":3108},{},[3109],{"type":31,"value":3110},"验收通过再进入下一个模块",{"type":26,"tag":1228,"props":3112,"children":3113},{},[],{"type":26,"tag":76,"props":3115,"children":3117},{"id":3116},"faq",[3118],{"type":31,"value":3119},"FAQ",{"type":26,"tag":1554,"props":3121,"children":3123},{"id":3122},"q1我已经用了-cursor为什么还要用-copilot",[3124],{"type":31,"value":3125},"Q1：我已经用了 Cursor，为什么还要用 Copilot？",{"type":26,"tag":27,"props":3127,"children":3128},{},[3129],{"type":31,"value":3130},"因为“补全”这种高频低风险任务，Copilot 的交互成本更低；Cursor 更适合需要解释与约束的改动。",{"type":26,"tag":1554,"props":3132,"children":3134},{"id":3133},"q2什么时候应该完全不用-ai",[3135],{"type":31,"value":3136},"Q2：什么时候应该完全不用 AI？",{"type":26,"tag":27,"props":3138,"children":3139},{},[3140],{"type":31,"value":3141},"当你无法定义验收标准时。比如“更高级”“更好看”这种目标，先做信息结构与设计规则，再让 AI 帮你落地局部。",{"type":26,"tag":1228,"props":3143,"children":3144},{},[],{"type":26,"tag":76,"props":3146,"children":3148},{"id":3147},"延伸阅读",[3149],{"type":31,"value":3147},{"type":26,"tag":184,"props":3151,"children":3152},{},[3153,3162,3171,3180],{"type":26,"tag":188,"props":3154,"children":3155},{},[3156,3158],{"type":31,"value":3157},"Cursor 入门：",{"type":26,"tag":44,"props":3159,"children":3160},{"href":1201},[3161],{"type":31,"value":1204},{"type":26,"tag":188,"props":3163,"children":3164},{},[3165,3167],{"type":31,"value":3166},"Cursor 进阶：",{"type":26,"tag":44,"props":3168,"children":3169},{"href":1212},[3170],{"type":31,"value":1215},{"type":26,"tag":188,"props":3172,"children":3173},{},[3174,3176],{"type":31,"value":3175},"规则配置：",{"type":26,"tag":44,"props":3177,"children":3178},{"href":1223},[3179],{"type":31,"value":1226},{"type":26,"tag":188,"props":3181,"children":3182},{},[3183,3185],{"type":31,"value":3184},"Copilot 实战：",{"type":26,"tag":44,"props":3186,"children":3188},{"href":3187},"/topics/ai/github-copilot-tips",[3189],{"type":31,"value":3190},"GitHub Copilot 实用技巧",{"title":7,"searchDepth":1088,"depth":1088,"links":3192},[3193,3194,3195,3200,3206,3207,3208,3212],{"id":2338,"depth":1091,"text":2341},{"id":2388,"depth":1091,"text":2391},{"id":2630,"depth":1091,"text":2633,"children":3196},[3197,3198,3199],{"id":2636,"depth":1088,"text":2639},{"id":2673,"depth":1088,"text":2676},{"id":2717,"depth":1088,"text":2720},{"id":2749,"depth":1091,"text":2752,"children":3201},[3202,3203,3204,3205],{"id":2760,"depth":1088,"text":2763},{"id":2804,"depth":1088,"text":2807},{"id":2841,"depth":1088,"text":2844},{"id":2859,"depth":1088,"text":2862},{"id":2891,"depth":1091,"text":2894},{"id":3026,"depth":1091,"text":3029},{"id":3116,"depth":1091,"text":3119,"children":3209},[3210,3211],{"id":3122,"depth":1088,"text":3125},{"id":3133,"depth":1088,"text":3136},{"id":3147,"depth":1091,"text":3147},"content:topics:ai:cursor-vs-copilot-vscode-workflow.md","topics/ai/cursor-vs-copilot-vscode-workflow.md","topics/ai/cursor-vs-copilot-vscode-workflow",{"_path":3217,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":3218,"description":3219,"date":3220,"topic":5,"author":11,"tags":3221,"image":3226,"featured":937,"readingTime":2279,"body":3227,"_type":1104,"_id":3874,"_source":1106,"_file":3875,"_stem":3876,"_extension":1109},"/topics/ai/ai-debugging-troubleshooting-guide","AI 辅助调试与问题排查：让 AI 成为你的调试搭档","深入探讨如何利用 AI 工具提升调试效率，包括错误信息分析、日志解读、性能问题定位、复杂 bug 排查等实战场景，构建 AI 驱动的调试工作流。","2026-01-18",[3222,3223,3224,1121,3225],"AI 调试","问题排查","Debug","错误处理","/images/topics/ai/ai-debugging-guide.jpg",{"type":23,"children":3228,"toc":3845},[3229,3235,3241,3246,3251,3256,3262,3268,3273,3281,3309,3317,3340,3346,3356,3365,3373,3381,3414,3422,3451,3464,3472,3477,3485,3493,3504,3510,3518,3529,3537,3546,3552,3558,3563,3572,3578,3583,3592,3598,3604,3613,3619,3628,3634,3645,3651,3657,3666,3672,3681,3687,3693,3701,3707,3716,3724,3732,3735,3741,3746,3765,3777,3780,3786,3791,3800,3805,3808,3814,3819,3837],{"type":26,"tag":76,"props":3230,"children":3232},{"id":3231},"ai-辅助调试与问题排查",[3233],{"type":31,"value":3234},"AI 辅助调试与问题排查",{"type":26,"tag":76,"props":3236,"children":3238},{"id":3237},"引言调试的痛与-ai-的解药",[3239],{"type":31,"value":3240},"引言：调试的痛与 AI 的解药",{"type":26,"tag":27,"props":3242,"children":3243},{},[3244],{"type":31,"value":3245},"调试是每个程序员的日常，也是最消耗时间和精力的工作之一。我们都有过这样的经历：盯着一个莫名其妙的错误信息，翻遍 Stack Overflow，尝试各种方案，几个小时后才发现是一个愚蠢的拼写错误。",{"type":26,"tag":27,"props":3247,"children":3248},{},[3249],{"type":31,"value":3250},"AI 工具的出现，正在改变调试的方式。不是替代你的思考，而是加速你的分析过程——帮你快速理解错误、缩小排查范围、验证假设。",{"type":26,"tag":27,"props":3252,"children":3253},{},[3254],{"type":31,"value":3255},"这篇文章分享我在实际项目中使用 AI 辅助调试的经验和方法论。",{"type":26,"tag":76,"props":3257,"children":3259},{"id":3258},"第一部分建立-ai-调试的思维模型",[3260],{"type":31,"value":3261},"第一部分：建立 AI 调试的思维模型",{"type":26,"tag":1554,"props":3263,"children":3265},{"id":3264},"_11-ai-在调试中的角色",[3266],{"type":31,"value":3267},"1.1 AI 在调试中的角色",{"type":26,"tag":27,"props":3269,"children":3270},{},[3271],{"type":31,"value":3272},"把 AI 想象成一个经验丰富但不了解你项目的高级工程师。它：",{"type":26,"tag":27,"props":3274,"children":3275},{},[3276],{"type":26,"tag":1167,"props":3277,"children":3278},{},[3279],{"type":31,"value":3280},"擅长的事情：",{"type":26,"tag":184,"props":3282,"children":3283},{},[3284,3289,3294,3299,3304],{"type":26,"tag":188,"props":3285,"children":3286},{},[3287],{"type":31,"value":3288},"解读错误信息的含义",{"type":26,"tag":188,"props":3290,"children":3291},{},[3292],{"type":31,"value":3293},"提供可能的原因列表",{"type":26,"tag":188,"props":3295,"children":3296},{},[3297],{"type":31,"value":3298},"给出排查方向建议",{"type":26,"tag":188,"props":3300,"children":3301},{},[3302],{"type":31,"value":3303},"解释复杂的技术概念",{"type":26,"tag":188,"props":3305,"children":3306},{},[3307],{"type":31,"value":3308},"生成调试代码片段",{"type":26,"tag":27,"props":3310,"children":3311},{},[3312],{"type":26,"tag":1167,"props":3313,"children":3314},{},[3315],{"type":31,"value":3316},"不擅长的事情：",{"type":26,"tag":184,"props":3318,"children":3319},{},[3320,3325,3330,3335],{"type":26,"tag":188,"props":3321,"children":3322},{},[3323],{"type":31,"value":3324},"了解你的业务逻辑",{"type":26,"tag":188,"props":3326,"children":3327},{},[3328],{"type":31,"value":3329},"知道你的代码历史",{"type":26,"tag":188,"props":3331,"children":3332},{},[3333],{"type":31,"value":3334},"理解项目特定的约定",{"type":26,"tag":188,"props":3336,"children":3337},{},[3338],{"type":31,"value":3339},"做出架构级判断",{"type":26,"tag":1554,"props":3341,"children":3343},{"id":3342},"_12-有效提问的结构",[3344],{"type":31,"value":3345},"1.2 有效提问的结构",{"type":26,"tag":479,"props":3347,"children":3351},{"code":3348,"language":1104,"meta":7,"className":3349},"## 高效的调试提问模板\n\n**问题描述**\n[简洁描述遇到的问题]\n\n**错误信息**\n",[3350],"language-markdown",[3352],{"type":26,"tag":289,"props":3353,"children":3354},{"__ignoreMap":7},[3355],{"type":31,"value":3348},{"type":26,"tag":27,"props":3357,"children":3358},{},[3359],{"type":26,"tag":3360,"props":3361,"children":3362},"span",{},[3363],{"type":31,"value":3364},"完整的错误信息，不要截断",{"type":26,"tag":479,"props":3366,"children":3368},{"code":3367},"\n**相关代码**\n```javascript\n[精简但完整的相关代码]\n",[3369],{"type":26,"tag":289,"props":3370,"children":3371},{"__ignoreMap":7},[3372],{"type":31,"value":3367},{"type":26,"tag":27,"props":3374,"children":3375},{},[3376],{"type":26,"tag":1167,"props":3377,"children":3378},{},[3379],{"type":31,"value":3380},"环境信息",{"type":26,"tag":184,"props":3382,"children":3383},{},[3384,3394,3404],{"type":26,"tag":188,"props":3385,"children":3386},{},[3387,3389],{"type":31,"value":3388},"运行环境：",{"type":26,"tag":3360,"props":3390,"children":3391},{},[3392],{"type":31,"value":3393},"Node 版本/浏览器版本",{"type":26,"tag":188,"props":3395,"children":3396},{},[3397,3399],{"type":31,"value":3398},"框架版本：",{"type":26,"tag":3360,"props":3400,"children":3401},{},[3402],{"type":31,"value":3403},"相关框架版本",{"type":26,"tag":188,"props":3405,"children":3406},{},[3407,3409],{"type":31,"value":3408},"操作系统：",{"type":26,"tag":3360,"props":3410,"children":3411},{},[3412],{"type":31,"value":3413},"如果相关",{"type":26,"tag":27,"props":3415,"children":3416},{},[3417],{"type":26,"tag":1167,"props":3418,"children":3419},{},[3420],{"type":31,"value":3421},"已尝试的方案",{"type":26,"tag":184,"props":3423,"children":3424},{},[3425,3438],{"type":26,"tag":188,"props":3426,"children":3427},{},[3428,3433,3434],{"type":26,"tag":3360,"props":3429,"children":3430},{},[3431],{"type":31,"value":3432},"方案1",{"type":31,"value":1860},{"type":26,"tag":3360,"props":3435,"children":3436},{},[3437],{"type":31,"value":666},{"type":26,"tag":188,"props":3439,"children":3440},{},[3441,3446,3447],{"type":26,"tag":3360,"props":3442,"children":3443},{},[3444],{"type":31,"value":3445},"方案2",{"type":31,"value":1860},{"type":26,"tag":3360,"props":3448,"children":3449},{},[3450],{"type":31,"value":666},{"type":26,"tag":27,"props":3452,"children":3453},{},[3454,3459],{"type":26,"tag":1167,"props":3455,"children":3456},{},[3457],{"type":31,"value":3458},"期望的结果",{"type":26,"tag":3360,"props":3460,"children":3461},{},[3462],{"type":31,"value":3463},"描述期望的行为",{"type":26,"tag":479,"props":3465,"children":3467},{"code":3466},"\n### 1.3 分级调试策略\n\n",[3468],{"type":26,"tag":289,"props":3469,"children":3470},{"__ignoreMap":7},[3471],{"type":31,"value":3466},{"type":26,"tag":27,"props":3473,"children":3474},{},[3475],{"type":31,"value":3476},"┌───────────────────────────────────────────────────────────┐\n│                    AI 辅助调试决策树                        │\n├───────────────────────────────────────────────────────────┤\n│                                                           │\n│  Level 1：简单错误（5分钟内解决）                           │\n│  ├── 语法错误、拼写错误                                    │\n│  ├── 方法：直接复制错误信息给 AI                           │\n│  └── 工具：Copilot Chat / ChatGPT                        │\n│                                                           │\n│  Level 2：中等复杂度（30分钟内解决）                        │\n│  ├── 类型错误、逻辑错误、API 使用错误                      │\n│  ├── 方法：提供错误信息 + 相关代码 + 上下文                 │\n│  └── 工具：Cursor Chat / Claude                          │\n│                                                           │\n│  Level 3：复杂问题（需要深入分析）                          │\n│  ├── 竞态条件、内存泄漏、性能问题                          │\n│  ├── 方法：详细描述场景 + 提供多个文件 + 讨论               │\n│  └── 工具：Cursor Composer / 专门的 AI 会话                │\n│                                                           │\n│  Level 4：架构级问题                                       │\n│  ├── 设计缺陷、技术债务                                    │\n│  ├── 方法：AI 辅助分析 + 人工判断                          │\n│  └── 工具：与团队讨论 + AI 作为顾问                        │\n│                                                           │\n└───────────────────────────────────────────────────────────┘",{"type":26,"tag":479,"props":3478,"children":3480},{"code":3479},"\n## 第二部分：错误信息分析\n\n### 2.1 前端错误分析\n\n**场景 1：React 错误边界触发**\n\n```typescript\n// 错误信息：\n// Error: Hydration failed because the initial UI does not match \n// what was rendered on the server.\n\n// 提问方式：\n/**\n * 我在 Next.js 14 App Router 项目中遇到这个错误：\n * \n * Error: Hydration failed because the initial UI does not match \n * what was rendered on the server.\n * \n * 相关代码：\n */\nfunction UserStatus() {\n  const [isLoggedIn, setIsLoggedIn] = useState(false);\n  \n  useEffect(() => {\n    setIsLoggedIn(localStorage.getItem('token') !== null);\n  }, []);\n  \n  return \u003Cdiv>{isLoggedIn ? '已登录' : '未登录'}\u003C/div>;\n}\n\n// AI 会分析出：\n// 1. 服务端渲染时 localStorage 不可用，默认 false\n// 2. 客户端 hydration 时可能是 true\n// 3. 导致服务端和客户端渲染结果不一致\n\n// AI 建议的解决方案：\nfunction UserStatus() {\n  const [isLoggedIn, setIsLoggedIn] = useState\u003Cboolean | null>(null);\n  \n  useEffect(() => {\n    setIsLoggedIn(localStorage.getItem('token') !== null);\n  }, []);\n  \n  // 初始状态显示加载中，避免 hydration 不匹配\n  if (isLoggedIn === null) {\n    return \u003Cdiv>加载中...\u003C/div>;\n  }\n  \n  return \u003Cdiv>{isLoggedIn ? '已登录' : '未登录'}\u003C/div>;\n}\n",[3481],{"type":26,"tag":289,"props":3482,"children":3483},{"__ignoreMap":7},[3484],{"type":31,"value":3479},{"type":26,"tag":27,"props":3486,"children":3487},{},[3488],{"type":26,"tag":1167,"props":3489,"children":3490},{},[3491],{"type":31,"value":3492},"场景 2：Vue 响应式警告",{"type":26,"tag":479,"props":3494,"children":3499},{"code":3495,"language":3496,"meta":7,"className":3497},"// 警告信息：\n// [Vue warn]: Property \"xxx\" was accessed during render but is not \n// defined on instance.\n\n// 提问方式：\n/**\n * Vue 3 项目中出现这个警告：\n * [Vue warn]: Property \"userInfo\" was accessed during render \n * but is not defined on instance.\n * \n * 组件代码：\n */\n\u003Ctemplate>\n  \u003Cdiv>{{ userInfo.name }}\u003C/div>\n\u003C/template>\n\n\u003Cscript setup>\nconst { data: userInfo } = await useFetch('/api/user');\n\u003C/script>\n\n// AI 分析：\n// 1. useFetch 是异步的，初始渲染时 userInfo 可能是 undefined\n// 2. 直接访问 userInfo.name 会报错\n\n// AI 建议：\n\u003Ctemplate>\n  \u003Cdiv v-if=\"userInfo\">{{ userInfo.name }}\u003C/div>\n  \u003Cdiv v-else>加载中...\u003C/div>\n\u003C/template>\n\n\u003Cscript setup>\nconst { data: userInfo, pending } = await useFetch('/api/user');\n\u003C/script>\n","typescript",[3498],"language-typescript",[3500],{"type":26,"tag":289,"props":3501,"children":3502},{"__ignoreMap":7},[3503],{"type":31,"value":3495},{"type":26,"tag":1554,"props":3505,"children":3507},{"id":3506},"_22-后端错误分析",[3508],{"type":31,"value":3509},"2.2 后端错误分析",{"type":26,"tag":27,"props":3511,"children":3512},{},[3513],{"type":26,"tag":1167,"props":3514,"children":3515},{},[3516],{"type":31,"value":3517},"场景 1：Node.js 内存问题",{"type":26,"tag":479,"props":3519,"children":3524},{"code":3520,"language":3521,"meta":7,"className":3522},"// 错误信息：\n// FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - \n// JavaScript heap out of memory\n\n// 提问方式（包含上下文）：\n/**\n * Node.js 服务运行几小时后崩溃，错误信息：\n * FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - \n * JavaScript heap out of memory\n * \n * 服务功能：处理 CSV 文件上传，每次约 100MB\n * \n * 处理代码：\n */\nasync function processCSV(filePath) {\n  const content = fs.readFileSync(filePath, 'utf-8');\n  const rows = content.split('\\n');\n  const results = [];\n  \n  for (const row of rows) {\n    const processed = await processRow(row);\n    results.push(processed);\n  }\n  \n  return results;\n}\n\n// AI 分析会指出：\n// 1. 一次性读取整个文件到内存\n// 2. 所有处理结果累积在 results 数组\n// 3. 建议使用流式处理\n\n// AI 提供的优化方案：\nconst { createReadStream } = require('fs');\nconst { createInterface } = require('readline');\n\nasync function processCSVStream(filePath, onRow) {\n  const fileStream = createReadStream(filePath);\n  const rl = createInterface({\n    input: fileStream,\n    crlfDelay: Infinity\n  });\n  \n  let count = 0;\n  for await (const line of rl) {\n    await onRow(line);\n    count++;\n    \n    // 每处理 1000 行，给 GC 机会运行\n    if (count % 1000 === 0) {\n      await new Promise(r => setImmediate(r));\n    }\n  }\n}\n","javascript",[3523],"language-javascript",[3525],{"type":26,"tag":289,"props":3526,"children":3527},{"__ignoreMap":7},[3528],{"type":31,"value":3520},{"type":26,"tag":27,"props":3530,"children":3531},{},[3532],{"type":26,"tag":1167,"props":3533,"children":3534},{},[3535],{"type":31,"value":3536},"场景 2：数据库连接问题",{"type":26,"tag":479,"props":3538,"children":3541},{"code":3539,"language":3496,"meta":7,"className":3540},"// 错误信息：\n// Error: Connection pool exhausted - \n// max connections (10) already in use\n\n// 提问方式：\n/**\n * PostgreSQL 连接池耗尽错误，高并发时出现：\n * Error: Connection pool exhausted\n * \n * 当前配置：\n * - max connections: 10\n * - 并发请求: 约 100/秒\n * \n * 数据库调用代码：\n */\nasync function getUserData(userId: string) {\n  const client = await pool.connect();\n  try {\n    const user = await client.query('SELECT * FROM users WHERE id = $1', [userId]);\n    const orders = await client.query('SELECT * FROM orders WHERE user_id = $1', [userId]);\n    const payments = await client.query('SELECT * FROM payments WHERE user_id = $1', [userId]);\n    return { user: user.rows[0], orders: orders.rows, payments: payments.rows };\n  } finally {\n    client.release();\n  }\n}\n\n// AI 会分析出多个可能原因并给出综合方案\n",[3498],[3542],{"type":26,"tag":289,"props":3543,"children":3544},{"__ignoreMap":7},[3545],{"type":31,"value":3539},{"type":26,"tag":76,"props":3547,"children":3549},{"id":3548},"第三部分日志分析与问题定位",[3550],{"type":31,"value":3551},"第三部分：日志分析与问题定位",{"type":26,"tag":1554,"props":3553,"children":3555},{"id":3554},"_31-结构化日志分析",[3556],{"type":31,"value":3557},"3.1 结构化日志分析",{"type":26,"tag":27,"props":3559,"children":3560},{},[3561],{"type":31,"value":3562},"当面对大量日志时，让 AI 帮你快速定位问题：",{"type":26,"tag":479,"props":3564,"children":3567},{"code":3565,"language":3521,"meta":7,"className":3566},"// 提问示例：\n/**\n * 分析以下日志，找出导致请求失败的原因：\n * \n * 日志片段：\n */\nconst logs = `\n2024-01-15 10:23:45.123 INFO  [req-abc123] 收到请求 POST /api/order\n2024-01-15 10:23:45.125 DEBUG [req-abc123] 用户认证通过 userId=u001\n2024-01-15 10:23:45.130 DEBUG [req-abc123] 开始库存检查 productId=p001\n2024-01-15 10:23:45.145 DEBUG [req-abc123] 库存检查通过 available=50\n2024-01-15 10:23:45.150 DEBUG [req-abc123] 开始创建订单\n2024-01-15 10:23:45.200 DEBUG [req-abc123] 数据库连接获取成功\n2024-01-15 10:23:45.250 ERROR [req-abc123] 订单创建失败 error=\"deadlock detected\"\n2024-01-15 10:23:45.251 WARN  [req-abc123] 事务回滚\n2024-01-15 10:23:45.255 INFO  [req-abc123] 响应 500 耗时 132ms\n`;\n\n// AI 分析结果会包括：\n// 1. 问题定位：数据库死锁\n// 2. 可能原因：并发订单创建导致锁竞争\n// 3. 排查建议：检查事务隔离级别、锁顺序\n",[3523],[3568],{"type":26,"tag":289,"props":3569,"children":3570},{"__ignoreMap":7},[3571],{"type":31,"value":3565},{"type":26,"tag":1554,"props":3573,"children":3575},{"id":3574},"_32-创建调试日志",[3576],{"type":31,"value":3577},"3.2 创建调试日志",{"type":26,"tag":27,"props":3579,"children":3580},{},[3581],{"type":31,"value":3582},"让 AI 帮你生成调试用的日志代码：",{"type":26,"tag":479,"props":3584,"children":3587},{"code":3585,"language":3496,"meta":7,"className":3586},"// 请求：\n// \"为这个函数添加详细的调试日志，包括入参、关键步骤、耗时和结果\"\n\n// 原代码：\nasync function processOrder(order: Order): Promise\u003COrderResult> {\n  const inventory = await checkInventory(order.items);\n  const payment = await processPayment(order.userId, order.total);\n  const result = await createOrder(order, payment.transactionId);\n  return result;\n}\n\n// AI 生成的带日志版本：\nasync function processOrder(order: Order): Promise\u003COrderResult> {\n  const requestId = generateRequestId();\n  const startTime = performance.now();\n  \n  logger.info({\n    requestId,\n    event: 'order_processing_start',\n    orderId: order.id,\n    userId: order.userId,\n    itemCount: order.items.length,\n    total: order.total\n  });\n  \n  try {\n    // 库存检查\n    const inventoryStart = performance.now();\n    const inventory = await checkInventory(order.items);\n    logger.debug({\n      requestId,\n      event: 'inventory_check_complete',\n      duration: performance.now() - inventoryStart,\n      available: inventory.allAvailable\n    });\n    \n    // 支付处理\n    const paymentStart = performance.now();\n    const payment = await processPayment(order.userId, order.total);\n    logger.debug({\n      requestId,\n      event: 'payment_complete',\n      duration: performance.now() - paymentStart,\n      transactionId: payment.transactionId\n    });\n    \n    // 创建订单\n    const createStart = performance.now();\n    const result = await createOrder(order, payment.transactionId);\n    logger.debug({\n      requestId,\n      event: 'order_created',\n      duration: performance.now() - createStart,\n      resultOrderId: result.orderId\n    });\n    \n    logger.info({\n      requestId,\n      event: 'order_processing_complete',\n      duration: performance.now() - startTime,\n      success: true\n    });\n    \n    return result;\n  } catch (error) {\n    logger.error({\n      requestId,\n      event: 'order_processing_failed',\n      duration: performance.now() - startTime,\n      error: error.message,\n      stack: error.stack\n    });\n    throw error;\n  }\n}\n",[3498],[3588],{"type":26,"tag":289,"props":3589,"children":3590},{"__ignoreMap":7},[3591],{"type":31,"value":3585},{"type":26,"tag":76,"props":3593,"children":3595},{"id":3594},"第四部分性能问题排查",[3596],{"type":31,"value":3597},"第四部分：性能问题排查",{"type":26,"tag":1554,"props":3599,"children":3601},{"id":3600},"_41-前端性能分析",[3602],{"type":31,"value":3603},"4.1 前端性能分析",{"type":26,"tag":479,"props":3605,"children":3608},{"code":3606,"language":3496,"meta":7,"className":3607},"// 场景：页面加载慢，需要分析原因\n\n// 提问方式：\n/**\n * 页面首屏加载需要 5 秒，以下是 Performance API 数据，\n * 请分析性能瓶颈：\n */\nconst performanceData = {\n  // Navigation Timing\n  dns: 50,           // DNS 查询\n  tcp: 100,          // TCP 连接\n  ttfb: 800,         // 首字节时间\n  download: 200,     // 文档下载\n  domParsing: 300,   // DOM 解析\n  domContentLoaded: 1500,\n  load: 5000,\n  \n  // Resource Timing (主要资源)\n  resources: [\n    { name: 'main.js', size: '2.5MB', duration: 1200 },\n    { name: 'vendor.js', size: '1.8MB', duration: 900 },\n    { name: 'styles.css', size: '500KB', duration: 300 },\n    { name: 'hero-image.jpg', size: '3MB', duration: 1500 },\n  ],\n  \n  // Long Tasks\n  longTasks: [\n    { startTime: 1600, duration: 800, name: 'script-evaluation' },\n    { startTime: 2500, duration: 400, name: 'layout' }\n  ]\n};\n\n// AI 会分析出：\n// 1. JS bundle 过大（4.3MB），需要代码分割\n// 2. 图片未优化（3MB 的 hero 图片）\n// 3. 存在长任务阻塞主线程\n// 并给出具体优化建议\n",[3498],[3609],{"type":26,"tag":289,"props":3610,"children":3611},{"__ignoreMap":7},[3612],{"type":31,"value":3606},{"type":26,"tag":1554,"props":3614,"children":3616},{"id":3615},"_42-内存泄漏排查",[3617],{"type":31,"value":3618},"4.2 内存泄漏排查",{"type":26,"tag":479,"props":3620,"children":3623},{"code":3621,"language":3496,"meta":7,"className":3622},"// 场景：应用运行一段时间后变卡\n\n// 提问方式：\n/**\n * React 应用运行一段时间后内存持续增长，以下是 Heap Snapshot 对比：\n * \n * 初始状态：50MB\n * 运行 1 小时后：150MB\n * 运行 2 小时后：280MB\n * \n * Retained objects 增长最快的：\n * - (closure) - 增长 50MB\n * - HTMLDivElement - 增长 30MB\n * - Array - 增长 20MB\n * \n * 可疑代码：\n */\nfunction DataDashboard() {\n  const [data, setData] = useState([]);\n  const chartRef = useRef(null);\n  \n  useEffect(() => {\n    // 每秒刷新数据\n    const interval = setInterval(async () => {\n      const newData = await fetchLatestData();\n      setData(prev => [...prev, ...newData]);  // 数据不断累积\n    }, 1000);\n    \n    // 初始化图表\n    const chart = new Chart(chartRef.current, {\n      // 配置...\n    });\n    \n    // 没有 cleanup！\n  }, []);\n  \n  return \u003Ccanvas ref={chartRef} />;\n}\n\n// AI 会指出：\n// 1. interval 没有清理\n// 2. Chart 实例没有销毁\n// 3. data 无限增长\n// 并提供修复代码\n",[3498],[3624],{"type":26,"tag":289,"props":3625,"children":3626},{"__ignoreMap":7},[3627],{"type":31,"value":3621},{"type":26,"tag":1554,"props":3629,"children":3631},{"id":3630},"_43-数据库查询优化",[3632],{"type":31,"value":3633},"4.3 数据库查询优化",{"type":26,"tag":479,"props":3635,"children":3640},{"code":3636,"language":3637,"meta":7,"className":3638},"-- 场景：查询很慢，让 AI 分析执行计划\n\n-- 提问方式：\n-- 以下查询在数据量大时很慢（orders 表 1000 万行），\n-- 执行计划如下，请分析并优化：\n\nEXPLAIN ANALYZE\nSELECT o.*, u.name, u.email\nFROM orders o\nJOIN users u ON o.user_id = u.id\nWHERE o.status = 'pending'\n  AND o.created_at > '2024-01-01'\nORDER BY o.created_at DESC\nLIMIT 20;\n\n-- 执行计划：\n/*\nSort  (cost=156847.23..157847.23 rows=400000 width=250)\n  Sort Key: o.created_at DESC\n  ->  Hash Join  (cost=1500.00..89847.23 rows=400000 width=250)\n        Hash Cond: (o.user_id = u.id)\n        ->  Seq Scan on orders o  (cost=0.00..85000.00 rows=400000)\n              Filter: ((status = 'pending') AND (created_at > '2024-01-01'))\n        ->  Hash  (cost=1000.00..1000.00 rows=50000 width=100)\n              ->  Seq Scan on users u  (cost=0.00..1000.00 rows=50000)\nPlanning Time: 0.5 ms\nExecution Time: 3500 ms\n*/\n\n-- AI 会分析出问题并建议：\n-- 1. orders 表全表扫描 - 需要复合索引\n-- 2. 建议创建索引：\nCREATE INDEX idx_orders_status_created ON orders(status, created_at DESC);\n\n-- 3. 如果 status 选择性不高，考虑部分索引：\nCREATE INDEX idx_orders_pending ON orders(created_at DESC) \nWHERE status = 'pending';\n","sql",[3639],"language-sql",[3641],{"type":26,"tag":289,"props":3642,"children":3643},{"__ignoreMap":7},[3644],{"type":31,"value":3636},{"type":26,"tag":76,"props":3646,"children":3648},{"id":3647},"第五部分复杂-bug-排查",[3649],{"type":31,"value":3650},"第五部分：复杂 Bug 排查",{"type":26,"tag":1554,"props":3652,"children":3654},{"id":3653},"_51-竞态条件",[3655],{"type":31,"value":3656},"5.1 竞态条件",{"type":26,"tag":479,"props":3658,"children":3661},{"code":3659,"language":3496,"meta":7,"className":3660},"// 场景：偶发的数据不一致问题\n\n// 提问方式：\n/**\n * 用户反馈偶尔看到错误的账户余额，但刷新后正常。\n * 怀疑是竞态条件，以下是相关代码：\n */\nasync function updateBalance(userId: string, amount: number) {\n  // 读取当前余额\n  const user = await db.users.findOne({ id: userId });\n  const newBalance = user.balance + amount;\n  \n  // 更新余额\n  await db.users.update({ id: userId }, { balance: newBalance });\n  \n  // 记录交易\n  await db.transactions.create({\n    userId,\n    amount,\n    balanceAfter: newBalance,\n    createdAt: new Date()\n  });\n  \n  return newBalance;\n}\n\n// 并发调用场景：\n// 用户同时发起两笔交易：+100 和 -50\n// 期望结果：原余额 1000 → 1050\n// 实际可能：原余额 1000 → 1100 或 950\n\n// AI 会分析竞态条件并提供解决方案：\nasync function updateBalanceAtomic(userId: string, amount: number) {\n  // 方案 1：使用数据库原子操作\n  const result = await db.users.findOneAndUpdate(\n    { id: userId },\n    { $inc: { balance: amount } },\n    { returnDocument: 'after' }\n  );\n  \n  await db.transactions.create({\n    userId,\n    amount,\n    balanceAfter: result.balance,\n    createdAt: new Date()\n  });\n  \n  return result.balance;\n}\n\n// 方案 2：使用乐观锁\nasync function updateBalanceOptimistic(userId: string, amount: number) {\n  const maxRetries = 3;\n  \n  for (let i = 0; i \u003C maxRetries; i++) {\n    const user = await db.users.findOne({ id: userId });\n    const newBalance = user.balance + amount;\n    \n    const updated = await db.users.updateOne(\n      { id: userId, version: user.version },\n      { balance: newBalance, version: user.version + 1 }\n    );\n    \n    if (updated.modifiedCount === 1) {\n      await db.transactions.create({...});\n      return newBalance;\n    }\n    \n    // 版本冲突，重试\n    await sleep(10 * (i + 1));\n  }\n  \n  throw new Error('Update failed after retries');\n}\n",[3498],[3662],{"type":26,"tag":289,"props":3663,"children":3664},{"__ignoreMap":7},[3665],{"type":31,"value":3659},{"type":26,"tag":1554,"props":3667,"children":3669},{"id":3668},"_52-分布式系统问题",[3670],{"type":31,"value":3671},"5.2 分布式系统问题",{"type":26,"tag":479,"props":3673,"children":3676},{"code":3674,"language":3496,"meta":7,"className":3675},"// 场景：微服务间的数据不一致\n\n// 提问方式：\n/**\n * 订单服务和库存服务偶尔出现数据不一致：\n * - 订单显示已创建\n * - 库存未扣减\n * \n * 当前流程：\n */\n// Order Service\nasync function createOrder(orderData) {\n  // 1. 调用库存服务扣减库存\n  await inventoryService.deduct(orderData.items);\n  \n  // 2. 创建订单\n  const order = await orderRepository.create(orderData);\n  \n  // 3. 发送订单创建事件\n  await eventBus.publish('order.created', order);\n  \n  return order;\n}\n\n// 问题分析：如果步骤 2 或 3 失败，库存已经扣减但订单未创建\n\n// AI 会建议使用 Saga 模式或事务发件箱模式\n",[3498],[3677],{"type":26,"tag":289,"props":3678,"children":3679},{"__ignoreMap":7},[3680],{"type":31,"value":3674},{"type":26,"tag":76,"props":3682,"children":3684},{"id":3683},"第六部分ai-调试工作流",[3685],{"type":31,"value":3686},"第六部分：AI 调试工作流",{"type":26,"tag":1554,"props":3688,"children":3690},{"id":3689},"_61-我的调试流程",[3691],{"type":31,"value":3692},"6.1 我的调试流程",{"type":26,"tag":479,"props":3694,"children":3696},{"code":3695},"┌────────────────────────────────────────────────────────────┐\n│                    AI 辅助调试工作流                         │\n├────────────────────────────────────────────────────────────┤\n│                                                            │\n│  Step 1: 问题收集                                          │\n│  ├── 复制完整错误信息                                       │\n│  ├── 截图相关日志                                          │\n│  └── 记录复现步骤                                          │\n│                                                            │\n│  Step 2: 快速分析                                          │\n│  ├── 将错误信息发给 AI                                      │\n│  ├── 获取可能原因列表                                       │\n│  └── 评估哪些最可能                                         │\n│                                                            │\n│  Step 3: 深入调查                                          │\n│  ├── 根据 AI 建议添加日志/断点                              │\n│  ├── 收集更多信息                                          │\n│  └── 再次询问 AI（带新信息）                                │\n│                                                            │\n│  Step 4: 验证修复                                          │\n│  ├── AI 生成修复代码                                        │\n│  ├── 人工审查确认                                          │\n│  └── 测试验证                                               │\n│                                                            │\n│  Step 5: 预防措施                                          │\n│  ├── AI 建议类似问题的预防方法                              │\n│  ├── 添加相关测试用例                                       │\n│  └── 更新文档/知识库                                        │\n│                                                            │\n└────────────────────────────────────────────────────────────┘\n",[3697],{"type":26,"tag":289,"props":3698,"children":3699},{"__ignoreMap":7},[3700],{"type":31,"value":3695},{"type":26,"tag":1554,"props":3702,"children":3704},{"id":3703},"_62-调试对话模板",[3705],{"type":31,"value":3706},"6.2 调试对话模板",{"type":26,"tag":479,"props":3708,"children":3711},{"code":3709,"language":1104,"meta":7,"className":3710},"## 第一轮：问题描述\n\n我遇到了一个问题：[简述问题]\n\n错误信息：\n",[3350],[3712],{"type":26,"tag":289,"props":3713,"children":3714},{"__ignoreMap":7},[3715],{"type":31,"value":3709},{"type":26,"tag":27,"props":3717,"children":3718},{},[3719],{"type":26,"tag":3360,"props":3720,"children":3721},{},[3722],{"type":31,"value":3723},"粘贴完整错误",{"type":26,"tag":479,"props":3725,"children":3727},{"code":3726},"\n相关代码：\n```javascript\n[粘贴代码]\n",[3728],{"type":26,"tag":289,"props":3729,"children":3730},{"__ignoreMap":7},[3731],{"type":31,"value":3726},{"type":26,"tag":1228,"props":3733,"children":3734},{},[],{"type":26,"tag":76,"props":3736,"children":3738},{"id":3737},"第二轮补充信息",[3739],{"type":31,"value":3740},"第二轮：补充信息",{"type":26,"tag":27,"props":3742,"children":3743},{},[3744],{"type":31,"value":3745},"根据你的建议，我添加了日志，发现：",{"type":26,"tag":184,"props":3747,"children":3748},{},[3749,3757],{"type":26,"tag":188,"props":3750,"children":3751},{},[3752],{"type":26,"tag":3360,"props":3753,"children":3754},{},[3755],{"type":31,"value":3756},"发现 1",{"type":26,"tag":188,"props":3758,"children":3759},{},[3760],{"type":26,"tag":3360,"props":3761,"children":3762},{},[3763],{"type":31,"value":3764},"发现 2",{"type":26,"tag":27,"props":3766,"children":3767},{},[3768,3770,3775],{"type":31,"value":3769},"这是否说明问题出在 ",{"type":26,"tag":3360,"props":3771,"children":3772},{},[3773],{"type":31,"value":3774},"你的猜测",{"type":31,"value":3776},"？",{"type":26,"tag":1228,"props":3778,"children":3779},{},[],{"type":26,"tag":76,"props":3781,"children":3783},{"id":3782},"第三轮确认修复",[3784],{"type":31,"value":3785},"第三轮：确认修复",{"type":26,"tag":27,"props":3787,"children":3788},{},[3789],{"type":31,"value":3790},"我按照你的建议修改了代码：",{"type":26,"tag":479,"props":3792,"children":3795},{"code":3793,"language":3521,"meta":7,"className":3794},"[粘贴修改后的代码]\n",[3523],[3796],{"type":26,"tag":289,"props":3797,"children":3798},{"__ignoreMap":7},[3799],{"type":31,"value":3793},{"type":26,"tag":27,"props":3801,"children":3802},{},[3803],{"type":31,"value":3804},"请确认这个修复是否正确，以及是否有其他潜在问题。",{"type":26,"tag":1228,"props":3806,"children":3807},{},[],{"type":26,"tag":76,"props":3809,"children":3811},{"id":3810},"第四轮预防",[3812],{"type":31,"value":3813},"第四轮：预防",{"type":26,"tag":27,"props":3815,"children":3816},{},[3817],{"type":31,"value":3818},"这个问题已解决。请建议：",{"type":26,"tag":1158,"props":3820,"children":3821},{},[3822,3827,3832],{"type":26,"tag":188,"props":3823,"children":3824},{},[3825],{"type":31,"value":3826},"如何防止类似问题再次发生？",{"type":26,"tag":188,"props":3828,"children":3829},{},[3830],{"type":31,"value":3831},"应该添加什么测试用例？",{"type":26,"tag":188,"props":3833,"children":3834},{},[3835],{"type":31,"value":3836},"有什么最佳实践可以参考？",{"type":26,"tag":479,"props":3838,"children":3840},{"code":3839},"\n## 结语：AI 是放大器，不是替代品\n\nAI 调试工具能够显著加速问题排查过程，但它不能替代你的思考。最有价值的能力组合是：\n\n- **你的领域知识** + **AI 的广博见识**\n- **你对项目的理解** + **AI 的分析能力**\n- **你的判断力** + **AI 的执行速度**\n\n调试的本质是假设-验证的循环。AI 帮你更快地生成假设、更高效地验证假设，但做出最终判断的还是你。\n\n学会与 AI 高效协作调试，不是依赖 AI 给你答案，而是让 AI 帮你更快地找到自己的答案。\n\n---\n\n## 参考资源\n\n- [Chrome DevTools 官方文档](https://developer.chrome.com/docs/devtools)\n- [Node.js 调试指南](https://nodejs.org/en/docs/guides/debugging-getting-started)\n- [React DevTools 使用指南](https://react.dev/learn/react-developer-tools)\n",[3841],{"type":26,"tag":289,"props":3842,"children":3843},{"__ignoreMap":7},[3844],{"type":31,"value":3839},{"title":7,"searchDepth":1088,"depth":1088,"links":3846},[3847,3848,3849,3854,3858,3863,3867,3871,3872,3873],{"id":3231,"depth":1091,"text":3234},{"id":3237,"depth":1091,"text":3240},{"id":3258,"depth":1091,"text":3261,"children":3850},[3851,3852,3853],{"id":3264,"depth":1088,"text":3267},{"id":3342,"depth":1088,"text":3345},{"id":3506,"depth":1088,"text":3509},{"id":3548,"depth":1091,"text":3551,"children":3855},[3856,3857],{"id":3554,"depth":1088,"text":3557},{"id":3574,"depth":1088,"text":3577},{"id":3594,"depth":1091,"text":3597,"children":3859},[3860,3861,3862],{"id":3600,"depth":1088,"text":3603},{"id":3615,"depth":1088,"text":3618},{"id":3630,"depth":1088,"text":3633},{"id":3647,"depth":1091,"text":3650,"children":3864},[3865,3866],{"id":3653,"depth":1088,"text":3656},{"id":3668,"depth":1088,"text":3671},{"id":3683,"depth":1091,"text":3686,"children":3868},[3869,3870],{"id":3689,"depth":1088,"text":3692},{"id":3703,"depth":1088,"text":3706},{"id":3737,"depth":1091,"text":3740},{"id":3782,"depth":1091,"text":3785},{"id":3810,"depth":1091,"text":3813},"content:topics:ai:ai-debugging-troubleshooting-guide.md","topics/ai/ai-debugging-troubleshooting-guide.md","topics/ai/ai-debugging-troubleshooting-guide",{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":3878,"image":17,"imageQuery":18,"pexelsPhotoId":19,"pexelsUrl":20,"featured":6,"readingTime":21,"body":3879,"_type":1104,"_id":1105,"_source":1106,"_file":1107,"_stem":1108,"_extension":1109},[13,14,15,16],{"type":23,"children":3880,"toc":4746},[3881,3885,3889,3913,3917,3981,3985,3989,3993,3997,4012,4016,4020,4035,4039,4043,4047,4058,4062,4073,4077,4099,4103,4107,4171,4175,4179,4206,4210,4214,4218,4233,4237,4245,4249,4253,4257,4261,4269,4273,4277,4281,4289,4293,4329,4333,4337,4345,4349,4353,4357,4365,4369,4373,4437,4441,4445,4449,4468,4472,4476,4480,4555,4559,4563,4567,4571,4595,4599,4603,4703,4707,4711,4715],{"type":26,"tag":27,"props":3882,"children":3883},{},[3884],{"type":31,"value":32},{"type":26,"tag":27,"props":3886,"children":3887},{},[3888],{"type":31,"value":37},{"type":26,"tag":27,"props":3890,"children":3891},{},[3892,3893,3897,3898,3902,3903,3907,3908,3912],{"type":31,"value":42},{"type":26,"tag":44,"props":3894,"children":3895},{"href":46},[3896],{"type":31,"value":49},{"type":31,"value":51},{"type":26,"tag":44,"props":3899,"children":3900},{"href":54},[3901],{"type":31,"value":57},{"type":31,"value":51},{"type":26,"tag":44,"props":3904,"children":3905},{"href":61},[3906],{"type":31,"value":64},{"type":31,"value":66},{"type":26,"tag":44,"props":3909,"children":3910},{"href":69},[3911],{"type":31,"value":72},{"type":31,"value":74},{"type":26,"tag":76,"props":3914,"children":3915},{"id":78},[3916],{"type":31,"value":81},{"type":26,"tag":83,"props":3918,"children":3919},{},[3920,3934],{"type":26,"tag":87,"props":3921,"children":3922},{},[3923],{"type":26,"tag":91,"props":3924,"children":3925},{},[3926,3930],{"type":26,"tag":95,"props":3927,"children":3928},{},[3929],{"type":31,"value":99},{"type":26,"tag":95,"props":3931,"children":3932},{},[3933],{"type":31,"value":104},{"type":26,"tag":106,"props":3935,"children":3936},{},[3937,3948,3959,3970],{"type":26,"tag":91,"props":3938,"children":3939},{},[3940,3944],{"type":26,"tag":113,"props":3941,"children":3942},{},[3943],{"type":31,"value":117},{"type":26,"tag":113,"props":3945,"children":3946},{},[3947],{"type":31,"value":122},{"type":26,"tag":91,"props":3949,"children":3950},{},[3951,3955],{"type":26,"tag":113,"props":3952,"children":3953},{},[3954],{"type":31,"value":130},{"type":26,"tag":113,"props":3956,"children":3957},{},[3958],{"type":31,"value":135},{"type":26,"tag":91,"props":3960,"children":3961},{},[3962,3966],{"type":26,"tag":113,"props":3963,"children":3964},{},[3965],{"type":31,"value":143},{"type":26,"tag":113,"props":3967,"children":3968},{},[3969],{"type":31,"value":148},{"type":26,"tag":91,"props":3971,"children":3972},{},[3973,3977],{"type":26,"tag":113,"props":3974,"children":3975},{},[3976],{"type":31,"value":156},{"type":26,"tag":113,"props":3978,"children":3979},{},[3980],{"type":31,"value":161},{"type":26,"tag":27,"props":3982,"children":3983},{},[3984],{"type":31,"value":166},{"type":26,"tag":27,"props":3986,"children":3987},{},[3988],{"type":31,"value":171},{"type":26,"tag":76,"props":3990,"children":3991},{"id":174},[3992],{"type":31,"value":177},{"type":26,"tag":27,"props":3994,"children":3995},{},[3996],{"type":31,"value":182},{"type":26,"tag":184,"props":3998,"children":3999},{},[4000,4004,4008],{"type":26,"tag":188,"props":4001,"children":4002},{},[4003],{"type":31,"value":192},{"type":26,"tag":188,"props":4005,"children":4006},{},[4007],{"type":31,"value":197},{"type":26,"tag":188,"props":4009,"children":4010},{},[4011],{"type":31,"value":202},{"type":26,"tag":27,"props":4013,"children":4014},{},[4015],{"type":31,"value":207},{"type":26,"tag":27,"props":4017,"children":4018},{},[4019],{"type":31,"value":212},{"type":26,"tag":184,"props":4021,"children":4022},{},[4023,4027,4031],{"type":26,"tag":188,"props":4024,"children":4025},{},[4026],{"type":31,"value":220},{"type":26,"tag":188,"props":4028,"children":4029},{},[4030],{"type":31,"value":225},{"type":26,"tag":188,"props":4032,"children":4033},{},[4034],{"type":31,"value":230},{"type":26,"tag":27,"props":4036,"children":4037},{},[4038],{"type":31,"value":235},{"type":26,"tag":76,"props":4040,"children":4041},{"id":238},[4042],{"type":31,"value":241},{"type":26,"tag":27,"props":4044,"children":4045},{},[4046],{"type":31,"value":246},{"type":26,"tag":184,"props":4048,"children":4049},{},[4050,4054],{"type":26,"tag":188,"props":4051,"children":4052},{},[4053],{"type":31,"value":254},{"type":26,"tag":188,"props":4055,"children":4056},{},[4057],{"type":31,"value":259},{"type":26,"tag":27,"props":4059,"children":4060},{},[4061],{"type":31,"value":264},{"type":26,"tag":184,"props":4063,"children":4064},{},[4065,4069],{"type":26,"tag":188,"props":4066,"children":4067},{},[4068],{"type":31,"value":272},{"type":26,"tag":188,"props":4070,"children":4071},{},[4072],{"type":31,"value":277},{"type":26,"tag":27,"props":4074,"children":4075},{},[4076],{"type":31,"value":282},{"type":26,"tag":27,"props":4078,"children":4079},{},[4080,4081,4086,4087,4092,4093,4098],{"type":31,"value":287},{"type":26,"tag":289,"props":4082,"children":4084},{"className":4083},[],[4085],{"type":31,"value":294},{"type":31,"value":51},{"type":26,"tag":289,"props":4088,"children":4090},{"className":4089},[],[4091],{"type":31,"value":301},{"type":31,"value":51},{"type":26,"tag":289,"props":4094,"children":4096},{"className":4095},[],[4097],{"type":31,"value":308},{"type":31,"value":310},{"type":26,"tag":76,"props":4100,"children":4101},{"id":313},[4102],{"type":31,"value":316},{"type":26,"tag":27,"props":4104,"children":4105},{},[4106],{"type":31,"value":321},{"type":26,"tag":83,"props":4108,"children":4109},{},[4110,4124],{"type":26,"tag":87,"props":4111,"children":4112},{},[4113],{"type":26,"tag":91,"props":4114,"children":4115},{},[4116,4120],{"type":26,"tag":95,"props":4117,"children":4118},{},[4119],{"type":31,"value":335},{"type":26,"tag":95,"props":4121,"children":4122},{},[4123],{"type":31,"value":340},{"type":26,"tag":106,"props":4125,"children":4126},{},[4127,4138,4149,4160],{"type":26,"tag":91,"props":4128,"children":4129},{},[4130,4134],{"type":26,"tag":113,"props":4131,"children":4132},{},[4133],{"type":31,"value":351},{"type":26,"tag":113,"props":4135,"children":4136},{},[4137],{"type":31,"value":356},{"type":26,"tag":91,"props":4139,"children":4140},{},[4141,4145],{"type":26,"tag":113,"props":4142,"children":4143},{},[4144],{"type":31,"value":364},{"type":26,"tag":113,"props":4146,"children":4147},{},[4148],{"type":31,"value":369},{"type":26,"tag":91,"props":4150,"children":4151},{},[4152,4156],{"type":26,"tag":113,"props":4153,"children":4154},{},[4155],{"type":31,"value":377},{"type":26,"tag":113,"props":4157,"children":4158},{},[4159],{"type":31,"value":382},{"type":26,"tag":91,"props":4161,"children":4162},{},[4163,4167],{"type":26,"tag":113,"props":4164,"children":4165},{},[4166],{"type":31,"value":390},{"type":26,"tag":113,"props":4168,"children":4169},{},[4170],{"type":31,"value":395},{"type":26,"tag":27,"props":4172,"children":4173},{},[4174],{"type":31,"value":400},{"type":26,"tag":27,"props":4176,"children":4177},{},[4178],{"type":31,"value":405},{"type":26,"tag":184,"props":4180,"children":4181},{},[4182,4197],{"type":26,"tag":188,"props":4183,"children":4184},{},[4185,4190,4191,4196],{"type":26,"tag":289,"props":4186,"children":4188},{"className":4187},[],[4189],{"type":31,"value":417},{"type":31,"value":419},{"type":26,"tag":289,"props":4192,"children":4194},{"className":4193},[],[4195],{"type":31,"value":425},{"type":31,"value":427},{"type":26,"tag":188,"props":4198,"children":4199},{},[4200,4205],{"type":26,"tag":289,"props":4201,"children":4203},{"className":4202},[],[4204],{"type":31,"value":436},{"type":31,"value":438},{"type":26,"tag":27,"props":4207,"children":4208},{},[4209],{"type":31,"value":443},{"type":26,"tag":76,"props":4211,"children":4212},{"id":446},[4213],{"type":31,"value":449},{"type":26,"tag":27,"props":4215,"children":4216},{},[4217],{"type":31,"value":454},{"type":26,"tag":184,"props":4219,"children":4220},{},[4221,4225,4229],{"type":26,"tag":188,"props":4222,"children":4223},{},[4224],{"type":31,"value":462},{"type":26,"tag":188,"props":4226,"children":4227},{},[4228],{"type":31,"value":467},{"type":26,"tag":188,"props":4230,"children":4231},{},[4232],{"type":31,"value":472},{"type":26,"tag":27,"props":4234,"children":4235},{},[4236],{"type":31,"value":477},{"type":26,"tag":479,"props":4238,"children":4240},{"className":4239,"code":483,"language":484,"meta":7},[482],[4241],{"type":26,"tag":289,"props":4242,"children":4243},{"__ignoreMap":7},[4244],{"type":31,"value":483},{"type":26,"tag":27,"props":4246,"children":4247},{},[4248],{"type":31,"value":494},{"type":26,"tag":76,"props":4250,"children":4251},{"id":497},[4252],{"type":31,"value":500},{"type":26,"tag":27,"props":4254,"children":4255},{},[4256],{"type":31,"value":505},{"type":26,"tag":27,"props":4258,"children":4259},{},[4260],{"type":31,"value":510},{"type":26,"tag":479,"props":4262,"children":4264},{"className":4263,"code":514,"language":484,"meta":7},[482],[4265],{"type":26,"tag":289,"props":4266,"children":4267},{"__ignoreMap":7},[4268],{"type":31,"value":514},{"type":26,"tag":27,"props":4270,"children":4271},{},[4272],{"type":31,"value":524},{"type":26,"tag":76,"props":4274,"children":4275},{"id":527},[4276],{"type":31,"value":530},{"type":26,"tag":27,"props":4278,"children":4279},{},[4280],{"type":31,"value":535},{"type":26,"tag":479,"props":4282,"children":4284},{"className":4283,"code":539,"language":484,"meta":7},[482],[4285],{"type":26,"tag":289,"props":4286,"children":4287},{"__ignoreMap":7},[4288],{"type":31,"value":539},{"type":26,"tag":27,"props":4290,"children":4291},{},[4292],{"type":31,"value":549},{"type":26,"tag":184,"props":4294,"children":4295},{},[4296,4305,4314],{"type":26,"tag":188,"props":4297,"children":4298},{},[4299,4304],{"type":26,"tag":289,"props":4300,"children":4302},{"className":4301},[],[4303],{"type":31,"value":561},{"type":31,"value":563},{"type":26,"tag":188,"props":4306,"children":4307},{},[4308,4313],{"type":26,"tag":289,"props":4309,"children":4311},{"className":4310},[],[4312],{"type":31,"value":572},{"type":31,"value":574},{"type":26,"tag":188,"props":4315,"children":4316},{},[4317,4322,4323,4328],{"type":26,"tag":289,"props":4318,"children":4320},{"className":4319},[],[4321],{"type":31,"value":583},{"type":31,"value":66},{"type":26,"tag":289,"props":4324,"children":4326},{"className":4325},[],[4327],{"type":31,"value":590},{"type":31,"value":592},{"type":26,"tag":27,"props":4330,"children":4331},{},[4332],{"type":31,"value":597},{"type":26,"tag":27,"props":4334,"children":4335},{},[4336],{"type":31,"value":602},{"type":26,"tag":479,"props":4338,"children":4340},{"className":4339,"code":606,"language":484,"meta":7},[482],[4341],{"type":26,"tag":289,"props":4342,"children":4343},{"__ignoreMap":7},[4344],{"type":31,"value":606},{"type":26,"tag":27,"props":4346,"children":4347},{},[4348],{"type":31,"value":616},{"type":26,"tag":76,"props":4350,"children":4351},{"id":619},[4352],{"type":31,"value":622},{"type":26,"tag":27,"props":4354,"children":4355},{},[4356],{"type":31,"value":627},{"type":26,"tag":479,"props":4358,"children":4360},{"className":4359,"code":632,"language":31,"meta":7},[631],[4361],{"type":26,"tag":289,"props":4362,"children":4363},{"__ignoreMap":7},[4364],{"type":31,"value":632},{"type":26,"tag":27,"props":4366,"children":4367},{},[4368],{"type":31,"value":642},{"type":26,"tag":27,"props":4370,"children":4371},{},[4372],{"type":31,"value":647},{"type":26,"tag":83,"props":4374,"children":4375},{},[4376,4390],{"type":26,"tag":87,"props":4377,"children":4378},{},[4379],{"type":26,"tag":91,"props":4380,"children":4381},{},[4382,4386],{"type":26,"tag":95,"props":4383,"children":4384},{},[4385],{"type":31,"value":661},{"type":26,"tag":95,"props":4387,"children":4388},{},[4389],{"type":31,"value":666},{"type":26,"tag":106,"props":4391,"children":4392},{},[4393,4404,4415,4426],{"type":26,"tag":91,"props":4394,"children":4395},{},[4396,4400],{"type":26,"tag":113,"props":4397,"children":4398},{},[4399],{"type":31,"value":677},{"type":26,"tag":113,"props":4401,"children":4402},{},[4403],{"type":31,"value":682},{"type":26,"tag":91,"props":4405,"children":4406},{},[4407,4411],{"type":26,"tag":113,"props":4408,"children":4409},{},[4410],{"type":31,"value":690},{"type":26,"tag":113,"props":4412,"children":4413},{},[4414],{"type":31,"value":695},{"type":26,"tag":91,"props":4416,"children":4417},{},[4418,4422],{"type":26,"tag":113,"props":4419,"children":4420},{},[4421],{"type":31,"value":703},{"type":26,"tag":113,"props":4423,"children":4424},{},[4425],{"type":31,"value":708},{"type":26,"tag":91,"props":4427,"children":4428},{},[4429,4433],{"type":26,"tag":113,"props":4430,"children":4431},{},[4432],{"type":31,"value":716},{"type":26,"tag":113,"props":4434,"children":4435},{},[4436],{"type":31,"value":721},{"type":26,"tag":27,"props":4438,"children":4439},{},[4440],{"type":31,"value":726},{"type":26,"tag":76,"props":4442,"children":4443},{"id":729},[4444],{"type":31,"value":732},{"type":26,"tag":27,"props":4446,"children":4447},{},[4448],{"type":31,"value":737},{"type":26,"tag":184,"props":4450,"children":4451},{},[4452,4456,4460,4464],{"type":26,"tag":188,"props":4453,"children":4454},{},[4455],{"type":31,"value":745},{"type":26,"tag":188,"props":4457,"children":4458},{},[4459],{"type":31,"value":750},{"type":26,"tag":188,"props":4461,"children":4462},{},[4463],{"type":31,"value":755},{"type":26,"tag":188,"props":4465,"children":4466},{},[4467],{"type":31,"value":760},{"type":26,"tag":27,"props":4469,"children":4470},{},[4471],{"type":31,"value":765},{"type":26,"tag":76,"props":4473,"children":4474},{"id":768},[4475],{"type":31,"value":771},{"type":26,"tag":27,"props":4477,"children":4478},{},[4479],{"type":31,"value":776},{"type":26,"tag":83,"props":4481,"children":4482},{},[4483,4497],{"type":26,"tag":87,"props":4484,"children":4485},{},[4486],{"type":26,"tag":91,"props":4487,"children":4488},{},[4489,4493],{"type":26,"tag":95,"props":4490,"children":4491},{},[4492],{"type":31,"value":790},{"type":26,"tag":95,"props":4494,"children":4495},{},[4496],{"type":31,"value":795},{"type":26,"tag":106,"props":4498,"children":4499},{},[4500,4511,4522,4533,4544],{"type":26,"tag":91,"props":4501,"children":4502},{},[4503,4507],{"type":26,"tag":113,"props":4504,"children":4505},{},[4506],{"type":31,"value":806},{"type":26,"tag":113,"props":4508,"children":4509},{},[4510],{"type":31,"value":811},{"type":26,"tag":91,"props":4512,"children":4513},{},[4514,4518],{"type":26,"tag":113,"props":4515,"children":4516},{},[4517],{"type":31,"value":819},{"type":26,"tag":113,"props":4519,"children":4520},{},[4521],{"type":31,"value":824},{"type":26,"tag":91,"props":4523,"children":4524},{},[4525,4529],{"type":26,"tag":113,"props":4526,"children":4527},{},[4528],{"type":31,"value":832},{"type":26,"tag":113,"props":4530,"children":4531},{},[4532],{"type":31,"value":837},{"type":26,"tag":91,"props":4534,"children":4535},{},[4536,4540],{"type":26,"tag":113,"props":4537,"children":4538},{},[4539],{"type":31,"value":845},{"type":26,"tag":113,"props":4541,"children":4542},{},[4543],{"type":31,"value":850},{"type":26,"tag":91,"props":4545,"children":4546},{},[4547,4551],{"type":26,"tag":113,"props":4548,"children":4549},{},[4550],{"type":31,"value":858},{"type":26,"tag":113,"props":4552,"children":4553},{},[4554],{"type":31,"value":863},{"type":26,"tag":27,"props":4556,"children":4557},{},[4558],{"type":31,"value":868},{"type":26,"tag":76,"props":4560,"children":4561},{"id":871},[4562],{"type":31,"value":874},{"type":26,"tag":27,"props":4564,"children":4565},{},[4566],{"type":31,"value":879},{"type":26,"tag":27,"props":4568,"children":4569},{},[4570],{"type":31,"value":884},{"type":26,"tag":184,"props":4572,"children":4573},{},[4574,4578,4582,4586],{"type":26,"tag":188,"props":4575,"children":4576},{},[4577],{"type":31,"value":892},{"type":26,"tag":188,"props":4579,"children":4580},{},[4581],{"type":31,"value":897},{"type":26,"tag":188,"props":4583,"children":4584},{},[4585],{"type":31,"value":902},{"type":26,"tag":188,"props":4587,"children":4588},{},[4589,4590],{"type":31,"value":907},{"type":26,"tag":289,"props":4591,"children":4593},{"className":4592},[],[4594],{"type":31,"value":708},{"type":26,"tag":27,"props":4596,"children":4597},{},[4598],{"type":31,"value":917},{"type":26,"tag":76,"props":4600,"children":4601},{"id":920},[4602],{"type":31,"value":923},{"type":26,"tag":184,"props":4604,"children":4606},{"className":4605},[927],[4607,4615,4623,4631,4639,4647,4655,4663,4671,4679,4687,4695],{"type":26,"tag":188,"props":4608,"children":4610},{"className":4609},[932],[4611,4614],{"type":26,"tag":935,"props":4612,"children":4613},{"disabled":937,"type":938},[],{"type":31,"value":941},{"type":26,"tag":188,"props":4616,"children":4618},{"className":4617},[932],[4619,4622],{"type":26,"tag":935,"props":4620,"children":4621},{"disabled":937,"type":938},[],{"type":31,"value":950},{"type":26,"tag":188,"props":4624,"children":4626},{"className":4625},[932],[4627,4630],{"type":26,"tag":935,"props":4628,"children":4629},{"disabled":937,"type":938},[],{"type":31,"value":959},{"type":26,"tag":188,"props":4632,"children":4634},{"className":4633},[932],[4635,4638],{"type":26,"tag":935,"props":4636,"children":4637},{"disabled":937,"type":938},[],{"type":31,"value":968},{"type":26,"tag":188,"props":4640,"children":4642},{"className":4641},[932],[4643,4646],{"type":26,"tag":935,"props":4644,"children":4645},{"disabled":937,"type":938},[],{"type":31,"value":977},{"type":26,"tag":188,"props":4648,"children":4650},{"className":4649},[932],[4651,4654],{"type":26,"tag":935,"props":4652,"children":4653},{"disabled":937,"type":938},[],{"type":31,"value":986},{"type":26,"tag":188,"props":4656,"children":4658},{"className":4657},[932],[4659,4662],{"type":26,"tag":935,"props":4660,"children":4661},{"disabled":937,"type":938},[],{"type":31,"value":995},{"type":26,"tag":188,"props":4664,"children":4666},{"className":4665},[932],[4667,4670],{"type":26,"tag":935,"props":4668,"children":4669},{"disabled":937,"type":938},[],{"type":31,"value":1004},{"type":26,"tag":188,"props":4672,"children":4674},{"className":4673},[932],[4675,4678],{"type":26,"tag":935,"props":4676,"children":4677},{"disabled":937,"type":938},[],{"type":31,"value":1013},{"type":26,"tag":188,"props":4680,"children":4682},{"className":4681},[932],[4683,4686],{"type":26,"tag":935,"props":4684,"children":4685},{"disabled":937,"type":938},[],{"type":31,"value":1022},{"type":26,"tag":188,"props":4688,"children":4690},{"className":4689},[932],[4691,4694],{"type":26,"tag":935,"props":4692,"children":4693},{"disabled":937,"type":938},[],{"type":31,"value":1031},{"type":26,"tag":188,"props":4696,"children":4698},{"className":4697},[932],[4699,4702],{"type":26,"tag":935,"props":4700,"children":4701},{"disabled":937,"type":938},[],{"type":31,"value":1040},{"type":26,"tag":76,"props":4704,"children":4705},{"id":1043},[4706],{"type":31,"value":1043},{"type":26,"tag":27,"props":4708,"children":4709},{},[4710],{"type":31,"value":1050},{"type":26,"tag":27,"props":4712,"children":4713},{},[4714],{"type":31,"value":1055},{"type":26,"tag":184,"props":4716,"children":4717},{},[4718,4725,4732,4739],{"type":26,"tag":188,"props":4719,"children":4720},{},[4721],{"type":26,"tag":44,"props":4722,"children":4723},{"href":46},[4724],{"type":31,"value":49},{"type":26,"tag":188,"props":4726,"children":4727},{},[4728],{"type":26,"tag":44,"props":4729,"children":4730},{"href":54},[4731],{"type":31,"value":57},{"type":26,"tag":188,"props":4733,"children":4734},{},[4735],{"type":26,"tag":44,"props":4736,"children":4737},{"href":61},[4738],{"type":31,"value":64},{"type":26,"tag":188,"props":4740,"children":4741},{},[4742],{"type":26,"tag":44,"props":4743,"children":4744},{"href":69},[4745],{"type":31,"value":72},{"title":7,"searchDepth":1088,"depth":1088,"links":4747},[4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760],{"id":78,"depth":1091,"text":81},{"id":174,"depth":1091,"text":177},{"id":238,"depth":1091,"text":241},{"id":313,"depth":1091,"text":316},{"id":446,"depth":1091,"text":449},{"id":497,"depth":1091,"text":500},{"id":527,"depth":1091,"text":530},{"id":619,"depth":1091,"text":622},{"id":729,"depth":1091,"text":732},{"id":768,"depth":1091,"text":771},{"id":871,"depth":1091,"text":874},{"id":920,"depth":1091,"text":923},{"id":1043,"depth":1091,"text":1043},1778331340391]