[{"data":1,"prerenderedAt":1181},["ShallowReactive",2],{"navigation_docs":3,"-reference-chain-nodes-fix-loop":504,"-reference-chain-nodes-fix-loop-surround":1176},[4,28,51,187,214,469],{"title":5,"path":6,"stem":7,"children":8},"Get started","\u002Fget-started","1.get-started",[9,12,16,20,24],{"title":10,"path":6,"stem":11},"Overview","1.get-started\u002Findex",{"title":13,"path":14,"stem":15},"Why Kraft","\u002Fget-started\u002Fwhy-kraft","1.get-started\u002F0.why-kraft",{"title":17,"path":18,"stem":19},"Install","\u002Fget-started\u002Finstall","1.get-started\u002F1.install",{"title":21,"path":22,"stem":23},"Your first work item","\u002Fget-started\u002Ffirst-work-item","1.get-started\u002F2.first-work-item",{"title":25,"path":26,"stem":27},"FAQ","\u002Fget-started\u002Ffaq","1.get-started\u002F3.faq",{"title":29,"path":30,"stem":31,"children":32},"Concepts","\u002Fconcepts","2.concepts",[33,35,39,43,47],{"title":10,"path":30,"stem":34},"2.concepts\u002Findex",{"title":36,"path":37,"stem":38},"How a work item runs","\u002Fconcepts\u002Fhow-a-work-item-runs","2.concepts\u002F1.how-a-work-item-runs",{"title":40,"path":41,"stem":42},"Caps and budgets","\u002Fconcepts\u002Fcaps-and-budgets","2.concepts\u002F2.caps-and-budgets",{"title":44,"path":45,"stem":46},"Why a permission gate","\u002Fconcepts\u002Fpermission-gate","2.concepts\u002F3.permission-gate",{"title":48,"path":49,"stem":50},"Vocabulary","\u002Fconcepts\u002Fvocabulary","2.concepts\u002F4.vocabulary",{"title":52,"path":53,"stem":54,"children":55},"Guides","\u002Fguides","3.guides",[56,58,96,113,134,183],{"title":10,"path":53,"stem":57},"3.guides\u002Findex",{"title":59,"path":60,"stem":61,"children":62,"page":95},"Day to day","\u002Fguides\u002Fday-to-day","3.guides\u002F1.day-to-day",[63,67,71,75,79,83,87,91],{"title":64,"path":65,"stem":66},"The setup wizard on first start","\u002Fguides\u002Fday-to-day\u002Ffirst-run","3.guides\u002F1.day-to-day\u002F2.first-run",{"title":68,"path":69,"stem":70},"File a work item","\u002Fguides\u002Fday-to-day\u002Ffile-a-work-item","3.guides\u002F1.day-to-day\u002F3.file-a-work-item",{"title":72,"path":73,"stem":74},"Use Kraft from your agent","\u002Fguides\u002Fday-to-day\u002Fagent-integration","3.guides\u002F1.day-to-day\u002F4.agent-integration",{"title":76,"path":77,"stem":78},"Reviewing a change","\u002Fguides\u002Fday-to-day\u002Freview-a-change","3.guides\u002F1.day-to-day\u002F5.review-a-change",{"title":80,"path":81,"stem":82},"Raise a cap on a stopped item","\u002Fguides\u002Fday-to-day\u002Fraise-a-cap","3.guides\u002F1.day-to-day\u002F6.raise-a-cap",{"title":84,"path":85,"stem":86},"Kraft for VS Code","\u002Fguides\u002Fday-to-day\u002Fvscode","3.guides\u002F1.day-to-day\u002F7.vscode",{"title":88,"path":89,"stem":90},"Kraft on a phone","\u002Fguides\u002Fday-to-day\u002Fkraft-on-a-phone","3.guides\u002F1.day-to-day\u002F8.kraft-on-a-phone",{"title":92,"path":93,"stem":94},"Get notified when an item needs you","\u002Fguides\u002Fday-to-day\u002Fnotifications","3.guides\u002F1.day-to-day\u002F9.notifications",false,{"title":97,"path":98,"stem":99,"children":100,"page":95},"Customize and automate","\u002Fguides\u002Fcustomize","3.guides\u002F2.customize",[101,105,109],{"title":102,"path":103,"stem":104},"Write your own chain","\u002Fguides\u002Fcustomize\u002Fwrite-your-own-chain","3.guides\u002F2.customize\u002F1.write-your-own-chain",{"title":106,"path":107,"stem":108},"Add a security review or a gate reviewer","\u002Fguides\u002Fcustomize\u002Fadd-review-agents","3.guides\u002F2.customize\u002F2.add-review-agents",{"title":110,"path":111,"stem":112},"Schedule or webhook work","\u002Fguides\u002Fcustomize\u002Fschedule-and-webhook-work","3.guides\u002F2.customize\u002F3.schedule-and-webhook-work",{"title":114,"path":115,"stem":116,"children":117,"page":95},"Agents and harnesses","\u002Fguides\u002Fharnesses","3.guides\u002F3.harnesses",[118,122,126,130],{"title":119,"path":120,"stem":121},"Switch a task to another harness","\u002Fguides\u002Fharnesses\u002Fswitch-harness","3.guides\u002F3.harnesses\u002F1.switch-harness",{"title":123,"path":124,"stem":125},"Add or override a harness","\u002Fguides\u002Fharnesses\u002Fadding-a-harness","3.guides\u002F3.harnesses\u002F2.adding-a-harness",{"title":127,"path":128,"stem":129},"Build a worker Kit","\u002Fguides\u002Fharnesses\u002Fworker-kit","3.guides\u002F3.harnesses\u002F3.worker-kit",{"title":131,"path":132,"stem":133},"Give a worker its login","\u002Fguides\u002Fharnesses\u002Fgive-a-worker-its-login","3.guides\u002F3.harnesses\u002F4.give-a-worker-its-login",{"title":135,"path":136,"stem":137,"children":138,"page":95},"Run the server","\u002Fguides\u002Frun","3.guides\u002F4.run",[139,143,147,151,155,159,163,167,171,175,179],{"title":140,"path":141,"stem":142},"Remote access","\u002Fguides\u002Frun\u002Fremote-access","3.guides\u002F4.run\u002F01.remote-access",{"title":144,"path":145,"stem":146},"Put a proxy in front of Kraft","\u002Fguides\u002Frun\u002Fput-a-proxy-in-front-of-kraft","3.guides\u002F4.run\u002F02.put-a-proxy-in-front-of-kraft",{"title":148,"path":149,"stem":150},"Restart Kraft without ending running agents","\u002Fguides\u002Frun\u002Frestart-kraft","3.guides\u002F4.run\u002F03.restart-kraft",{"title":152,"path":153,"stem":154},"Back up and restore the database","\u002Fguides\u002Frun\u002Fback-up-and-restore","3.guides\u002F4.run\u002F04.back-up-and-restore",{"title":156,"path":157,"stem":158},"Logs and disk space","\u002Fguides\u002Frun\u002Flogs-and-disk-space","3.guides\u002F4.run\u002F05.logs-and-disk-space",{"title":160,"path":161,"stem":162},"Run Kraft as a service","\u002Fguides\u002Frun\u002Frun-as-a-service","3.guides\u002F4.run\u002F06.run-as-a-service",{"title":164,"path":165,"stem":166},"Upgrade Kraft","\u002Fguides\u002Frun\u002Fupgrade-kraft","3.guides\u002F4.run\u002F07.upgrade-kraft",{"title":168,"path":169,"stem":170},"Upgrade your configuration","\u002Fguides\u002Frun\u002Fupgrade-your-configuration","3.guides\u002F4.run\u002F08.upgrade-your-configuration",{"title":172,"path":173,"stem":174},"Upgrade from 1.4","\u002Fguides\u002Frun\u002Fupgrade-from-1-4","3.guides\u002F4.run\u002F09.upgrade-from-1-4",{"title":176,"path":177,"stem":178},"Upgrade from 0.x or a release candidate","\u002Fguides\u002Frun\u002Fupgrade-from-0-x-or-a-release-candidate","3.guides\u002F4.run\u002F10.upgrade-from-0-x-or-a-release-candidate",{"title":180,"path":181,"stem":182},"Roll back to 1.4","\u002Fguides\u002Frun\u002Froll-back","3.guides\u002F4.run\u002F11.roll-back",{"title":184,"path":185,"stem":186},"Kraft Lite","\u002Fguides\u002Fkraft-lite","3.guides\u002F5.kraft-lite",{"title":188,"path":189,"stem":190,"children":191},"Troubleshooting","\u002Ftroubleshooting","4.troubleshooting",[192,194,198,202,206,210],{"title":10,"path":189,"stem":193},"4.troubleshooting\u002Findex",{"title":195,"path":196,"stem":197},"Why did my item stop?","\u002Ftroubleshooting\u002Fwhy-did-my-item-stop","4.troubleshooting\u002F1.why-did-my-item-stop",{"title":199,"path":200,"stem":201},"Stop reasons in detail","\u002Ftroubleshooting\u002Fstop-reasons-in-detail","4.troubleshooting\u002F2.stop-reasons-in-detail",{"title":203,"path":204,"stem":205},"Starting and reaching Kraft","\u002Ftroubleshooting\u002Fstarting-and-reaching-kraft","4.troubleshooting\u002F3.starting-and-reaching-kraft",{"title":207,"path":208,"stem":209},"Doctor failures","\u002Ftroubleshooting\u002Fdoctor-failures","4.troubleshooting\u002F4.doctor-failures",{"title":211,"path":212,"stem":213},"Sandbox and Kit stops","\u002Ftroubleshooting\u002Fsandbox-and-kit-stops","4.troubleshooting\u002F5.sandbox-and-kit-stops",{"title":215,"path":216,"stem":217,"children":218},"Reference","\u002Freference","5.reference",[219,221,259,281,285,375,393,419,423,427,461,465],{"title":10,"path":216,"stem":220},"5.reference\u002Findex",{"title":222,"path":223,"stem":224,"children":225},"Web UI","\u002Freference\u002Fweb-ui","5.reference\u002F00.web-ui\u002Findex",[226,227,231,235,239,243,247,251,255],{"title":10,"path":223,"stem":224},{"title":228,"path":229,"stem":230},"Sidebar, search, and keyboard","\u002Freference\u002Fweb-ui\u002Fsidebar-search-and-keyboard","5.reference\u002F00.web-ui\u002F0.sidebar-search-and-keyboard",{"title":232,"path":233,"stem":234},"The board","\u002Freference\u002Fweb-ui\u002Fboard","5.reference\u002F00.web-ui\u002F1.board",{"title":236,"path":237,"stem":238},"An item's page","\u002Freference\u002Fweb-ui\u002Fitem-page","5.reference\u002F00.web-ui\u002F2.item-page",{"title":240,"path":241,"stem":242},"Fix loops and test scopes","\u002Freference\u002Fweb-ui\u002Ffix-loops-and-test-scopes","5.reference\u002F00.web-ui\u002F3.fix-loops-and-test-scopes",{"title":244,"path":245,"stem":246},"Config before an item starts","\u002Freference\u002Fweb-ui\u002Fconfig-before-start","5.reference\u002F00.web-ui\u002F4.config-before-start",{"title":248,"path":249,"stem":250},"The review page","\u002Freference\u002Fweb-ui\u002Freview-page","5.reference\u002F00.web-ui\u002F5.review-page",{"title":252,"path":253,"stem":254},"Templates and Settings","\u002Freference\u002Fweb-ui\u002Ftemplates-and-settings","5.reference\u002F00.web-ui\u002F6.templates-and-settings",{"title":256,"path":257,"stem":258},"Analytics","\u002Freference\u002Fweb-ui\u002Fanalytics","5.reference\u002F00.web-ui\u002F7.analytics",{"title":260,"path":261,"stem":262,"children":263},"CLI","\u002Freference\u002Fcli","5.reference\u002F01.cli\u002Findex",[264,265,269,273,277],{"title":10,"path":261,"stem":262},{"title":266,"path":267,"stem":268},"Item verbs","\u002Freference\u002Fcli\u002Fitem","5.reference\u002F01.cli\u002F2.item",{"title":270,"path":271,"stem":272},"View verbs","\u002Freference\u002Fcli\u002Fview","5.reference\u002F01.cli\u002F3.view",{"title":274,"path":275,"stem":276},"Repo verbs","\u002Freference\u002Fcli\u002Frepo","5.reference\u002F01.cli\u002F4.repo",{"title":278,"path":279,"stem":280},"Admin verbs","\u002Freference\u002Fcli\u002Fadmin","5.reference\u002F01.cli\u002F5.admin",{"title":282,"path":283,"stem":284},"Work item statuses","\u002Freference\u002Fstatuses","5.reference\u002F02.statuses",{"title":286,"path":287,"stem":288,"children":289},"Configuration","\u002Freference\u002Fconfiguration","5.reference\u002F03.configuration\u002Findex",[290,291,309,313,317,321,325,329,333,337,371],{"title":10,"path":287,"stem":288},{"title":292,"path":293,"stem":294,"children":295},"repos.yaml","\u002Freference\u002Fconfiguration\u002Frepos","5.reference\u002F03.configuration\u002F02.repos\u002Findex",[296,297,301,305],{"title":10,"path":293,"stem":294},{"title":298,"path":299,"stem":300},"How connect proposes commands","\u002Freference\u002Fconfiguration\u002Frepos\u002Fconnect-proposals","5.reference\u002F03.configuration\u002F02.repos\u002F1.connect-proposals",{"title":302,"path":303,"stem":304},"detectors.yaml","\u002Freference\u002Fconfiguration\u002Frepos\u002Fdetectors","5.reference\u002F03.configuration\u002F02.repos\u002F2.detectors",{"title":306,"path":307,"stem":308},"Workspaces","\u002Freference\u002Fconfiguration\u002Frepos\u002Fworkspaces","5.reference\u002F03.configuration\u002F02.repos\u002F3.workspaces",{"title":310,"path":311,"stem":312},"policy.yaml","\u002Freference\u002Fconfiguration\u002Fpolicy","5.reference\u002F03.configuration\u002F03.policy",{"title":314,"path":315,"stem":316},"Library and chains","\u002Freference\u002Fconfiguration\u002Flibrary-and-chains","5.reference\u002F03.configuration\u002F04.library-and-chains",{"title":318,"path":319,"stem":320},"harnesses.yaml","\u002Freference\u002Fconfiguration\u002Fharnesses-file","5.reference\u002F03.configuration\u002F05.harnesses-file",{"title":322,"path":323,"stem":324},"access.yaml","\u002Freference\u002Fconfiguration\u002Faccess","5.reference\u002F03.configuration\u002F06.access",{"title":326,"path":327,"stem":328},"intake.yaml","\u002Freference\u002Fconfiguration\u002Fintake","5.reference\u002F03.configuration\u002F07.intake",{"title":330,"path":331,"stem":332},"notify.yaml","\u002Freference\u002Fconfiguration\u002Fnotify","5.reference\u002F03.configuration\u002F08.notify",{"title":334,"path":335,"stem":336},"theme.yaml","\u002Freference\u002Fconfiguration\u002Ftheme","5.reference\u002F03.configuration\u002F09.theme",{"title":338,"path":339,"stem":340,"children":341},"Sandboxed workers","\u002Freference\u002Fconfiguration\u002Fsandbox","5.reference\u002F03.configuration\u002F10.sandbox\u002Findex",[342,343,347,351,355,359,363,367],{"title":10,"path":339,"stem":340},{"title":344,"path":345,"stem":346},"Resource limits","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fresource-limits","5.reference\u002F03.configuration\u002F10.sandbox\u002F1.resource-limits",{"title":348,"path":349,"stem":350},"Callbacks from a sandbox","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fcallbacks","5.reference\u002F03.configuration\u002F10.sandbox\u002F2.callbacks",{"title":352,"path":353,"stem":354},"Network policy","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fnetwork-policy","5.reference\u002F03.configuration\u002F10.sandbox\u002F3.network-policy",{"title":356,"path":357,"stem":358},"Credentials","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fcredentials","5.reference\u002F03.configuration\u002F10.sandbox\u002F4.credentials",{"title":360,"path":361,"stem":362},"Kits","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fkits","5.reference\u002F03.configuration\u002F10.sandbox\u002F5.kits",{"title":364,"path":365,"stem":366},"sandbox.yaml","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fsandbox-yaml","5.reference\u002F03.configuration\u002F10.sandbox\u002F6.sandbox-yaml",{"title":368,"path":369,"stem":370},"Git in a sandbox","\u002Freference\u002Fconfiguration\u002Fsandbox\u002Fgit-in-a-sandbox","5.reference\u002F03.configuration\u002F10.sandbox\u002F7.git-in-a-sandbox",{"title":372,"path":373,"stem":374},"Environment variables","\u002Freference\u002Fconfiguration\u002Fenvironment-variables","5.reference\u002F03.configuration\u002F11.environment-variables",{"title":376,"path":377,"stem":378,"children":379},"Chain file keys","\u002Freference\u002Fchain-nodes","5.reference\u002F04.chain-nodes\u002Findex",[380,381,385,389],{"title":10,"path":377,"stem":378},{"title":382,"path":383,"stem":384},"Subprocess tasks","\u002Freference\u002Fchain-nodes\u002Fsubprocess-tasks","5.reference\u002F04.chain-nodes\u002F2.subprocess-tasks",{"title":386,"path":387,"stem":388},"Fix loop and judge","\u002Freference\u002Fchain-nodes\u002Ffix-loop","5.reference\u002F04.chain-nodes\u002F3.fix-loop",{"title":390,"path":391,"stem":392},"Result file","\u002Freference\u002Fchain-nodes\u002Fresult-file","5.reference\u002F04.chain-nodes\u002F4.result-file",{"title":394,"path":395,"stem":396,"children":397},"Agent harnesses","\u002Freference\u002Fharnesses","5.reference\u002F05.harnesses\u002Findex",[398,399,403,407,411,415],{"title":10,"path":395,"stem":396},{"title":400,"path":401,"stem":402},"Unattended runs","\u002Freference\u002Fharnesses\u002Funattended-runs","5.reference\u002F05.harnesses\u002F2.unattended-runs",{"title":404,"path":405,"stem":406},"Agent profiles","\u002Freference\u002Fharnesses\u002Fagent-profiles","5.reference\u002F05.harnesses\u002F3.agent-profiles",{"title":408,"path":409,"stem":410},"Harness definition files","\u002Freference\u002Fharnesses\u002Fharness-files","5.reference\u002F05.harnesses\u002F4.harness-files",{"title":412,"path":413,"stem":414},"Fallback and escalation","\u002Freference\u002Fharnesses\u002Ffallback-and-escalation","5.reference\u002F05.harnesses\u002F5.fallback-and-escalation",{"title":416,"path":417,"stem":418},"Cost reporting","\u002Freference\u002Fharnesses\u002Fcost-reporting","5.reference\u002F05.harnesses\u002F6.cost-reporting",{"title":420,"path":421,"stem":422},"Permission gate","\u002Freference\u002Fpermissions","5.reference\u002F06.permissions",{"title":424,"path":425,"stem":426},"Inbound triggers","\u002Freference\u002Ftriggers","5.reference\u002F07.triggers",{"title":428,"path":429,"stem":430,"children":431},"HTTP API","\u002Freference\u002Fhttp-api","5.reference\u002F08.http-api\u002Findex",[432,433,437,441,445,449,453,457],{"title":10,"path":429,"stem":430},{"title":434,"path":435,"stem":436},"Filing, reading and changing work items","\u002Freference\u002Fhttp-api\u002Fwork-items","5.reference\u002F08.http-api\u002F2.work-items",{"title":438,"path":439,"stem":440},"Gates, run control, ending and retry","\u002Freference\u002Fhttp-api\u002Fgates-run-control-and-ending","5.reference\u002F08.http-api\u002F3.gates-run-control-and-ending",{"title":442,"path":443,"stem":444},"The work item object","\u002Freference\u002Fhttp-api\u002Fwork-item-object","5.reference\u002F08.http-api\u002F4.work-item-object",{"title":446,"path":447,"stem":448},"Budget, events, diff and documents","\u002Freference\u002Fhttp-api\u002Fbudget-and-events","5.reference\u002F08.http-api\u002F5.budget-and-events",{"title":450,"path":451,"stem":452},"Repos, chains, harnesses and the server","\u002Freference\u002Fhttp-api\u002Frepos-chains-harnesses-and-server","5.reference\u002F08.http-api\u002F6.repos-chains-harnesses-and-server",{"title":454,"path":455,"stem":456},"Drafts","\u002Freference\u002Fhttp-api\u002Fdrafts","5.reference\u002F08.http-api\u002F7.drafts",{"title":458,"path":459,"stem":460},"Ops for each draft area","\u002Freference\u002Fhttp-api\u002Fdraft-ops","5.reference\u002F08.http-api\u002F8.draft-ops",{"title":462,"path":463,"stem":464},"MCP tools","\u002Freference\u002Fmcp-tools","5.reference\u002F09.mcp-tools",{"title":466,"path":467,"stem":468},"Events","\u002Freference\u002Fevents","5.reference\u002F10.events",{"title":470,"path":471,"stem":472,"children":473},"Security and project","\u002Fproject","6.project",[474,476,480,484,488,492,496,500],{"title":10,"path":471,"stem":475},"6.project\u002Findex",{"title":477,"path":478,"stem":479},"Security","\u002Fproject\u002Fsecurity","6.project\u002F1.security",{"title":481,"path":482,"stem":483},"Data and privacy","\u002Fproject\u002Fdata-and-privacy","6.project\u002F2.data-and-privacy",{"title":485,"path":486,"stem":487},"What's new in 2.0","\u002Fproject\u002Fwhats-new","6.project\u002F3.whats-new",{"title":489,"path":490,"stem":491},"Status and support","\u002Fproject\u002Fstatus-and-support","6.project\u002F4.status-and-support",{"title":493,"path":494,"stem":495},"Architecture","\u002Fproject\u002Farchitecture","6.project\u002F5.architecture",{"title":497,"path":498,"stem":499},"Source map","\u002Fproject\u002Fsource-map","6.project\u002F6.source-map",{"title":501,"path":502,"stem":503},"Contributing","\u002Fproject\u002Fcontributing","6.project\u002F7.contributing",{"id":505,"title":386,"body":506,"description":1169,"extension":1170,"links":1171,"meta":1172,"navigation":1173,"path":387,"seo":1174,"stem":388,"__hash__":1175},"docs\u002F5.reference\u002F04.chain-nodes\u002F3.fix-loop.md",{"type":507,"value":508,"toc":1156},"minimark",[509,522,527,547,631,636,641,731,735,748,781,784,788,801,809,930,939,942,987,1000,1004,1016,1037,1041,1044,1061,1113,1135,1139],[510,511,512,513,517,518,521],"p",{},"An exec node's ",[514,515,516],"code",{},"fix_loop"," repairs the node and measures it again until it\npasses. This page is the loop's contract: when it opens, what runs in each\ncycle, and how the judge's verdict is read. For why loops and caps work the\nway they do, see ",[519,520,40],"a",{"href":41},".",[523,524,526],"h2",{"id":525},"keys","Keys",[510,528,529,530,532,533,536,537,540,541,543,544,521],{},"A ",[514,531,516],{}," takes exactly one of ",[514,534,535],{},"tasks"," or ",[514,538,539],{},"steps",". A node with a ",[514,542,516],{},"\ncannot be ",[514,545,546],{},"read_only",[548,549,550,569],"table",{},[551,552,553],"thead",{},[554,555,556,560,563,566],"tr",{},[557,558,559],"th",{},"Key",[557,561,562],{},"Type",[557,564,565],{},"Default",[557,567,568],{},"Meaning",[570,571,572,593,615],"tbody",{},[554,573,574,581,584,587],{},[575,576,577,536,579],"td",{},[514,578,535],{},[514,580,539],{},[575,582,583],{},"list",[575,585,586],{},"required, one of them",[575,588,589,590,521],{},"The repair. Runs as an ordered group, like a node's own steps. No task or step in it may take an ",[514,591,592],{},"on_failure",[554,594,595,600,603,606],{},[575,596,597],{},[514,598,599],{},"judge",[575,601,602],{},"mapping",[575,604,605],{},"none",[575,607,608,609,611,612,521],{},"One task of any kind, which may not take an ",[514,610,592],{},". The shipped one is ",[514,613,614],{},"strict_judge",[554,616,617,622,625,628],{},[575,618,619],{},[514,620,621],{},"max_attempts",[575,623,624],{},"integer",[575,626,627],{},"from the layers below",[575,629,630],{},"The loop's attempt limit. Above 0.",[632,633,635],"h3",{"id":634},"limits","Limits",[510,637,638,639,521],{},"The loop's limits come from four layers. A later row replaces only the keys it\nsets, so the last row that sets a key wins. See\n",[519,640,310],{"href":311},[548,642,643,656],{},[551,644,645],{},[554,646,647,650,653],{},[557,648,649],{},"Layer",[557,651,652],{},"Attempts key",[557,654,655],{},"Wall-clock key",[570,657,658,683,700,711],{},[554,659,660,673,678],{},[575,661,662,663,665,666,669,670],{},"1. ",[514,664,310],{},"'s ",[514,667,668],{},"loops.\u003Cnode>.fix_loop"," entry, else its ",[514,671,672],{},"default",[575,674,675],{},[514,676,677],{},"attempts",[575,679,680],{},[514,681,682],{},"wall_clock_s",[554,684,685,691,695],{},[575,686,687,688],{},"2. The node's ",[514,689,690],{},"policy",[575,692,693],{},[514,694,621],{},[575,696,697],{},[514,698,699],{},"timeout_minutes",[554,701,702,705,709],{},[575,703,704],{},"3. The loop's own keys",[575,706,707],{},[514,708,621],{},[575,710,605],{},[554,712,713,725,729],{},[575,714,715,716,720,721,724],{},"4. The ",[519,717,719],{"href":718},"\u002Fconcepts\u002Fvocabulary#work-item","work item","'s own policy (",[514,722,723],{},"kraft item set-policy",")",[575,726,727],{},[514,728,621],{},[575,730,605],{},[523,732,734],{"id":733},"when-the-loop-opens","When the loop opens",[510,736,737,738,740,741,747],{},"After the node's tasks run (and after any ",[514,739,592],{}," recovery), Kraft reads\nevery measuring task's findings and records a\n",[519,742,744],{"href":743},"\u002Freference\u002Fevents#chain-and-nodes",[514,745,746],{},"findings_measured"," event. The loop opens\nwhen either is true:",[749,750,751,770],"ul",{},[752,753,754,755,758,759,761,762,765,766,769],"li",{},"a finding's severity is in ",[514,756,757],{},"findings.loop_severities"," in ",[514,760,310],{},"\n(default ",[514,763,764],{},"critical"," and ",[514,767,768],{},"important",");",[752,771,772,773,775,776,780],{},"a task failed without reporting any findings. Kraft writes one ",[514,774,764],{},"\nfinding for it, as a ",[519,777,779],{"href":778},"\u002Freference\u002Fchain-nodes\u002Fsubprocess-tasks#what-a-fix-loop-sees","subprocess task","\ndescribes.",[510,782,783],{},"Otherwise the node completes. Findings below the loop severities are kept and\nshown at the review gate.",[523,785,787],{"id":786},"one-cycle","One cycle",[510,789,790,791,795,796,800],{},"Each cycle runs these checks in order. A ",[792,793,794],"strong",{},"stuck"," node is one whose\n",[519,797,799],{"href":798},"\u002Fconcepts\u002Fhow-a-work-item-runs#inside-a-node","escalation"," runs first, and then the\nitem stops and waits for you.",[510,802,803],{},[804,805],"img",{"alt":806,"src":807,"width":808},"The fix loop: measure the node. With no loop-severity finding it passes. Otherwise checks run in order. needs_context, only Kraft-run failures or a spent budget stop the item to wait for you. The judge can complete the node (stop_downgrade) or stick it (stop_needs_human). The limit or the same findings again stick it, and a stuck node escalates first. If none holds, a repair task runs and the node is measured again","\u002Fdiagrams\u002Fportrait\u002Ffix-loop.svg",537,[548,810,811,824],{},[551,812,813],{},[554,814,815,818,821],{},[557,816,817],{},"#",[557,819,820],{},"Check",[557,822,823],{},"Outcome",[570,825,826,840,858,873,902,916],{},[554,827,828,831,837],{},[575,829,830],{},"1",[575,832,833,834,521],{},"A measuring task ended ",[514,835,836],{},"needs_context",[575,838,839],{},"The item stops and waits for you, with its question.",[554,841,842,845,855],{},[575,843,844],{},"2",[575,846,847,848,536,851,854],{},"Every failure came from a task Kraft runs itself (a ",[514,849,850],{},"builtin",[514,852,853],{},"forge"," task), and nothing else reported a finding.",[575,856,857],{},"The item stops and waits for you, because no worker commit can change the outcome.",[554,859,860,863,870],{},[575,861,862],{},"3",[575,864,529,865,869],{},[519,866,868],{"href":867},"\u002Fconcepts\u002Fcaps-and-budgets#token-and-dollar-budgets","token or dollar budget"," is spent.",[575,871,872],{},"The item stops and waits for you.",[554,874,875,878,885],{},[575,876,877],{},"4",[575,879,880,881,884],{},"The ",[519,882,599],{"href":883},"#the-judge",", when it is due.",[575,886,887,890,891,894,895,898,899,521],{},[514,888,889],{},"continue"," goes ahead, ",[514,892,893],{},"stop_needs_human"," makes the node stuck, and ",[514,896,897],{},"stop_downgrade"," completes the node. See ",[519,900,901],{"href":883},"the verdicts",[554,903,904,907,910],{},[575,905,906],{},"5",[575,908,909],{},"The attempt count or wall clock is past its limit.",[575,911,912,913,521],{},"The node is stuck, with the reason ",[514,914,915],{},"\u003Cnode>.fix_loop exhausted after N fix cycle(s)",[554,917,918,921,924],{},[575,919,920],{},"6",[575,922,923],{},"After a repair, the same set of loop-severity findings came back, or one finding came back unchanged three cycles running.",[575,925,926,927,521],{},"The node is stuck, with a reason that starts ",[514,928,929],{},"stuck:",[510,931,932,933,938],{},"If nothing stopped the loop, Kraft records\n",[519,934,935],{"href":743},[514,936,937],{},"fix_cycle_started",", runs the repair, and\nmeasures the whole node again from its first step.",[510,940,941],{},"Whether the repair spends the attempt depends on how it ended:",[548,943,944,954],{},[551,945,946],{},[554,947,948,951],{},[557,949,950],{},"Repair outcome",[557,952,953],{},"The attempt",[570,955,956,968],{},[554,957,958,965],{},[575,959,960,961,964],{},"Ended ",[514,962,963],{},"done",", or failed in an agent or subprocess task",[575,966,967],{},"Spent.",[554,969,970,978],{},[575,971,972,973,536,975,977],{},"Paused, rate limited, refused to start, or failed in a ",[514,974,850],{},[514,976,853],{}," step",[575,979,980,981,986],{},"Given back, because the repair tried nothing. Kraft records ",[519,982,983],{"href":743},[514,984,985],{},"fix_cycle_refunded"," instead of measuring again.",[510,988,989,990,995,996,999],{},"When the repair ends, Kraft records\n",[519,991,992],{"href":743},[514,993,994],{},"fix_cycle_finished"," with whether it\ncommitted a change (",[514,997,998],{},"committed","), so the item's Recent list can say whether a\nround changed anything.",[523,1001,1003],{"id":1002},"what-a-repair-task-is-told","What a repair task is told",[510,1005,1006,1007,1010,1011,1015],{},"A repair task's own ",[514,1008,1009],{},"prompt"," is not used. Its ",[519,1012,1014],{"href":1013},"\u002Fconcepts\u002Fvocabulary#harness-profile","harness profile",", agent profile, model and skill\nstill are. Kraft writes its instruction instead:",[749,1017,1018,1021,1028,1031,1034],{},[752,1019,1020],{},"which tasks failed, or that a review reported findings;",[752,1022,1023,1024,1027],{},"the loop-severity findings, each with its tag, a finding that was in the last\nmeasurement marked ",[514,1025,1026],{},"REPEAT",";",[752,1029,1030],{},"the judge's reasoning, when the judge ran this cycle;",[752,1032,1033],{},"once there are two rounds, every round so far, with any finding that was\nfixed and came back;",[752,1035,1036],{},"the path of the previous attempt's result file and session summary.",[523,1038,1040],{"id":1039},"the-judge","The judge",[510,1042,1043],{},"The judge runs before every cycle except the first one after the node is\nentered. That first cycle repairs without a judge. The judge also does not run\nwhile a person's steer or a gate review is waiting to be delivered, because the\nsteer already answers what the judge would rule on.",[510,1045,1046,1047,1049,1050,1053,1054,1057,1058,521],{},"Its own ",[514,1048,1009],{}," is not used either. Its instruction lists every round so far\nwith each finding's tag, the attempts used of the limit, and the seconds used\nof the wall clock. It answers in its ",[519,1051,1052],{"href":391},"result file",":\n",[514,1055,1056],{},"verdict",", and its reasoning in ",[514,1059,1060],{},"concerns",[548,1062,1063,1074],{},[551,1064,1065],{},[554,1066,1067,1071],{},[557,1068,1069],{},[514,1070,1056],{},[557,1072,1073],{},"What happens",[570,1075,1076,1088,1101],{},[554,1077,1078,1082],{},[575,1079,1080],{},[514,1081,889],{},[575,1083,1084,1085,1087],{},"The cycle goes ahead. The repair task gets ",[514,1086,1060],{}," as the judge's reasoning.",[554,1089,1090,1094],{},[575,1091,1092],{},[514,1093,893],{},[575,1095,1096,1097,1100],{},"The node is stuck with ",[514,1098,1099],{},"judge: "," and the reasoning.",[554,1102,1103,1107],{},[575,1104,1105],{},[514,1106,897],{},[575,1108,1109,1110,1112],{},"The node completes with the remaining findings unresolved, and ",[514,1111,1060],{}," is the note you see at the review gate. Only when no task in the node failed outright; otherwise the cycle goes ahead.",[510,1114,1115,1116,1118,1119,1122,1123,1125,1126,1128,1129,1134],{},"Kraft reads a verdict only from a judge that ended ",[514,1117,963],{}," or\n",[514,1120,1121],{},"done_with_concerns",". Any other status, a missing verdict or an unknown one\ncounts as ",[514,1124,889],{},". A verdict never buys a cycle past the attempt limit or\nthe wall clock: check 5 runs after the judge. A loop with no ",[514,1127,599],{}," always\ncontinues. Each verdict is recorded as a\n",[519,1130,1131],{"href":743},[514,1132,1133],{},"judge_verdict"," event.",[523,1136,1138],{"id":1137},"related","Related",[749,1140,1141,1146,1151],{},[752,1142,1143,1145],{},[519,1144,382],{"href":383},": the finding Kraft writes for a failed command.",[752,1147,1148,1150],{},[519,1149,390],{"href":391},": how a judge writes its verdict.",[752,1152,1153,1155],{},[519,1154,40],{"href":41},": why loops and caps work this way.",{"title":1157,"searchDepth":1158,"depth":1158,"links":1159},"",2,[1160,1164,1165,1166,1167,1168],{"id":525,"depth":1158,"text":526,"children":1161},[1162],{"id":634,"depth":1163,"text":635},3,{"id":733,"depth":1158,"text":734},{"id":786,"depth":1158,"text":787},{"id":1002,"depth":1158,"text":1003},{"id":1039,"depth":1158,"text":1040},{"id":1137,"depth":1158,"text":1138},"When a node's fix loop opens, what its repair tasks are told, when the judge runs, and what each verdict does.","md",null,{},true,{"title":386,"description":1169},"3bVazrFy_3xC4eXT6KyDV0YXO6ri58xFNY5kA7JWvuQ",[1177,1179],{"title":382,"path":383,"stem":384,"description":1178,"children":-1},"What Kraft passes a subprocess task, how it runs, and how its exit code and result file become a status.",{"title":390,"path":391,"stem":392,"description":1180,"children":-1},"The JSON file a task writes at $KRAFT_RESULT_PATH, and every field Kraft reads from it.",1791801257949]