[{"data":1,"prerenderedAt":965},["ShallowReactive",2],{"navigation_docs":3,"-docs-guide-refine":151,"-docs-guide-refine-surround":960},[4,8,45,111,121],{"title":5,"path":6,"stem":7},"TheSpider Documentation","\u002Fdocs","docs\u002Findex",{"title":9,"icon":10,"path":11,"stem":12,"children":13,"page":44},"Getting Started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[14,19,24,29,34,39],{"title":15,"path":16,"stem":17,"icon":18},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction","i-lucide-house",{"title":20,"path":21,"stem":22,"icon":23},"AI Setup Wizard","\u002Fdocs\u002Fgetting-started\u002Fai-setup","docs\u002F1.getting-started\u002F2.ai-setup","i-lucide-sparkles",{"title":25,"path":26,"stem":27,"icon":28},"Install the agent","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F1.getting-started\u002F3.installation","i-lucide-download",{"title":30,"path":31,"stem":32,"icon":33},"Cloud quickstart","\u002Fdocs\u002Fgetting-started\u002Fquickstart","docs\u002F1.getting-started\u002F4.quickstart","i-lucide-zap",{"title":35,"path":36,"stem":37,"icon":38},"Connect over MCP","\u002Fdocs\u002Fgetting-started\u002Fmcp","docs\u002F1.getting-started\u002F5.mcp","i-lucide-plug",{"title":40,"path":41,"stem":42,"icon":43},"Pricing","\u002Fdocs\u002Fgetting-started\u002Fpricing","docs\u002F1.getting-started\u002F6.pricing","i-lucide-badge-dollar-sign",false,{"title":46,"icon":47,"path":48,"stem":49,"children":50,"page":44},"Guide","i-lucide-book-open","\u002Fdocs\u002Fguide","docs\u002F2.guide",[51,56,61,66,71,76,81,86,91,96,101,106],{"title":52,"path":53,"stem":54,"icon":55},"Configuration","\u002Fdocs\u002Fguide\u002Fconfiguration","docs\u002F2.guide\u002F01.configuration","i-lucide-settings",{"title":57,"path":58,"stem":59,"icon":60},"The agent","\u002Fdocs\u002Fguide\u002Fagent","docs\u002F2.guide\u002F02.agent","i-lucide-terminal",{"title":62,"path":63,"stem":64,"icon":65},"Campaigns","\u002Fdocs\u002Fguide\u002Fcampaigns","docs\u002F2.guide\u002F03.campaigns","i-lucide-layers",{"title":67,"path":68,"stem":69,"icon":70},"Campaign cadence","\u002Fdocs\u002Fguide\u002Faudit-workflows","docs\u002F2.guide\u002F04.audit-workflows","i-lucide-git-compare-arrows",{"title":72,"path":73,"stem":74,"icon":75},"Triage","\u002Fdocs\u002Fguide\u002Ftriage","docs\u002F2.guide\u002F05.triage","i-lucide-list-checks",{"title":77,"path":78,"stem":79,"icon":80},"PR gate","\u002Fdocs\u002Fguide\u002Fpr-gate","docs\u002F2.guide\u002F06.pr-gate","i-lucide-git-pull-request",{"title":82,"path":83,"stem":84,"icon":85},"Data handling & privacy","\u002Fdocs\u002Fguide\u002Fdata-handling","docs\u002F2.guide\u002F07.data-handling","i-lucide-shield-check",{"title":87,"path":88,"stem":89,"icon":90},"Author an audit methodology","\u002Fdocs\u002Fguide\u002Fmethodology","docs\u002F2.guide\u002F08.methodology","i-lucide-panels-top-left",{"title":92,"path":93,"stem":94,"icon":95},"Configure a custom model runner","\u002Fdocs\u002Fguide\u002Fcustom-runner","docs\u002F2.guide\u002F09.custom-runner","i-lucide-terminal-square",{"title":97,"path":98,"stem":99,"icon":100},"Runner troubleshooting","\u002Fdocs\u002Fguide\u002Ftroubleshooting","docs\u002F2.guide\u002F10.troubleshooting","i-lucide-wrench",{"title":102,"path":103,"stem":104,"icon":105},"Host an external execution agent","\u002Fdocs\u002Fguide\u002Fexternal-agent","docs\u002F2.guide\u002F11.external-agent","i-lucide-plug-zap",{"title":107,"path":108,"stem":109,"icon":110},"Refine","\u002Fdocs\u002Fguide\u002Frefine","docs\u002F2.guide\u002F12.refine","i-lucide-repeat",{"title":112,"icon":113,"path":114,"stem":115,"children":116,"page":44},"Deploy","i-lucide-server","\u002Fdocs\u002Fdeploy","docs\u002F3.deploy",[117],{"title":118,"path":119,"stem":120,"icon":113},"On-prem overview","\u002Fdocs\u002Fdeploy\u002Fonprem","docs\u002F3.deploy\u002F2.onprem",{"title":122,"icon":123,"path":124,"stem":125,"children":126,"page":44},"Reference","i-lucide-code","\u002Fdocs\u002Freference","docs\u002F4.reference",[127,132,137,142,146],{"title":128,"path":129,"stem":130,"icon":131},"API reference","\u002Fdocs\u002Freference\u002Fapi","docs\u002F4.reference\u002F1.api","i-lucide-code-xml",{"title":133,"path":134,"stem":135,"icon":136},"Concepts and glossary","\u002Fdocs\u002Freference\u002Fconcepts","docs\u002F4.reference\u002F2.concepts","i-lucide-book-marked",{"title":138,"path":139,"stem":140,"icon":141},"Runner contract","\u002Fdocs\u002Freference\u002Frunner-contract","docs\u002F4.reference\u002F3.runner-contract","i-lucide-file-json-2",{"title":143,"path":144,"stem":145,"icon":28},"Findings export","\u002Fdocs\u002Freference\u002Ffindings-export","docs\u002F4.reference\u002F4.findings-export",{"title":147,"path":148,"stem":149,"icon":150},"Agent CLI contracts","\u002Fdocs\u002Freference\u002Fagent-cli-json","docs\u002F4.reference\u002F5.agent-cli-json","i-lucide-braces",{"id":152,"title":107,"body":153,"description":953,"extension":954,"links":955,"meta":956,"navigation":957,"path":108,"seo":958,"stem":109,"__hash__":959},"docs\u002Fdocs\u002F2.guide\u002F12.refine.md",{"type":154,"value":155,"toc":941},"minimark",[156,177,188,191,196,298,301,322,326,336,558,591,595,724,730,734,737,743,776,781,785,792,809,815,819,832,836,861,872,876,879,911,914,918,937],[157,158,159,163,164,168,169,172,173,176],"p",{},[160,161,162],"code",{},"thespider-agent refine"," picks ",[165,166,167],"strong",{},"actionable"," findings, has a local model write a fix, records the commits as a ",[165,170,171],{},"proposed"," fix, then runs a retest. It repeats until that backlog is empty or ",[160,174,175],{},"--max-iterations"," is hit.",[157,178,179,180,183,184,187],{},"Refine itself never writes ",[160,181,182],{},"fixed"," or ",[160,185,186],{},"still_vulnerable",". Only a finished retest does.",[189,190],"docs-refine-sequence",{},[192,193,195],"h2",{"id":194},"one-iteration","One iteration",[197,198,199,237,253,262,278,287],"ol",{},[200,201,202,205,206,209,210,213,214,217,218,221,222,224,225,228,229,232,233,236],"li",{},[165,203,204],{},"Select."," ",[160,207,208],{},"status=actionable",", filtered by ",[160,211,212],{},"--min-severity"," (a floor: ",[160,215,216],{},"high"," means ",[160,219,220],{},"critical"," and ",[160,223,216],{},"), ",[160,226,227],{},"--branch",", and ",[160,230,231],{},"--profile",". Sorted by severity, capped at 100. A truncated list is disclosed, never called \"clear\". Empty list exits ",[160,234,235],{},"0",".",[200,238,239,242,243,248,249,252],{},[165,240,241],{},"Fix."," Re-fetch each finding (skip it if a human already triaged it). Render the ",[244,245,247],"a",{"href":246},"\u002Fdocs\u002Freference\u002Fagent-cli-json#markdown-packet","finding packet"," into a fix prompt. Run the fix binding in ",[165,250,251],{},"agentic"," mode in the worktree. The prompt asks for a small targeted fix, cheap tests, a commit, and no push.",[200,254,255,258,259,261],{},[165,256,257],{},"Validate."," Counts only if the model exited ",[160,260,235],{},", the tree is clean, and at least one new commit has the pre-fix HEAD as an ancestor. Otherwise that finding is a no-op.",[200,263,264,205,267,270,271,273,274,277],{},[165,265,266],{},"Record.",[160,268,269],{},"needs_retest"," plus the commit list. The server stores a ",[160,272,171],{}," fix row and sets ",[160,275,276],{},"fixed_at_commit"," to the last SHA. The finding stays actionable.",[200,279,280,283,284,286],{},[165,281,282],{},"Retest."," Create a retest campaign at the post-fix HEAD, run its slices with the retest binding, wait until it finishes. Failed slices mark the run degraded; the finding stays ",[160,285,269],{}," and comes back next iteration.",[200,288,289,205,292,294,295,297],{},[165,290,291],{},"Re-list.",[160,293,182],{}," drops out of actionable. ",[160,296,186],{}," stays in.",[157,299,300],{},"An iteration that made zero new commits and worked zero campaigns stops early.",[157,302,303,304,221,307,310,311,317,318,321],{},"Retest slices go through the same runner as ",[160,305,306],{},"run",[160,308,309],{},"daemon",", so each one leaves a per-lease run log you can follow with ",[244,312,314],{"href":313},"\u002Fdocs\u002Fguide\u002Fagent#logs",[160,315,316],{},"thespider-agent log",". The ",[165,319,320],{},"fix"," runs in step 2 use a different runner and are not logged that way.",[192,323,325],{"id":324},"flags","Flags",[327,328,333],"pre",{"className":329,"code":331,"language":332},[330],"language-text","thespider-agent refine [--max-iterations N] [--min-severity SEV] [--branch NAME] [--list]\n                       [--model CODE] [--retest-model CODE] [--fix-timeout SECS] [--retest-timeout SECS]\n                       [--in-place] [--profile security|bugs] [--redact] [--json]\n","text",[160,334,331],{"__ignoreMap":335},"",[337,338,339,355],"table",{},[340,341,342],"thead",{},[343,344,345,349,352],"tr",{},[346,347,348],"th",{},"Flag",[346,350,351],{},"Default",[346,353,354],{},"Meaning",[356,357,358,377,395,410,429,445,466,479,494,506,528,543],"tbody",{},[343,359,360,365,370],{},[361,362,363],"td",{},[160,364,175],{},[361,366,367],{},[160,368,369],{},"3",[361,371,372,373,376],{},"Stop after N loops. ",[160,374,375],{},"1"," is fix once and verify.",[343,378,379,383,386],{},[361,380,381],{},[160,382,212],{},[361,384,385],{},"none",[361,387,388,389,391,392,236],{},"A floor, not a set. ",[160,390,216],{}," expands to ",[160,393,394],{},"critical,high",[343,396,397,401,403],{},[361,398,399],{},[160,400,227],{},[361,402,385],{},[361,404,405,406,409],{},"Filter ",[165,407,408],{},"and"," guardrail: the checkout must already be on this branch.",[343,411,412,417,420],{},[361,413,414],{},[160,415,416],{},"--list",[361,418,419],{},"off",[361,421,422,423,425,426,428],{},"Dry run. Print the selection, write nothing. Exit ",[160,424,235],{}," if empty, ",[160,427,375],{}," if work remains.",[343,430,431,436,439],{},[361,432,433],{},[160,434,435],{},"--model",[361,437,438],{},"first project binding",[361,440,441,442,236],{},"The models.dev code that ",[165,443,444],{},"fixes",[343,446,447,452,457],{},[361,448,449],{},[160,450,451],{},"--retest-model",[361,453,454,455],{},"same as ",[160,456,435],{},[361,458,441,459,462,463,236],{},[165,460,461],{},"retests",". Required when the fixer is a freeform ",[160,464,465],{},"command",[343,467,468,473,476],{},[361,469,470],{},[160,471,472],{},"--fix-timeout",[361,474,475],{},"binding timeout",[361,477,478],{},"Seconds for one agentic fix.",[343,480,481,486,491],{},[361,482,483],{},[160,484,485],{},"--retest-timeout",[361,487,488],{},[160,489,490],{},"1800",[361,492,493],{},"Seconds to wait for each retest campaign.",[343,495,496,501,503],{},[361,497,498],{},[160,499,500],{},"--in-place",[361,502,419],{},[361,504,505],{},"Fix in the parent checkout. Needs a clean tree. No merge copy at the end.",[343,507,508,512,515],{},[361,509,510],{},[160,511,231],{},[361,513,514],{},"repo config",[361,516,517,183,520,523,524,527],{},[160,518,519],{},"security",[160,521,522],{},"bugs",". ",[160,525,526],{},"all"," is rejected.",[343,529,530,535,537],{},[361,531,532],{},[160,533,534],{},"--redact",[361,536,419],{},[361,538,539,540,236],{},"Same client-side stdout scrub as ",[160,541,542],{},"run --redact",[343,544,545,550,552],{},[361,546,547],{},[160,548,549],{},"--json",[361,551,419],{},[361,553,554,555,236],{},"Versioned envelope. See ",[244,556,147],{"href":557},"\u002Fdocs\u002Freference\u002Fagent-cli-json#refine",[327,559,563],{"className":560,"code":561,"language":562,"meta":335,"style":335},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","thespider-agent refine --min-severity high --max-iterations 2\n","bash",[160,564,565],{"__ignoreMap":335},[566,567,570,574,578,581,584,587],"span",{"class":568,"line":569},"line",1,[566,571,573],{"class":572},"sBMFI","thespider-agent",[566,575,577],{"class":576},"sfazB"," refine",[566,579,580],{"class":576}," --min-severity",[566,582,583],{"class":576}," high",[566,585,586],{"class":576}," --max-iterations",[566,588,590],{"class":589},"sbssI"," 2\n",[192,592,594],{"id":593},"exit-codes","Exit codes",[337,596,597,609],{},[340,598,599],{},[343,600,601,604,607],{},[346,602,603],{},"Code",[346,605,606],{},"Name",[346,608,354],{},[356,610,611,625,641,657,672,694,709],{},[343,612,613,617,622],{},[361,614,615],{},[160,616,235],{},[361,618,619],{},[160,620,621],{},"OK",[361,623,624],{},"Selected backlog is empty.",[343,626,627,631,636],{},[361,628,629],{},[160,630,375],{},[361,632,633],{},[160,634,635],{},"FINDINGS",[361,637,638,639,236],{},"Work remains after ",[160,640,175],{},[343,642,643,647,652],{},[361,644,645],{},[160,646,369],{},[361,648,649],{},[160,650,651],{},"TIMEOUT",[361,653,654,655,236],{},"A retest wait exceeded ",[160,656,485],{},[343,658,659,664,669],{},[361,660,661],{},[160,662,663],{},"4",[361,665,666],{},[160,667,668],{},"DEGRADED",[361,670,671],{},"A retest finished with failed slices, or with no conclusion.",[343,673,674,679,684],{},[361,675,676],{},[160,677,678],{},"5",[361,680,681],{},[160,682,683],{},"USAGE",[361,685,686,687,690,691,236],{},"Bad flags, ",[160,688,689],{},"--profile all",", unbound models, or a ",[160,692,693],{},"409 commit_mismatch",[343,695,696,701,706],{},[361,697,698],{},[160,699,700],{},"6",[361,702,703],{},[160,704,705],{},"OPERATIONAL",[361,707,708],{},"Transport, auth, or missing worktree tooling.",[343,710,711,716,721],{},[361,712,713],{},[160,714,715],{},"7",[361,717,718],{},[160,719,720],{},"INTERRUPTED",[361,722,723],{},"SIGINT\u002FSIGTERM. The worktree is left in place with resume hints.",[157,725,726,727,236],{},"When several apply: ",[160,728,729],{},"7 > 3 > 4 > 1 > 0",[192,731,733],{"id":732},"worktree","Worktree",[157,735,736],{},"By default refine works in a throwaway git worktree, so your checkout is not the fix agent's working directory:",[327,738,741],{"className":739,"code":740,"language":332,"meta":335},[330],"git worktree add \u003Ctmp> -b thespider\u002Frefine\u002F\u003Cproject-slug>-\u003Cutc-ts> \u003Cparent HEAD>\n",[160,742,740],{"__ignoreMap":335},[744,745,746,752,755,769],"ul",{},[200,747,748,749,236],{},"The worktree is removed on a normal exit. The ",[165,750,751],{},"branch is kept",[200,753,754],{},"Merge instructions print at the end (worktree mode only).",[200,756,757,758,761,762,765,766,236],{},"A failing ",[160,759,760],{},"pre-push"," hook is installed in the worktree, so the agent cannot ",[160,763,764],{},"git push",". Commits are authored as ",[160,767,768],{},"thespider-agent \u003Crefine@thespider.local>",[200,770,771,772,775],{},"Campaigns record your ",[165,773,774],{},"original checkout branch",", not the worktree branch name.",[157,777,778,780],{},[160,779,500],{}," skips the worktree. The tree must be clean before each fix.",[192,782,784],{"id":783},"before-you-point-it-at-a-repo","Before you point it at a repo",[157,786,787,788,791],{},"Finding text is model-derived. The packet renderer strips heading forgeries and control characters, but the fix agent is a ",[165,789,790],{},"writer",": your credentials, your network, your host. A worktree keeps its commits off your branch. It is not a sandbox.",[157,793,794,795,797,798,801,802,805,806,808],{},"A freeform ",[160,796,465],{}," runs exactly what you wrote. Built-in agentic modes (",[160,799,800],{},"acceptEdits",", ",[160,803,804],{},"workspace-write",") auto-approve edits and can still hang on other prompts. ",[160,807,472],{}," bounds that.",[157,810,811,812,814],{},"The push blocker is a git hook, not a network control. It stops ",[160,813,764],{},". It does not stop anything that talks to the remote another way.",[192,816,818],{"id":817},"metering","Metering",[157,820,821,822,825,826,829,830,236],{},"Every retest slice is a billable ",[160,823,824],{},"slice_claim"," at claim time (first claim per slice; retries do not double-count). Retest ingest may also meter ",[160,827,828],{},"ai_dedupe_call",". Refine prints the campaign id, slice count, and that note as each campaign is created. Plan limits: ",[244,831,40],{"href":41},[192,833,835],{"id":834},"proposed-vs-fixed","Proposed vs fixed",[744,837,838,846,855],{},[200,839,840,842,843,845],{},[160,841,269],{}," + commits writes a ",[160,844,171],{}," fix row. The finding stays actionable.",[200,847,848,849,851,852,236],{},"A retest that does not see it again concludes ",[160,850,182],{}," and marks that row ",[160,853,854],{},"verified",[200,856,857,858,860],{},"A retest that sees it again concludes ",[160,859,186],{},". The proposed row stays proposed for the next fix.",[157,862,863,864,866,867,866,869,871],{},"If refine crashes mid-run, the next run re-selects the same finding. Expect history to cycle ",[160,865,269],{}," → ",[160,868,186],{},[160,870,269],{}," until a fix verifies. That trail is the point.",[192,873,875],{"id":874},"interrupt","Interrupt",[157,877,878],{},"On interrupt, refine leaves the worktree and prints its path, branch, in-flight campaign ids, and:",[327,880,882],{"className":560,"code":881,"language":562,"meta":335,"style":335},"thespider-agent run --campaign \u003Cid> --once\n",[160,883,884],{"__ignoreMap":335},[566,885,886,888,891,894,898,901,905,908],{"class":568,"line":569},[566,887,573],{"class":572},[566,889,890],{"class":576}," run",[566,892,893],{"class":576}," --campaign",[566,895,897],{"class":896},"sMK4o"," \u003C",[566,899,900],{"class":576},"i",[566,902,904],{"class":903},"sTEyZ","d",[566,906,907],{"class":896},">",[566,909,910],{"class":576}," --once\n",[157,912,913],{},"A later refine run warns about non-terminal retest campaigns and prints the same hint.",[192,915,917],{"id":916},"next","Next",[744,919,920,924,928,933],{},[200,921,922],{},[244,923,62],{"href":63},[200,925,926],{},[244,927,72],{"href":73},[200,929,930],{},[244,931,932],{"href":93},"Custom runners",[200,934,935],{},[244,936,147],{"href":557},[938,939,940],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":335,"searchDepth":942,"depth":942,"links":943},2,[944,945,946,947,948,949,950,951,952],{"id":194,"depth":942,"text":195},{"id":324,"depth":942,"text":325},{"id":593,"depth":942,"text":594},{"id":732,"depth":942,"text":733},{"id":783,"depth":942,"text":784},{"id":817,"depth":942,"text":818},{"id":834,"depth":942,"text":835},{"id":874,"depth":942,"text":875},{"id":916,"depth":942,"text":917},"Let a local model fix findings, retest each one, and repeat until the backlog is clear","md",null,{},{"icon":110},{"title":107,"description":953},"IVa9hU0oRjWzC34zwHauk4TX-gY4Sk-uZGJhzn2Ss_g",[961,963],{"title":102,"path":103,"stem":104,"description":962,"icon":105,"children":-1},"Claim a slice, run it, heartbeat, and post raw output from your own runner host",{"title":118,"path":119,"stem":120,"description":964,"icon":113,"children":-1},"When to run TheSpider on your own infrastructure",1787294098872]