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