[{"data":1,"prerenderedAt":1165},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Fcognets\u002Fengine\u002Floop":3},{"id":4,"title":5,"body":6,"description":1158,"extension":1159,"meta":1160,"navigation":166,"path":1161,"seo":1162,"stem":1163,"__hash__":1164},"docs\u002Fdocs\u002Fv2\u002Fcognets\u002Fengine\u002Floop.md","The Loop",{"type":7,"value":8,"toc":1141},"minimark",[9,13,17,183,193,196,201,209,219,261,266,278,330,333,338,372,375,379,395,398,404,503,510,526,532,564,567,575,581,587,591,602,608,735,738,745,749,784,791,808,815,882,888,895,899,902,937,943,953,956,959,963,970,1120,1130,1137],[10,11,5],"h1",{"id":12},"the-loop",[14,15,16],"p",{},"A cognet declares exactly one loop. It is the brain's entry point and the only thing the\nkernel calls.",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-ts shiki shiki-themes dark-plus","loop(async ({ stimuli, signal, stop }) => {\n    await phase(\"sense\", async () => { \u002F* fold what's new *\u002F })\n    await phase(\"think\", async () => { \u002F* decide *\u002F })\n    await phase(\"act\",   async () => { \u002F* emit or run *\u002F })\n\n    stop()\n})\n","ts","",[25,26,27,71,106,133,161,168,177],"code",{"__ignoreMap":23},[28,29,32,36,40,44,47,51,54,57,59,62,65,68],"span",{"class":30,"line":31},"line",1,[28,33,35],{"class":34},"sCudf","loop",[28,37,39],{"class":38},"sTNBD","(",[28,41,43],{"class":42},"scz_3","async",[28,45,46],{"class":38}," ({ ",[28,48,50],{"class":49},"s3F5K","stimuli",[28,52,53],{"class":38},", ",[28,55,56],{"class":49},"signal",[28,58,53],{"class":38},[28,60,61],{"class":49},"stop",[28,63,64],{"class":38}," }) ",[28,66,67],{"class":42},"=>",[28,69,70],{"class":38}," {\n",[28,72,74,78,81,83,87,89,91,94,96,99,103],{"class":30,"line":73},2,[28,75,77],{"class":76},"sYbnZ","    await",[28,79,80],{"class":34}," phase",[28,82,39],{"class":38},[28,84,86],{"class":85},"sKc5r","\"sense\"",[28,88,53],{"class":38},[28,90,43],{"class":42},[28,92,93],{"class":38}," () ",[28,95,67],{"class":42},[28,97,98],{"class":38}," { ",[28,100,102],{"class":101},"sOLPB","\u002F* fold what's new *\u002F",[28,104,105],{"class":38}," })\n",[28,107,109,111,113,115,118,120,122,124,126,128,131],{"class":30,"line":108},3,[28,110,77],{"class":76},[28,112,80],{"class":34},[28,114,39],{"class":38},[28,116,117],{"class":85},"\"think\"",[28,119,53],{"class":38},[28,121,43],{"class":42},[28,123,93],{"class":38},[28,125,67],{"class":42},[28,127,98],{"class":38},[28,129,130],{"class":101},"\u002F* decide *\u002F",[28,132,105],{"class":38},[28,134,136,138,140,142,145,148,150,152,154,156,159],{"class":30,"line":135},4,[28,137,77],{"class":76},[28,139,80],{"class":34},[28,141,39],{"class":38},[28,143,144],{"class":85},"\"act\"",[28,146,147],{"class":38},",   ",[28,149,43],{"class":42},[28,151,93],{"class":38},[28,153,67],{"class":42},[28,155,98],{"class":38},[28,157,158],{"class":101},"\u002F* emit or run *\u002F",[28,160,105],{"class":38},[28,162,164],{"class":30,"line":163},5,[28,165,167],{"emptyLinePlaceholder":166},true,"\n",[28,169,171,174],{"class":30,"line":170},6,[28,172,173],{"class":34},"    stop",[28,175,176],{"class":38},"()\n",[28,178,180],{"class":30,"line":179},7,[28,181,182],{"class":38},"})\n",[14,184,185,188,189,192],{},[25,186,187],{},"src\u002Fmain.ts"," is a raw script, not a module with exports. It runs once at load with the\nambient globals live, and its job is to declare ",[25,190,191],{},"loop()",". Everything it holds in module\nor closure scope is the brain's resident memory for the life of the process.",[14,194,195],{},"Declaring two loops is an error. So is declaring none.",[197,198,200],"h2",{"id":199},"wake-tick-stop","Wake, tick, stop",[14,202,203,204,208],{},"A ",[205,206,207],"strong",{},"wake"," is one invocation of the brain. The kernel schedules it; the cognet cannot.",[14,210,203,211,214,215,218],{},[205,212,213],{},"tick"," is one iteration of the loop body inside that wake. The body runs repeatedly\nuntil it calls ",[25,216,217],{},"stop()"," or the wake is aborted.",[18,220,222],{"className":20,"code":221,"language":22,"meta":23,"style":23},"loop(async ({ stop }) => {\n    \u002F\u002F ... this runs again, and again, until:\n    stop()   \u002F\u002F end the wake after this tick completes\n})\n",[25,223,224,242,247,257],{"__ignoreMap":23},[28,225,226,228,230,232,234,236,238,240],{"class":30,"line":31},[28,227,35],{"class":34},[28,229,39],{"class":38},[28,231,43],{"class":42},[28,233,46],{"class":38},[28,235,61],{"class":49},[28,237,64],{"class":38},[28,239,67],{"class":42},[28,241,70],{"class":38},[28,243,244],{"class":30,"line":73},[28,245,246],{"class":101},"    \u002F\u002F ... this runs again, and again, until:\n",[28,248,249,251,254],{"class":30,"line":108},[28,250,173],{"class":34},[28,252,253],{"class":38},"()   ",[28,255,256],{"class":101},"\u002F\u002F end the wake after this tick completes\n",[28,258,259],{"class":30,"line":135},[28,260,182],{"class":38},[14,262,263,265],{},[25,264,217],{}," is a declaration that the wake is finished, not an immediate exit — the current\ntick runs to completion. The brain stays warm afterward: module scope survives, and the\nnext wake starts with everything still resident.",[14,267,268,269,273,274,277],{},"The distinction matters because it's where a cognet expresses ",[270,271,272],"em",{},"judgment about its own\ncompletion",". ",[25,275,276],{},"zero"," will not stop while it still has unwitnessed results:",[18,279,281],{"className":20,"code":280,"language":22,"meta":23,"style":23},"\u002F\u002F Code this tick means another tick regardless of what the model said —\n\u002F\u002F the model must see its own results before the wake can honestly end.\nif (done && blocks.length === 0) stop()\n",[25,282,283,288,293],{"__ignoreMap":23},[28,284,285],{"class":30,"line":31},[28,286,287],{"class":101},"\u002F\u002F Code this tick means another tick regardless of what the model said —\n",[28,289,290],{"class":30,"line":73},[28,291,292],{"class":101},"\u002F\u002F the model must see its own results before the wake can honestly end.\n",[28,294,295,298,301,304,307,310,313,316,319,323,326,328],{"class":30,"line":108},[28,296,297],{"class":76},"if",[28,299,300],{"class":38}," (",[28,302,303],{"class":49},"done",[28,305,306],{"class":38}," && ",[28,308,309],{"class":49},"blocks",[28,311,312],{"class":38},".",[28,314,315],{"class":49},"length",[28,317,318],{"class":38}," === ",[28,320,322],{"class":321},"sDGX8","0",[28,324,325],{"class":38},") ",[28,327,61],{"class":34},[28,329,176],{"class":38},[14,331,332],{},"That policy belongs to the cognet. The kernel has no opinion about when thinking is\nfinished.",[334,335,337],"h3",{"id":336},"the-runaway-guard","The runaway guard",[18,339,341],{"className":20,"code":340,"language":22,"meta":23,"style":23},"export default defineCognet({\n    maxTicksPerWake: 32,\n})\n",[25,342,343,357,368],{"__ignoreMap":23},[28,344,345,348,351,354],{"class":30,"line":31},[28,346,347],{"class":76},"export",[28,349,350],{"class":76}," default",[28,352,353],{"class":34}," defineCognet",[28,355,356],{"class":38},"({\n",[28,358,359,362,365],{"class":30,"line":73},[28,360,361],{"class":49},"    maxTicksPerWake:",[28,363,364],{"class":321}," 32",[28,366,367],{"class":38},",\n",[28,369,370],{"class":30,"line":108},[28,371,182],{"class":38},[14,373,374],{},"A wake that hasn't converged in this many ticks is a loop bug or a stuck model, not\nprogress. The host throws rather than spinning. It's a safety net, not a scheduling\nmechanism.",[197,376,378],{"id":377},"the-world-clock","The world clock",[14,380,381,53,383,386,387,390,391,394],{},[25,382,213],{},[25,384,385],{},"phase",", and ",[25,388,389],{},"system"," are the ",[205,392,393],{},"only writers of the world clock",". Nothing else\nin the system advances it.",[14,396,397],{},"Each one brackets its callback with telemetry — start, complete, failed, interrupted — so\nthe shape of a thought is recorded as it happens rather than reconstructed afterward.",[334,399,401,403],{"id":400},"phase-a-named-stage",[25,402,385],{}," — a named stage",[18,405,407],{"className":20,"code":406,"language":22,"meta":23,"style":23},"const messages = await phase(\"render\", async () => {\n    return air.render({ base: await kernel.base(), scope: kernel.scope(), history: state.entries })\n})\n",[25,408,409,441,499],{"__ignoreMap":23},[28,410,411,414,418,421,424,426,428,431,433,435,437,439],{"class":30,"line":31},[28,412,413],{"class":42},"const",[28,415,417],{"class":416},"s9McN"," messages",[28,419,420],{"class":38}," = ",[28,422,423],{"class":76},"await",[28,425,80],{"class":34},[28,427,39],{"class":38},[28,429,430],{"class":85},"\"render\"",[28,432,53],{"class":38},[28,434,43],{"class":42},[28,436,93],{"class":38},[28,438,67],{"class":42},[28,440,70],{"class":38},[28,442,443,446,449,451,454,457,460,463,466,468,471,474,477,479,481,484,486,489,492,494,497],{"class":30,"line":73},[28,444,445],{"class":76},"    return",[28,447,448],{"class":49}," air",[28,450,312],{"class":38},[28,452,453],{"class":34},"render",[28,455,456],{"class":38},"({ ",[28,458,459],{"class":49},"base:",[28,461,462],{"class":76}," await",[28,464,465],{"class":49}," kernel",[28,467,312],{"class":38},[28,469,470],{"class":34},"base",[28,472,473],{"class":38},"(), ",[28,475,476],{"class":49},"scope:",[28,478,465],{"class":49},[28,480,312],{"class":38},[28,482,483],{"class":34},"scope",[28,485,473],{"class":38},[28,487,488],{"class":49},"history:",[28,490,491],{"class":49}," state",[28,493,312],{"class":38},[28,495,496],{"class":49},"entries",[28,498,105],{"class":38},[28,500,501],{"class":30,"line":108},[28,502,182],{"class":38},[14,504,505,506,509],{},"Sets ",[25,507,508],{},"state.phase"," for its duration and returns whatever the callback returns. Use it for\nthe major stages of a tick — the ones you'd name if you were describing how the brain\nthinks.",[14,511,512,514,515,53,518,53,520,53,523,312],{},[25,513,276],{}," uses four: ",[25,516,517],{},"sync",[25,519,453],{},[25,521,522],{},"invoke",[25,524,525],{},"act",[334,527,529,531],{"id":528},"system-a-unit-of-work",[25,530,389],{}," — a unit of work",[18,533,535],{"className":20,"code":534,"language":22,"meta":23,"style":23},"await system(\"embed-query\", async () => { \u002F* ... *\u002F })\n",[25,536,537],{"__ignoreMap":23},[28,538,539,541,544,546,549,551,553,555,557,559,562],{"class":30,"line":31},[28,540,423],{"class":76},[28,542,543],{"class":34}," system",[28,545,39],{"class":38},[28,547,548],{"class":85},"\"embed-query\"",[28,550,53],{"class":38},[28,552,43],{"class":42},[28,554,93],{"class":38},[28,556,67],{"class":42},[28,558,98],{"class":38},[28,560,561],{"class":101},"\u002F* ... *\u002F",[28,563,105],{"class":38},[14,565,566],{},"Timed, and stamped with the current tick and phase. Use it for work inside a phase you\nwant to measure separately.",[14,568,569,570,312],{},"The naming is borrowed from ECS deliberately: a system is a unit of work that runs against\nthe world. See ",[571,572,574],"a",{"href":573},"\u002Fdocs\u002Fv2\u002Fcognets\u002Fengine\u002Fworld","The World",[334,576,578,580],{"id":577},"tick-driven-for-you",[25,579,213],{}," — driven for you",[14,582,583,584,312],{},"The host wraps each iteration of your loop body in a tick. You don't call it; you observe\nit in the telemetry and in ",[25,585,586],{},"maxTicksPerWake",[197,588,590],{"id":589},"interrupt-is-a-third-outcome","Interrupt is a third outcome",[14,592,593,594,597,598,601],{},"When a wake is aborted — the user pressed Escape, the process is shutting down — whatever\nthe in-flight ",[25,595,596],{},"phase()"," threw is ",[270,599,600],{},"cancellation surfacing through the call stack",", not a\nfailure of that phase's work.",[14,603,604,605,607],{},"The loop wrappers check the wake's ",[25,606,56],{}," before classifying:",[18,609,611],{"className":20,"code":610,"language":22,"meta":23,"style":23},"catch (cause) {\n    if (signal?.aborted) {\n        void emit(\"cognet:phase:interrupted\", { tick, phase: name })\n        throw cause\n    }\n    void emit(\"cognet:phase:failed\", { tick, phase: name, error: err(cause) })\n    throw failure\n}\n",[25,612,613,626,643,671,679,684,721,729],{"__ignoreMap":23},[28,614,615,618,620,623],{"class":30,"line":31},[28,616,617],{"class":76},"catch",[28,619,300],{"class":38},[28,621,622],{"class":49},"cause",[28,624,625],{"class":38},") {\n",[28,627,628,631,633,635,638,641],{"class":30,"line":73},[28,629,630],{"class":76},"    if",[28,632,300],{"class":38},[28,634,56],{"class":49},[28,636,637],{"class":38},"?.",[28,639,640],{"class":49},"aborted",[28,642,625],{"class":38},[28,644,645,648,651,653,656,659,661,663,666,669],{"class":30,"line":108},[28,646,647],{"class":42},"        void",[28,649,650],{"class":34}," emit",[28,652,39],{"class":38},[28,654,655],{"class":85},"\"cognet:phase:interrupted\"",[28,657,658],{"class":38},", { ",[28,660,213],{"class":49},[28,662,53],{"class":38},[28,664,665],{"class":49},"phase:",[28,667,668],{"class":49}," name",[28,670,105],{"class":38},[28,672,673,676],{"class":30,"line":135},[28,674,675],{"class":76},"        throw",[28,677,678],{"class":49}," cause\n",[28,680,681],{"class":30,"line":163},[28,682,683],{"class":38},"    }\n",[28,685,686,689,691,693,696,698,700,702,704,706,708,711,714,716,718],{"class":30,"line":170},[28,687,688],{"class":42},"    void",[28,690,650],{"class":34},[28,692,39],{"class":38},[28,694,695],{"class":85},"\"cognet:phase:failed\"",[28,697,658],{"class":38},[28,699,213],{"class":49},[28,701,53],{"class":38},[28,703,665],{"class":49},[28,705,668],{"class":49},[28,707,53],{"class":38},[28,709,710],{"class":49},"error:",[28,712,713],{"class":34}," err",[28,715,39],{"class":38},[28,717,622],{"class":49},[28,719,720],{"class":38},") })\n",[28,722,723,726],{"class":30,"line":179},[28,724,725],{"class":76},"    throw",[28,727,728],{"class":49}," failure\n",[28,730,732],{"class":30,"line":731},8,[28,733,734],{"class":38},"}\n",[14,736,737],{},"Interrupted and failed are different events. A cancelled thought is not a broken one, and\nyour telemetry shouldn't claim otherwise.",[14,739,740,741,744],{},"Real failures still emit ",[25,742,743],{},"*:failed"," and rethrow. Telemetry never swallows.",[197,746,748],{"id":747},"the-wake-argument","The wake argument",[18,750,752],{"className":20,"code":751,"language":22,"meta":23,"style":23},"loop(async ({ stimuli, signal, stop }) => { \u002F* ... *\u002F })\n",[25,753,754],{"__ignoreMap":23},[28,755,756,758,760,762,764,766,768,770,772,774,776,778,780,782],{"class":30,"line":31},[28,757,35],{"class":34},[28,759,39],{"class":38},[28,761,43],{"class":42},[28,763,46],{"class":38},[28,765,50],{"class":49},[28,767,53],{"class":38},[28,769,56],{"class":49},[28,771,53],{"class":38},[28,773,61],{"class":49},[28,775,64],{"class":38},[28,777,67],{"class":42},[28,779,98],{"class":38},[28,781,561],{"class":101},[28,783,105],{"class":38},[14,785,786,790],{},[205,787,788],{},[25,789,50],{}," — the entries that arrived since the last wake. An empty diff is the\nordinary steady state, not an edge case to special-case.",[14,792,793,795,796,799,800,803,804,312],{},[25,794,276],{}," ignores this argument entirely. For a log-derived mind the log tail ",[270,797,798],{},"is"," the diff,\nso folding ",[25,801,802],{},"store.session.get({ after: seq })"," covers stimuli, its own outputs, and action\nresults through one door. See ",[571,805,807],{"href":806},"\u002Fdocs\u002Fv2\u002Fcognets\u002Fengine\u002Fmemory","Memory",[14,809,810,814],{},[205,811,812],{},[25,813,56],{}," — the wake's abort leash. Forward it to every long operation:",[18,816,818],{"className":20,"code":817,"language":22,"meta":23,"style":23},"for await (const event of kernel.stream({ messages, signal })) { \u002F* ... *\u002F }\nawait kernel.run(blocks, { signal })\n",[25,819,820,861],{"__ignoreMap":23},[28,821,822,825,827,829,831,834,837,839,841,844,846,849,851,853,856,858],{"class":30,"line":31},[28,823,824],{"class":76},"for",[28,826,462],{"class":76},[28,828,300],{"class":38},[28,830,413],{"class":42},[28,832,833],{"class":416}," event",[28,835,836],{"class":42}," of",[28,838,465],{"class":49},[28,840,312],{"class":38},[28,842,843],{"class":34},"stream",[28,845,456],{"class":38},[28,847,848],{"class":49},"messages",[28,850,53],{"class":38},[28,852,56],{"class":49},[28,854,855],{"class":38}," })) { ",[28,857,561],{"class":101},[28,859,860],{"class":38}," }\n",[28,862,863,865,867,869,872,874,876,878,880],{"class":30,"line":73},[28,864,423],{"class":76},[28,866,465],{"class":49},[28,868,312],{"class":38},[28,870,871],{"class":34},"run",[28,873,39],{"class":38},[28,875,309],{"class":49},[28,877,658],{"class":38},[28,879,56],{"class":49},[28,881,105],{"class":38},[14,883,884,885,887],{},"A cognet that doesn't forward ",[25,886,56],{}," can't be interrupted, and the kernel cannot force\nit. This is the one piece of cooperative behaviour the contract asks for.",[14,889,890,894],{},[205,891,892],{},[25,893,61],{}," — end the wake after this tick.",[197,896,898],{"id":897},"invocation-and-continuous","Invocation and continuous",[14,900,901],{},"A cognet declares how it is triggered:",[18,903,905],{"className":20,"code":904,"language":22,"meta":23,"style":23},"export default defineCognet({\n    mode: { kind: \"invocation\" },\n})\n",[25,906,907,917,933],{"__ignoreMap":23},[28,908,909,911,913,915],{"class":30,"line":31},[28,910,347],{"class":76},[28,912,350],{"class":76},[28,914,353],{"class":34},[28,916,356],{"class":38},[28,918,919,922,924,927,930],{"class":30,"line":73},[28,920,921],{"class":49},"    mode:",[28,923,98],{"class":38},[28,925,926],{"class":49},"kind:",[28,928,929],{"class":85}," \"invocation\"",[28,931,932],{"class":38}," },\n",[28,934,935],{"class":30,"line":108},[28,936,182],{"class":38},[14,938,939,942],{},[205,940,941],{},"Invocation"," — the brain wakes when a stimulus arrives. This is what ships today, and\nwhat every conversational agent uses.",[14,944,945,948,949,952],{},[205,946,947],{},"Continuous"," — the brain wakes on a clock, whether or not anything arrived. This is the\nmode a control loop or perception stack needs, and it is ",[205,950,951],{},"declared but not yet\nimplemented",": selecting it throws.",[14,954,955],{},"The shape is landed — type, wiring, start\u002Fstop lifecycle — deliberately without guessing\nat tick semantics. The open question is wake-overlap policy: when a tick outruns its\ninterval, does the next one skip, queue, or run concurrently? Answering that without a\nreal workload to validate against would be exactly the kind of premature generalization\nthe rest of this design avoids.",[14,957,958],{},"Both modes call the same wake machinery. Neither trigger source knows the other exists.",[197,960,962],{"id":961},"plugins","Plugins",[14,964,965,966,969],{},"Lifecycle hooks live in ",[25,967,968],{},"plugins\u002F",", separate from the loop:",[18,971,973],{"className":20,"code":972,"language":22,"meta":23,"style":23},"export default definePlugin(({ hooks }) => {\n    hooks.on(\"boot\", async () => { \u002F* once, after load *\u002F })\n    hooks.on(\"wake\", async wake => { \u002F* each wake, before the first tick *\u002F })\n    hooks.on(\"tick\", async ({ tick }) => { \u002F* each tick — keep this cheap *\u002F })\n    hooks.on(\"shutdown\", async () => { \u002F* once, at unload *\u002F })\n})\n",[25,974,975,996,1026,1056,1088,1116],{"__ignoreMap":23},[28,976,977,979,981,984,987,990,992,994],{"class":30,"line":31},[28,978,347],{"class":76},[28,980,350],{"class":76},[28,982,983],{"class":34}," definePlugin",[28,985,986],{"class":38},"(({ ",[28,988,989],{"class":49},"hooks",[28,991,64],{"class":38},[28,993,67],{"class":42},[28,995,70],{"class":38},[28,997,998,1001,1003,1006,1008,1011,1013,1015,1017,1019,1021,1024],{"class":30,"line":73},[28,999,1000],{"class":49},"    hooks",[28,1002,312],{"class":38},[28,1004,1005],{"class":34},"on",[28,1007,39],{"class":38},[28,1009,1010],{"class":85},"\"boot\"",[28,1012,53],{"class":38},[28,1014,43],{"class":42},[28,1016,93],{"class":38},[28,1018,67],{"class":42},[28,1020,98],{"class":38},[28,1022,1023],{"class":101},"\u002F* once, after load *\u002F",[28,1025,105],{"class":38},[28,1027,1028,1030,1032,1034,1036,1039,1041,1043,1046,1049,1051,1054],{"class":30,"line":108},[28,1029,1000],{"class":49},[28,1031,312],{"class":38},[28,1033,1005],{"class":34},[28,1035,39],{"class":38},[28,1037,1038],{"class":85},"\"wake\"",[28,1040,53],{"class":38},[28,1042,43],{"class":42},[28,1044,1045],{"class":49}," wake",[28,1047,1048],{"class":42}," =>",[28,1050,98],{"class":38},[28,1052,1053],{"class":101},"\u002F* each wake, before the first tick *\u002F",[28,1055,105],{"class":38},[28,1057,1058,1060,1062,1064,1066,1069,1071,1073,1075,1077,1079,1081,1083,1086],{"class":30,"line":135},[28,1059,1000],{"class":49},[28,1061,312],{"class":38},[28,1063,1005],{"class":34},[28,1065,39],{"class":38},[28,1067,1068],{"class":85},"\"tick\"",[28,1070,53],{"class":38},[28,1072,43],{"class":42},[28,1074,46],{"class":38},[28,1076,213],{"class":49},[28,1078,64],{"class":38},[28,1080,67],{"class":42},[28,1082,98],{"class":38},[28,1084,1085],{"class":101},"\u002F* each tick — keep this cheap *\u002F",[28,1087,105],{"class":38},[28,1089,1090,1092,1094,1096,1098,1101,1103,1105,1107,1109,1111,1114],{"class":30,"line":163},[28,1091,1000],{"class":49},[28,1093,312],{"class":38},[28,1095,1005],{"class":34},[28,1097,39],{"class":38},[28,1099,1100],{"class":85},"\"shutdown\"",[28,1102,53],{"class":38},[28,1104,43],{"class":42},[28,1106,93],{"class":38},[28,1108,67],{"class":42},[28,1110,98],{"class":38},[28,1112,1113],{"class":101},"\u002F* once, at unload *\u002F",[28,1115,105],{"class":38},[28,1117,1118],{"class":30,"line":170},[28,1119,182],{"class":38},[14,1121,1122,1123,1126,1127,1129],{},"Four fixed points, awaited to completion in order. ",[25,1124,1125],{},"boot"," is where a cold-start\nrehydration belongs; ",[25,1128,213],{}," is on the hot path and should stay light.",[14,1131,1132,1133,1136],{},"Plugins register at import time, before ",[25,1134,1135],{},"load()"," fires — so a plugin's hooks are in place\nbefore the brain's first breath.",[1138,1139,1140],"style",{},"html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}html pre.shiki code .sTNBD, html code.shiki .sTNBD{--shiki-default:#D4D4D4}html pre.shiki code .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .s3F5K, html code.shiki .s3F5K{--shiki-default:#9CDCFE}html pre.shiki code .sYbnZ, html code.shiki .sYbnZ{--shiki-default:#C586C0}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}html pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}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 pre.shiki code .sDGX8, html code.shiki .sDGX8{--shiki-default:#B5CEA8}html pre.shiki code .s9McN, html code.shiki .s9McN{--shiki-default:#4FC1FF}",{"title":23,"searchDepth":73,"depth":73,"links":1142},[1143,1146,1154,1155,1156,1157],{"id":199,"depth":73,"text":200,"children":1144},[1145],{"id":336,"depth":108,"text":337},{"id":377,"depth":73,"text":378,"children":1147},[1148,1150,1152],{"id":400,"depth":108,"text":1149},"phase — a named stage",{"id":528,"depth":108,"text":1151},"system — a unit of work",{"id":577,"depth":108,"text":1153},"tick — driven for you",{"id":589,"depth":73,"text":590},{"id":747,"depth":73,"text":748},{"id":897,"depth":73,"text":898},{"id":961,"depth":73,"text":962},"loop, tick, phase, system, stop — and the world clock they drive.","md",{},"\u002Fdocs\u002Fv2\u002Fcognets\u002Fengine\u002Floop",{"title":5,"description":1158},"docs\u002Fv2\u002Fcognets\u002Fengine\u002Floop","8vwHB_tSNXxaQN8w7fmaRKwgJw85aElI1xfj06l3PNY",1785156432059]