[{"data":1,"prerenderedAt":1739},["ShallowReactive",2],{"docs-navigation":3,"docs-page-\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Fgo":252,"docs-surround-\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Fgo":1736},[4],{"title":5,"path":6,"stem":7,"children":8,"page":251},"Docs","\u002Fdocs","docs",[9,36,101,197,232],{"title":10,"path":11,"stem":12,"children":13},"GET STARTED","\u002Fdocs\u002Fget-started","docs\u002F1.get-started\u002F1.index",[14,16,20,24,28,32],{"title":15,"path":11,"stem":12},"Welcome",{"title":17,"path":18,"stem":19},"Quickstart","\u002Fdocs\u002Fget-started\u002Fquickstart","docs\u002F1.get-started\u002F2.quickstart",{"title":21,"path":22,"stem":23},"API","\u002Fdocs\u002Fget-started\u002Fapi","docs\u002F1.get-started\u002F3.api",{"title":25,"path":26,"stem":27},"SDKs and CLI","\u002Fdocs\u002Fget-started\u002Fsdks-cli","docs\u002F1.get-started\u002F4.sdks-cli",{"title":29,"path":30,"stem":31},"Sandbox testing","\u002Fdocs\u002Fget-started\u002Flocal-development","docs\u002F1.get-started\u002F5.local-development",{"title":33,"path":34,"stem":35},"Authentication","\u002Fdocs\u002Fget-started\u002Fauthentication","docs\u002F1.get-started\u002F6.authentication",{"title":37,"path":38,"stem":39,"children":40},"FUNDAMENTALS","\u002Fdocs\u002Ffundamentals","docs\u002F2.fundamentals\u002F01.index",[41,43,47,51,55,59,63,67,71,75],{"title":42,"path":38,"stem":39},"Fundamentals",{"title":44,"path":45,"stem":46},"Architecture","\u002Fdocs\u002Ffundamentals\u002Farchitecture","docs\u002F2.fundamentals\u002F02.architecture",{"title":48,"path":49,"stem":50},"Memory model","\u002Fdocs\u002Ffundamentals\u002Fmemory-model","docs\u002F2.fundamentals\u002F03.memory-model",{"title":52,"path":53,"stem":54},"Compression","\u002Fdocs\u002Ffundamentals\u002Fcompression","docs\u002F2.fundamentals\u002F04.compression",{"title":56,"path":57,"stem":58},"RAG and cached context","\u002Fdocs\u002Ffundamentals\u002Frag-cag","docs\u002F2.fundamentals\u002F05.rag-cag",{"title":60,"path":61,"stem":62},"Context cache","\u002Fdocs\u002Ffundamentals\u002Fcontext-cache","docs\u002F2.fundamentals\u002F06.context-cache",{"title":64,"path":65,"stem":66},"Security","\u002Fdocs\u002Ffundamentals\u002Fsecurity","docs\u002F2.fundamentals\u002F07.security",{"title":68,"path":69,"stem":70},"Languages","\u002Fdocs\u002Ffundamentals\u002Flanguages","docs\u002F2.fundamentals\u002F08.languages",{"title":72,"path":73,"stem":74},"UI patterns","\u002Fdocs\u002Ffundamentals\u002Fui","docs\u002F2.fundamentals\u002F09.ui",{"title":76,"path":77,"stem":78,"children":79},"Global, Regional, and Jurisdictional Memory","\u002Fdocs\u002Ffundamentals\u002Fdata-placement","docs\u002F2.fundamentals\u002F10.data-placement\u002F1.index",[80,81,85,89,93,97],{"title":76,"path":77,"stem":78},{"title":82,"path":83,"stem":84},"TypeScript \u002F JavaScript","\u002Fdocs\u002Ffundamentals\u002Fdata-placement\u002Ftypescript","docs\u002F2.fundamentals\u002F10.data-placement\u002F2.typescript",{"title":86,"path":87,"stem":88},"Python","\u002Fdocs\u002Ffundamentals\u002Fdata-placement\u002Fpython","docs\u002F2.fundamentals\u002F10.data-placement\u002F3.python",{"title":90,"path":91,"stem":92},"PHP","\u002Fdocs\u002Ffundamentals\u002Fdata-placement\u002Fphp","docs\u002F2.fundamentals\u002F10.data-placement\u002F4.php",{"title":94,"path":95,"stem":96},"Go","\u002Fdocs\u002Ffundamentals\u002Fdata-placement\u002Fgo","docs\u002F2.fundamentals\u002F10.data-placement\u002F5.go",{"title":98,"path":99,"stem":100},"Rust","\u002Fdocs\u002Ffundamentals\u002Fdata-placement\u002Frust","docs\u002F2.fundamentals\u002F10.data-placement\u002F6.rust",{"title":102,"path":103,"stem":104,"children":105},"AGENTS & CODE NUCLEI","\u002Fdocs\u002Fagents","docs\u002F3.agents\u002F01.index",[106,108,112,116,120,124,128,132,136,140,158,193],{"title":107,"path":103,"stem":104},"Agents",{"title":109,"path":110,"stem":111},"Codex Code Nucleus","\u002Fdocs\u002Fagents\u002Fcodex-code-nucleus","docs\u002F3.agents\u002F02.codex-code-nucleus",{"title":113,"path":114,"stem":115},"Claude Code Nucleus","\u002Fdocs\u002Fagents\u002Fclaude-code-nucleus","docs\u002F3.agents\u002F03.claude-code-nucleus",{"title":117,"path":118,"stem":119},"Google Gemini Code Nucleus","\u002Fdocs\u002Fagents\u002Fgoogle-gemini-code-nucleus","docs\u002F3.agents\u002F04.google-gemini-code-nucleus",{"title":121,"path":122,"stem":123},"GitHub Copilot Code Nucleus","\u002Fdocs\u002Fagents\u002Fgithub-copilot-code-nucleus","docs\u002F3.agents\u002F05.github-copilot-code-nucleus",{"title":125,"path":126,"stem":127},"Cursor Code Nucleus","\u002Fdocs\u002Fagents\u002Fcursor-code-nucleus","docs\u002F3.agents\u002F06.cursor-code-nucleus",{"title":129,"path":130,"stem":131},"Windsurf Code Nucleus","\u002Fdocs\u002Fagents\u002Fwindsurf-code-nucleus","docs\u002F3.agents\u002F07.windsurf-code-nucleus",{"title":133,"path":134,"stem":135},"Agent skills","\u002Fdocs\u002Fagents\u002Fagent-skills","docs\u002F3.agents\u002F08.agent-skills",{"title":137,"path":138,"stem":139},"Admin UI prompt","\u002Fdocs\u002Fagents\u002Fadmin-ui-prompt","docs\u002F3.agents\u002F09.admin-ui-prompt",{"title":141,"path":142,"stem":143,"children":144},"Team Code Governance","\u002Fdocs\u002Fagents\u002Fcode-governance","docs\u002F3.agents\u002F10.code-governance\u002F1.index",[145,146,150,154],{"title":141,"path":142,"stem":143},{"title":147,"path":148,"stem":149},"Local Team Setup","\u002Fdocs\u002Fagents\u002Fcode-governance\u002Flocal-team-setup","docs\u002F3.agents\u002F10.code-governance\u002F2.local-team-setup",{"title":151,"path":152,"stem":153},"Language Governance Packs","\u002Fdocs\u002Fagents\u002Fcode-governance\u002Flanguage-packs","docs\u002F3.agents\u002F10.code-governance\u002F3.language-packs",{"title":155,"path":156,"stem":157},"GitHub CI\u002FCD Governance","\u002Fdocs\u002Fagents\u002Fcode-governance\u002Fgithub-cicd","docs\u002F3.agents\u002F10.code-governance\u002F4.github-cicd",{"title":159,"path":160,"stem":161,"children":162},"Memory + Consequence Agents","\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F1.index",[163,164,185,189],{"title":159,"path":160,"stem":161},{"title":165,"path":166,"stem":167,"children":168},"End-to-End Agent Example","\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F1.index",[169,170,173,176,179,182],{"title":165,"path":166,"stem":167},{"title":82,"path":171,"stem":172},"\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Ftypescript","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F2.typescript",{"title":86,"path":174,"stem":175},"\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Fpython","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F3.python",{"title":90,"path":177,"stem":178},"\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Fphp","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F4.php",{"title":94,"path":180,"stem":181},"\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Fgo","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F5.go",{"title":98,"path":183,"stem":184},"\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Frust","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F6.rust",{"title":186,"path":187,"stem":188},"Industry Agent Use Cases","\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Findustry-use-cases","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F3.industry-use-cases",{"title":190,"path":191,"stem":192},"Historical Actions and Learning","\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fhistorical-learning","docs\u002F3.agents\u002F11.memory-consequence-agents\u002F4.historical-learning",{"title":194,"path":195,"stem":196},"Consequence decision support","\u002Fdocs\u002Fagents\u002Fconsequence","docs\u002F3.agents\u002F12.consequence",{"title":198,"path":199,"stem":200,"children":201},"MODEL PROVIDERS","\u002Fdocs\u002Fproviders","docs\u002F4.providers\u002F1.index",[202,204,208,212,216,220,224,228],{"title":203,"path":199,"stem":200},"Providers",{"title":205,"path":206,"stem":207},"OpenAI and Azure OpenAI","\u002Fdocs\u002Fproviders\u002Fopenai","docs\u002F4.providers\u002F2.openai",{"title":209,"path":210,"stem":211},"Anthropic Claude","\u002Fdocs\u002Fproviders\u002Fanthropic","docs\u002F4.providers\u002F3.anthropic",{"title":213,"path":214,"stem":215},"Google Gemini and Vertex AI","\u002Fdocs\u002Fproviders\u002Fgoogle-gemini","docs\u002F4.providers\u002F4.google-gemini",{"title":217,"path":218,"stem":219},"OpenAI-compatible providers","\u002Fdocs\u002Fproviders\u002Fopenai-compatible","docs\u002F4.providers\u002F5.openai-compatible",{"title":221,"path":222,"stem":223},"Groq","\u002Fdocs\u002Fproviders\u002Fgroq","docs\u002F4.providers\u002F6.groq",{"title":225,"path":226,"stem":227},"Cohere","\u002Fdocs\u002Fproviders\u002Fcohere","docs\u002F4.providers\u002F7.cohere",{"title":229,"path":230,"stem":231},"Amazon Bedrock","\u002Fdocs\u002Fproviders\u002Famazon-bedrock","docs\u002F4.providers\u002F8.amazon-bedrock",{"title":233,"path":234,"stem":235,"children":236},"CHANGELOG","\u002Fdocs\u002Fchangelog","docs\u002F5.changelog\u002F1.index",[237,239,243,247],{"title":238,"path":234,"stem":235},"Changelog",{"title":240,"path":241,"stem":242},"Roadmap","\u002Fdocs\u002Fchangelog\u002Froadmap","docs\u002F5.changelog\u002F2.roadmap",{"title":244,"path":245,"stem":246},"Release notes","\u002Fdocs\u002Fchangelog\u002Frelease-runbook","docs\u002F5.changelog\u002F3.release-runbook",{"title":248,"path":249,"stem":250},"Testing","\u002Fdocs\u002Fchangelog\u002Ftesting","docs\u002F5.changelog\u002F4.testing",false,{"id":253,"title":94,"body":254,"description":1731,"extension":1732,"meta":1733,"navigation":320,"path":180,"seo":1734,"stem":181,"__hash__":1735},"docs\u002Fdocs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F5.go.md",{"type":255,"value":256,"toc":1725},"minimark",[257,262,266,292,299,304,744,747,751,1053,1060,1064,1449,1452,1456,1706,1713,1721],[258,259,261],"h1",{"id":260},"go-memory-consequence","Go Memory + Consequence",[263,264,265],"p",{},"Install the Go 1.25+ SDK:",[267,268,273],"pre",{"className":269,"code":270,"language":271,"meta":272,"style":272},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","go get github.com\u002Fneutron-ai\u002Fneutron\u002Fpackages\u002Fsdk-go\n","bash","",[274,275,276],"code",{"__ignoreMap":272},[277,278,281,285,289],"span",{"class":279,"line":280},"line",1,[277,282,284],{"class":283},"sBMFI","go",[277,286,288],{"class":287},"sfazB"," get",[277,290,291],{"class":287}," github.com\u002Fneutron-ai\u002Fneutron\u002Fpackages\u002Fsdk-go\n",[263,293,294,295,298],{},"The module handles memory and agent context. A small ",[274,296,297],{},"net\u002Fhttp"," helper calls industry-library and Consequence endpoints that are not yet exposed as typed Go methods.",[300,301,303],"h2",{"id":302},"client-and-authenticated-rest-helper","Client and authenticated REST helper",[267,305,308],{"className":306,"code":307,"language":284,"meta":272,"style":272},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","package main\n\nimport (\n    \"bytes\"\n    \"context\"\n    \"encoding\u002Fjson\"\n    \"fmt\"\n    \"io\"\n    \"net\u002Fhttp\"\n    \"os\"\n    \"strings\"\n    \"time\"\n\n    neutron \"github.com\u002Fneutron-ai\u002Fneutron\u002Fpackages\u002Fsdk-go\"\n)\n\nconst nucleusID = \"checkout-platform\"\n\nfunc requiredEnv(name string) (string, error) {\n    value := os.Getenv(name)\n    if strings.TrimSpace(value) == \"\" {\n        return \"\", fmt.Errorf(\"%s is required\", name)\n    }\n    return value, nil\n}\n\nfunc scoped(body map[string]any) map[string]any {\n    output := map[string]any{\"nucleusId\": nucleusID}\n    for key, value := range body {\n        output[key] = value\n    }\n    return output\n}\n\nfunc postJSON(\n    ctx context.Context,\n    httpClient *http.Client,\n    baseURL string,\n    token string,\n    path string,\n    body map[string]any,\n) (map[string]any, error) {\n    payload, err := json.Marshal(body)\n    if err != nil {\n        return nil, err\n    }\n    request, err := http.NewRequestWithContext(\n        ctx,\n        http.MethodPost,\n        strings.TrimRight(baseURL, \"\u002F\")+path,\n        bytes.NewReader(payload),\n    )\n    if err != nil {\n        return nil, err\n    }\n    request.Header.Set(\"authorization\", \"Bearer \"+token)\n    request.Header.Set(\"content-type\", \"application\u002Fjson\")\n\n    response, err := httpClient.Do(request)\n    if err != nil {\n        return nil, err\n    }\n    defer response.Body.Close()\n    rawBody, err := io.ReadAll(response.Body)\n    if err != nil {\n        return nil, err\n    }\n    if response.StatusCode >= 400 {\n        return nil, fmt.Errorf(\"Neutron request failed: %s\", response.Status)\n    }\n    output := map[string]any{}\n    if err := json.Unmarshal(rawBody, &output); err != nil {\n        return nil, err\n    }\n    return output, nil\n}\n",[274,309,310,315,322,328,334,340,346,352,358,364,370,376,382,387,393,399,404,410,415,421,427,433,439,445,451,457,462,468,474,480,486,491,497,502,507,513,519,525,531,537,543,549,555,561,567,573,578,584,590,596,602,608,614,619,624,629,635,641,646,652,657,662,667,673,679,684,689,694,700,706,711,717,723,728,733,739],{"__ignoreMap":272},[277,311,312],{"class":279,"line":280},[277,313,314],{},"package main\n",[277,316,318],{"class":279,"line":317},2,[277,319,321],{"emptyLinePlaceholder":320},true,"\n",[277,323,325],{"class":279,"line":324},3,[277,326,327],{},"import (\n",[277,329,331],{"class":279,"line":330},4,[277,332,333],{},"    \"bytes\"\n",[277,335,337],{"class":279,"line":336},5,[277,338,339],{},"    \"context\"\n",[277,341,343],{"class":279,"line":342},6,[277,344,345],{},"    \"encoding\u002Fjson\"\n",[277,347,349],{"class":279,"line":348},7,[277,350,351],{},"    \"fmt\"\n",[277,353,355],{"class":279,"line":354},8,[277,356,357],{},"    \"io\"\n",[277,359,361],{"class":279,"line":360},9,[277,362,363],{},"    \"net\u002Fhttp\"\n",[277,365,367],{"class":279,"line":366},10,[277,368,369],{},"    \"os\"\n",[277,371,373],{"class":279,"line":372},11,[277,374,375],{},"    \"strings\"\n",[277,377,379],{"class":279,"line":378},12,[277,380,381],{},"    \"time\"\n",[277,383,385],{"class":279,"line":384},13,[277,386,321],{"emptyLinePlaceholder":320},[277,388,390],{"class":279,"line":389},14,[277,391,392],{},"    neutron \"github.com\u002Fneutron-ai\u002Fneutron\u002Fpackages\u002Fsdk-go\"\n",[277,394,396],{"class":279,"line":395},15,[277,397,398],{},")\n",[277,400,402],{"class":279,"line":401},16,[277,403,321],{"emptyLinePlaceholder":320},[277,405,407],{"class":279,"line":406},17,[277,408,409],{},"const nucleusID = \"checkout-platform\"\n",[277,411,413],{"class":279,"line":412},18,[277,414,321],{"emptyLinePlaceholder":320},[277,416,418],{"class":279,"line":417},19,[277,419,420],{},"func requiredEnv(name string) (string, error) {\n",[277,422,424],{"class":279,"line":423},20,[277,425,426],{},"    value := os.Getenv(name)\n",[277,428,430],{"class":279,"line":429},21,[277,431,432],{},"    if strings.TrimSpace(value) == \"\" {\n",[277,434,436],{"class":279,"line":435},22,[277,437,438],{},"        return \"\", fmt.Errorf(\"%s is required\", name)\n",[277,440,442],{"class":279,"line":441},23,[277,443,444],{},"    }\n",[277,446,448],{"class":279,"line":447},24,[277,449,450],{},"    return value, nil\n",[277,452,454],{"class":279,"line":453},25,[277,455,456],{},"}\n",[277,458,460],{"class":279,"line":459},26,[277,461,321],{"emptyLinePlaceholder":320},[277,463,465],{"class":279,"line":464},27,[277,466,467],{},"func scoped(body map[string]any) map[string]any {\n",[277,469,471],{"class":279,"line":470},28,[277,472,473],{},"    output := map[string]any{\"nucleusId\": nucleusID}\n",[277,475,477],{"class":279,"line":476},29,[277,478,479],{},"    for key, value := range body {\n",[277,481,483],{"class":279,"line":482},30,[277,484,485],{},"        output[key] = value\n",[277,487,489],{"class":279,"line":488},31,[277,490,444],{},[277,492,494],{"class":279,"line":493},32,[277,495,496],{},"    return output\n",[277,498,500],{"class":279,"line":499},33,[277,501,456],{},[277,503,505],{"class":279,"line":504},34,[277,506,321],{"emptyLinePlaceholder":320},[277,508,510],{"class":279,"line":509},35,[277,511,512],{},"func postJSON(\n",[277,514,516],{"class":279,"line":515},36,[277,517,518],{},"    ctx context.Context,\n",[277,520,522],{"class":279,"line":521},37,[277,523,524],{},"    httpClient *http.Client,\n",[277,526,528],{"class":279,"line":527},38,[277,529,530],{},"    baseURL string,\n",[277,532,534],{"class":279,"line":533},39,[277,535,536],{},"    token string,\n",[277,538,540],{"class":279,"line":539},40,[277,541,542],{},"    path string,\n",[277,544,546],{"class":279,"line":545},41,[277,547,548],{},"    body map[string]any,\n",[277,550,552],{"class":279,"line":551},42,[277,553,554],{},") (map[string]any, error) {\n",[277,556,558],{"class":279,"line":557},43,[277,559,560],{},"    payload, err := json.Marshal(body)\n",[277,562,564],{"class":279,"line":563},44,[277,565,566],{},"    if err != nil {\n",[277,568,570],{"class":279,"line":569},45,[277,571,572],{},"        return nil, err\n",[277,574,576],{"class":279,"line":575},46,[277,577,444],{},[277,579,581],{"class":279,"line":580},47,[277,582,583],{},"    request, err := http.NewRequestWithContext(\n",[277,585,587],{"class":279,"line":586},48,[277,588,589],{},"        ctx,\n",[277,591,593],{"class":279,"line":592},49,[277,594,595],{},"        http.MethodPost,\n",[277,597,599],{"class":279,"line":598},50,[277,600,601],{},"        strings.TrimRight(baseURL, \"\u002F\")+path,\n",[277,603,605],{"class":279,"line":604},51,[277,606,607],{},"        bytes.NewReader(payload),\n",[277,609,611],{"class":279,"line":610},52,[277,612,613],{},"    )\n",[277,615,617],{"class":279,"line":616},53,[277,618,566],{},[277,620,622],{"class":279,"line":621},54,[277,623,572],{},[277,625,627],{"class":279,"line":626},55,[277,628,444],{},[277,630,632],{"class":279,"line":631},56,[277,633,634],{},"    request.Header.Set(\"authorization\", \"Bearer \"+token)\n",[277,636,638],{"class":279,"line":637},57,[277,639,640],{},"    request.Header.Set(\"content-type\", \"application\u002Fjson\")\n",[277,642,644],{"class":279,"line":643},58,[277,645,321],{"emptyLinePlaceholder":320},[277,647,649],{"class":279,"line":648},59,[277,650,651],{},"    response, err := httpClient.Do(request)\n",[277,653,655],{"class":279,"line":654},60,[277,656,566],{},[277,658,660],{"class":279,"line":659},61,[277,661,572],{},[277,663,665],{"class":279,"line":664},62,[277,666,444],{},[277,668,670],{"class":279,"line":669},63,[277,671,672],{},"    defer response.Body.Close()\n",[277,674,676],{"class":279,"line":675},64,[277,677,678],{},"    rawBody, err := io.ReadAll(response.Body)\n",[277,680,682],{"class":279,"line":681},65,[277,683,566],{},[277,685,687],{"class":279,"line":686},66,[277,688,572],{},[277,690,692],{"class":279,"line":691},67,[277,693,444],{},[277,695,697],{"class":279,"line":696},68,[277,698,699],{},"    if response.StatusCode >= 400 {\n",[277,701,703],{"class":279,"line":702},69,[277,704,705],{},"        return nil, fmt.Errorf(\"Neutron request failed: %s\", response.Status)\n",[277,707,709],{"class":279,"line":708},70,[277,710,444],{},[277,712,714],{"class":279,"line":713},71,[277,715,716],{},"    output := map[string]any{}\n",[277,718,720],{"class":279,"line":719},72,[277,721,722],{},"    if err := json.Unmarshal(rawBody, &output); err != nil {\n",[277,724,726],{"class":279,"line":725},73,[277,727,572],{},[277,729,731],{"class":279,"line":730},74,[277,732,444],{},[277,734,736],{"class":279,"line":735},75,[277,737,738],{},"    return output, nil\n",[277,740,742],{"class":279,"line":741},76,[277,743,456],{},[263,745,746],{},"Keep workspace, approver, and internal credentials outside the agent runtime.",[300,748,750],{"id":749},"install-knowledge-and-build-context","Install knowledge and build context",[267,752,754],{"className":306,"code":753,"language":284,"meta":272,"style":272},"func prepareContext(\n    ctx context.Context,\n    httpClient *http.Client,\n    baseURL string,\n) (*neutron.Client, error) {\n    workspaceKey, err := requiredEnv(\"NEUTRON_WORKSPACE_API_KEY\")\n    if err != nil {\n        return nil, err\n    }\n    if _, err := postJSON(\n        ctx,\n        httpClient,\n        baseURL,\n        workspaceKey,\n        \"\u002Fv1\u002Fplatform\u002Findustry-library\u002Fplugins\u002Fai-engineering-delivery\u002Finstall\",\n        map[string]any{\"nucleusId\": nucleusID},\n    ); err != nil {\n        return nil, err\n    }\n\n    agentToken, err := requiredEnv(\"NEUTRON_API_TOKEN\")\n    if err != nil {\n        return nil, err\n    }\n    memory, err := neutron.NewClient(neutron.Options{\n        BaseURL: baseURL, Token: agentToken, NucleusID: nucleusID,\n    })\n    if err != nil {\n        return nil, err\n    }\n    if _, err := memory.Remember(ctx, map[string]any{\n        \"scopeId\": \"history:checkout-releases\",\n        \"agentId\": \"agent:release-manager\",\n        \"type\": \"experience\",\n        \"privacyClass\": \"tenant\",\n        \"text\": strings.Join([]string{\n            \"Release 3.7 used a 5% cohort for 20 minutes before expansion.\",\n            \"The rollout paused when database lock time exceeded 250 ms.\",\n            \"Rollback succeeded. Verify lock duration before expanding similar changes.\",\n        }, \" \"),\n        \"metadata\": map[string]any{\n            \"source\": \"approved-release-review\", \"release\": \"3.7\", \"outcome\": \"rolled-back\",\n        },\n    }); err != nil {\n        return nil, err\n    }\n    _, err = memory.AgentContext(ctx, map[string]any{\n        \"scopeIds\": []string{\n            \"industry:ai-engineering-delivery\",\n            \"service:checkout-api\",\n            \"history:checkout-releases\",\n            \"policy:production-change\",\n        },\n        \"agentId\": \"agent:release-manager\",\n        \"task\": \"Prepare a safe release recommendation for checkout API version 3.8.\",\n        \"privacyClasses\": []string{\"tenant\"},\n        \"tokenBudget\": 1600,\n        \"cachePolicy\": map[string]any{\n            \"mode\": \"prefer_cache\", \"keyMode\": \"intent_profile\",\n            \"ttlSeconds\": 300, \"includeDynamicRag\": true,\n        },\n    })\n    return memory, err\n}\n",[274,755,756,761,765,769,773,778,783,787,791,795,800,804,809,814,819,824,829,834,838,842,846,851,855,859,863,868,873,878,882,886,890,895,900,905,910,915,920,925,930,935,940,945,950,955,960,964,968,973,978,983,988,993,998,1002,1006,1011,1016,1021,1026,1031,1036,1040,1044,1049],{"__ignoreMap":272},[277,757,758],{"class":279,"line":280},[277,759,760],{},"func prepareContext(\n",[277,762,763],{"class":279,"line":317},[277,764,518],{},[277,766,767],{"class":279,"line":324},[277,768,524],{},[277,770,771],{"class":279,"line":330},[277,772,530],{},[277,774,775],{"class":279,"line":336},[277,776,777],{},") (*neutron.Client, error) {\n",[277,779,780],{"class":279,"line":342},[277,781,782],{},"    workspaceKey, err := requiredEnv(\"NEUTRON_WORKSPACE_API_KEY\")\n",[277,784,785],{"class":279,"line":348},[277,786,566],{},[277,788,789],{"class":279,"line":354},[277,790,572],{},[277,792,793],{"class":279,"line":360},[277,794,444],{},[277,796,797],{"class":279,"line":366},[277,798,799],{},"    if _, err := postJSON(\n",[277,801,802],{"class":279,"line":372},[277,803,589],{},[277,805,806],{"class":279,"line":378},[277,807,808],{},"        httpClient,\n",[277,810,811],{"class":279,"line":384},[277,812,813],{},"        baseURL,\n",[277,815,816],{"class":279,"line":389},[277,817,818],{},"        workspaceKey,\n",[277,820,821],{"class":279,"line":395},[277,822,823],{},"        \"\u002Fv1\u002Fplatform\u002Findustry-library\u002Fplugins\u002Fai-engineering-delivery\u002Finstall\",\n",[277,825,826],{"class":279,"line":401},[277,827,828],{},"        map[string]any{\"nucleusId\": nucleusID},\n",[277,830,831],{"class":279,"line":406},[277,832,833],{},"    ); err != nil {\n",[277,835,836],{"class":279,"line":412},[277,837,572],{},[277,839,840],{"class":279,"line":417},[277,841,444],{},[277,843,844],{"class":279,"line":423},[277,845,321],{"emptyLinePlaceholder":320},[277,847,848],{"class":279,"line":429},[277,849,850],{},"    agentToken, err := requiredEnv(\"NEUTRON_API_TOKEN\")\n",[277,852,853],{"class":279,"line":435},[277,854,566],{},[277,856,857],{"class":279,"line":441},[277,858,572],{},[277,860,861],{"class":279,"line":447},[277,862,444],{},[277,864,865],{"class":279,"line":453},[277,866,867],{},"    memory, err := neutron.NewClient(neutron.Options{\n",[277,869,870],{"class":279,"line":459},[277,871,872],{},"        BaseURL: baseURL, Token: agentToken, NucleusID: nucleusID,\n",[277,874,875],{"class":279,"line":464},[277,876,877],{},"    })\n",[277,879,880],{"class":279,"line":470},[277,881,566],{},[277,883,884],{"class":279,"line":476},[277,885,572],{},[277,887,888],{"class":279,"line":482},[277,889,444],{},[277,891,892],{"class":279,"line":488},[277,893,894],{},"    if _, err := memory.Remember(ctx, map[string]any{\n",[277,896,897],{"class":279,"line":493},[277,898,899],{},"        \"scopeId\": \"history:checkout-releases\",\n",[277,901,902],{"class":279,"line":499},[277,903,904],{},"        \"agentId\": \"agent:release-manager\",\n",[277,906,907],{"class":279,"line":504},[277,908,909],{},"        \"type\": \"experience\",\n",[277,911,912],{"class":279,"line":509},[277,913,914],{},"        \"privacyClass\": \"tenant\",\n",[277,916,917],{"class":279,"line":515},[277,918,919],{},"        \"text\": strings.Join([]string{\n",[277,921,922],{"class":279,"line":521},[277,923,924],{},"            \"Release 3.7 used a 5% cohort for 20 minutes before expansion.\",\n",[277,926,927],{"class":279,"line":527},[277,928,929],{},"            \"The rollout paused when database lock time exceeded 250 ms.\",\n",[277,931,932],{"class":279,"line":533},[277,933,934],{},"            \"Rollback succeeded. Verify lock duration before expanding similar changes.\",\n",[277,936,937],{"class":279,"line":539},[277,938,939],{},"        }, \" \"),\n",[277,941,942],{"class":279,"line":545},[277,943,944],{},"        \"metadata\": map[string]any{\n",[277,946,947],{"class":279,"line":551},[277,948,949],{},"            \"source\": \"approved-release-review\", \"release\": \"3.7\", \"outcome\": \"rolled-back\",\n",[277,951,952],{"class":279,"line":557},[277,953,954],{},"        },\n",[277,956,957],{"class":279,"line":563},[277,958,959],{},"    }); err != nil {\n",[277,961,962],{"class":279,"line":569},[277,963,572],{},[277,965,966],{"class":279,"line":575},[277,967,444],{},[277,969,970],{"class":279,"line":580},[277,971,972],{},"    _, err = memory.AgentContext(ctx, map[string]any{\n",[277,974,975],{"class":279,"line":586},[277,976,977],{},"        \"scopeIds\": []string{\n",[277,979,980],{"class":279,"line":592},[277,981,982],{},"            \"industry:ai-engineering-delivery\",\n",[277,984,985],{"class":279,"line":598},[277,986,987],{},"            \"service:checkout-api\",\n",[277,989,990],{"class":279,"line":604},[277,991,992],{},"            \"history:checkout-releases\",\n",[277,994,995],{"class":279,"line":610},[277,996,997],{},"            \"policy:production-change\",\n",[277,999,1000],{"class":279,"line":616},[277,1001,954],{},[277,1003,1004],{"class":279,"line":621},[277,1005,904],{},[277,1007,1008],{"class":279,"line":626},[277,1009,1010],{},"        \"task\": \"Prepare a safe release recommendation for checkout API version 3.8.\",\n",[277,1012,1013],{"class":279,"line":631},[277,1014,1015],{},"        \"privacyClasses\": []string{\"tenant\"},\n",[277,1017,1018],{"class":279,"line":637},[277,1019,1020],{},"        \"tokenBudget\": 1600,\n",[277,1022,1023],{"class":279,"line":643},[277,1024,1025],{},"        \"cachePolicy\": map[string]any{\n",[277,1027,1028],{"class":279,"line":648},[277,1029,1030],{},"            \"mode\": \"prefer_cache\", \"keyMode\": \"intent_profile\",\n",[277,1032,1033],{"class":279,"line":654},[277,1034,1035],{},"            \"ttlSeconds\": 300, \"includeDynamicRag\": true,\n",[277,1037,1038],{"class":279,"line":659},[277,1039,954],{},[277,1041,1042],{"class":279,"line":664},[277,1043,877],{},[277,1045,1046],{"class":279,"line":669},[277,1047,1048],{},"    return memory, err\n",[277,1050,1051],{"class":279,"line":675},[277,1052,456],{},[263,1054,1055,1056,1059],{},"Pass the returned ",[274,1057,1058],{},"promptContext"," to the chosen model only as supporting context.",[300,1061,1063],{"id":1062},"plan-decide-and-approve","Plan, decide, and approve",[267,1065,1067],{"className":306,"code":1066,"language":284,"meta":272,"style":272},"func planAndDecide(\n    ctx context.Context,\n    httpClient *http.Client,\n    baseURL string,\n) (map[string]any, error) {\n    agentToken, err := requiredEnv(\"NEUTRON_API_TOKEN\")\n    if err != nil {\n        return nil, err\n    }\n    decisionScopes := []string{\n        \"industry:ai-engineering-delivery\",\n        \"service:checkout-api\",\n        \"history:checkout-releases\",\n        \"policy:production-change\",\n    }\n    run, err := postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fplan\", scoped(map[string]any{\n        \"scopeIds\": decisionScopes,\n        \"agentId\": \"agent:release-manager\",\n        \"task\": \"Compare delaying release 3.8, a 1% pilot, a 5% staged rollout, and immediate release while preserving compatibility and the lock budget.\",\n        \"domain\": \"engineering_ops\",\n        \"objectiveHints\": []string{\n            \"Reduce customer impact\", \"Preserve rollback capability\", \"Collect evidence before expansion\",\n        },\n        \"constraintHints\": []string{\n            \"Database lock time must remain below the approved threshold\",\n            \"Expansion requires the accountable release owner\",\n            \"Rollback must remain available\",\n        },\n        \"idempotencyKey\": \"checkout-3.8-release-review-v1\",\n        \"retentionDays\": 90,\n        \"contextPolicy\": map[string]any{\n            \"includeMemory\": true, \"includeKnowledge\": true,\n            \"includeContextCapsules\": true, \"includePastDecisions\": true,\n            \"includeReflections\": true,\n        },\n        \"policy\": map[string]any{\n            \"mode\": \"deep\", \"depth\": 10, \"maxScenarios\": 8, \"maxRuntimeMs\": 8000,\n            \"requireApprovalAboveRisk\": \"medium\", \"allowExecution\": false,\n            \"storeSafeArtifactsOnly\": true, \"includeCounterfactuals\": true,\n            \"includeReflections\": true,\n        },\n    }))\n    if err != nil {\n        return nil, err\n    }\n    scenarioID, _ := run[\"recommendedScenarioId\"].(string)\n    runID, _ := run[\"runId\"].(string)\n    if scenarioID == \"\" || runID == \"\" {\n        return nil, fmt.Errorf(\"no scenario satisfied the current decision boundary\")\n    }\n\n    decided, err := postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fdecide\", scoped(map[string]any{\n        \"runId\": runID,\n        \"scopeIds\": []string{\"service:checkout-api\", \"policy:production-change\"},\n        \"selectedScenarioId\": scenarioID,\n        \"decisionSummary\": \"Selected the bounded pilot scenario for owner review.\",\n        \"rationaleSummary\": \"The pilot preserves rollback and gathers current lock evidence; expansion requires threshold compliance and owner review.\",\n    }))\n    if err != nil {\n        return nil, err\n    }\n    decision, ok := decided[\"decisionRecord\"].(map[string]any)\n    if !ok {\n        return nil, fmt.Errorf(\"the decision record was not created\")\n    }\n    if decision[\"status\"] == \"draft\" {\n        approverToken, err := requiredEnv(\"NEUTRON_APPROVER_TOKEN\")\n        if err != nil {\n            return nil, err\n        }\n        _, err = postJSON(ctx, httpClient, baseURL, approverToken, \"\u002Fv1\u002Fconsequence\u002Fapprove\", scoped(map[string]any{\n            \"decisionId\": decision[\"decisionId\"],\n            \"scopeIds\": []string{\"service:checkout-api\", \"policy:production-change\"},\n            \"note\": \"Release owner approved the pilot only; expansion needs another review.\",\n        }))\n        if err != nil {\n            return nil, err\n        }\n    }\n    return decision, nil\n}\n",[274,1068,1069,1074,1078,1082,1086,1090,1094,1098,1102,1106,1111,1116,1121,1126,1131,1135,1140,1145,1149,1154,1159,1164,1169,1173,1178,1183,1188,1193,1197,1202,1207,1212,1217,1222,1227,1231,1236,1241,1246,1251,1255,1259,1264,1268,1272,1276,1281,1286,1291,1296,1300,1304,1309,1314,1319,1324,1329,1334,1338,1342,1346,1350,1355,1360,1365,1369,1374,1379,1384,1389,1394,1399,1404,1409,1414,1419,1423,1428,1433,1438,1444],{"__ignoreMap":272},[277,1070,1071],{"class":279,"line":280},[277,1072,1073],{},"func planAndDecide(\n",[277,1075,1076],{"class":279,"line":317},[277,1077,518],{},[277,1079,1080],{"class":279,"line":324},[277,1081,524],{},[277,1083,1084],{"class":279,"line":330},[277,1085,530],{},[277,1087,1088],{"class":279,"line":336},[277,1089,554],{},[277,1091,1092],{"class":279,"line":342},[277,1093,850],{},[277,1095,1096],{"class":279,"line":348},[277,1097,566],{},[277,1099,1100],{"class":279,"line":354},[277,1101,572],{},[277,1103,1104],{"class":279,"line":360},[277,1105,444],{},[277,1107,1108],{"class":279,"line":366},[277,1109,1110],{},"    decisionScopes := []string{\n",[277,1112,1113],{"class":279,"line":372},[277,1114,1115],{},"        \"industry:ai-engineering-delivery\",\n",[277,1117,1118],{"class":279,"line":378},[277,1119,1120],{},"        \"service:checkout-api\",\n",[277,1122,1123],{"class":279,"line":384},[277,1124,1125],{},"        \"history:checkout-releases\",\n",[277,1127,1128],{"class":279,"line":389},[277,1129,1130],{},"        \"policy:production-change\",\n",[277,1132,1133],{"class":279,"line":395},[277,1134,444],{},[277,1136,1137],{"class":279,"line":401},[277,1138,1139],{},"    run, err := postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fplan\", scoped(map[string]any{\n",[277,1141,1142],{"class":279,"line":406},[277,1143,1144],{},"        \"scopeIds\": decisionScopes,\n",[277,1146,1147],{"class":279,"line":412},[277,1148,904],{},[277,1150,1151],{"class":279,"line":417},[277,1152,1153],{},"        \"task\": \"Compare delaying release 3.8, a 1% pilot, a 5% staged rollout, and immediate release while preserving compatibility and the lock budget.\",\n",[277,1155,1156],{"class":279,"line":423},[277,1157,1158],{},"        \"domain\": \"engineering_ops\",\n",[277,1160,1161],{"class":279,"line":429},[277,1162,1163],{},"        \"objectiveHints\": []string{\n",[277,1165,1166],{"class":279,"line":435},[277,1167,1168],{},"            \"Reduce customer impact\", \"Preserve rollback capability\", \"Collect evidence before expansion\",\n",[277,1170,1171],{"class":279,"line":441},[277,1172,954],{},[277,1174,1175],{"class":279,"line":447},[277,1176,1177],{},"        \"constraintHints\": []string{\n",[277,1179,1180],{"class":279,"line":453},[277,1181,1182],{},"            \"Database lock time must remain below the approved threshold\",\n",[277,1184,1185],{"class":279,"line":459},[277,1186,1187],{},"            \"Expansion requires the accountable release owner\",\n",[277,1189,1190],{"class":279,"line":464},[277,1191,1192],{},"            \"Rollback must remain available\",\n",[277,1194,1195],{"class":279,"line":470},[277,1196,954],{},[277,1198,1199],{"class":279,"line":476},[277,1200,1201],{},"        \"idempotencyKey\": \"checkout-3.8-release-review-v1\",\n",[277,1203,1204],{"class":279,"line":482},[277,1205,1206],{},"        \"retentionDays\": 90,\n",[277,1208,1209],{"class":279,"line":488},[277,1210,1211],{},"        \"contextPolicy\": map[string]any{\n",[277,1213,1214],{"class":279,"line":493},[277,1215,1216],{},"            \"includeMemory\": true, \"includeKnowledge\": true,\n",[277,1218,1219],{"class":279,"line":499},[277,1220,1221],{},"            \"includeContextCapsules\": true, \"includePastDecisions\": true,\n",[277,1223,1224],{"class":279,"line":504},[277,1225,1226],{},"            \"includeReflections\": true,\n",[277,1228,1229],{"class":279,"line":509},[277,1230,954],{},[277,1232,1233],{"class":279,"line":515},[277,1234,1235],{},"        \"policy\": map[string]any{\n",[277,1237,1238],{"class":279,"line":521},[277,1239,1240],{},"            \"mode\": \"deep\", \"depth\": 10, \"maxScenarios\": 8, \"maxRuntimeMs\": 8000,\n",[277,1242,1243],{"class":279,"line":527},[277,1244,1245],{},"            \"requireApprovalAboveRisk\": \"medium\", \"allowExecution\": false,\n",[277,1247,1248],{"class":279,"line":533},[277,1249,1250],{},"            \"storeSafeArtifactsOnly\": true, \"includeCounterfactuals\": true,\n",[277,1252,1253],{"class":279,"line":539},[277,1254,1226],{},[277,1256,1257],{"class":279,"line":545},[277,1258,954],{},[277,1260,1261],{"class":279,"line":551},[277,1262,1263],{},"    }))\n",[277,1265,1266],{"class":279,"line":557},[277,1267,566],{},[277,1269,1270],{"class":279,"line":563},[277,1271,572],{},[277,1273,1274],{"class":279,"line":569},[277,1275,444],{},[277,1277,1278],{"class":279,"line":575},[277,1279,1280],{},"    scenarioID, _ := run[\"recommendedScenarioId\"].(string)\n",[277,1282,1283],{"class":279,"line":580},[277,1284,1285],{},"    runID, _ := run[\"runId\"].(string)\n",[277,1287,1288],{"class":279,"line":586},[277,1289,1290],{},"    if scenarioID == \"\" || runID == \"\" {\n",[277,1292,1293],{"class":279,"line":592},[277,1294,1295],{},"        return nil, fmt.Errorf(\"no scenario satisfied the current decision boundary\")\n",[277,1297,1298],{"class":279,"line":598},[277,1299,444],{},[277,1301,1302],{"class":279,"line":604},[277,1303,321],{"emptyLinePlaceholder":320},[277,1305,1306],{"class":279,"line":610},[277,1307,1308],{},"    decided, err := postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fdecide\", scoped(map[string]any{\n",[277,1310,1311],{"class":279,"line":616},[277,1312,1313],{},"        \"runId\": runID,\n",[277,1315,1316],{"class":279,"line":621},[277,1317,1318],{},"        \"scopeIds\": []string{\"service:checkout-api\", \"policy:production-change\"},\n",[277,1320,1321],{"class":279,"line":626},[277,1322,1323],{},"        \"selectedScenarioId\": scenarioID,\n",[277,1325,1326],{"class":279,"line":631},[277,1327,1328],{},"        \"decisionSummary\": \"Selected the bounded pilot scenario for owner review.\",\n",[277,1330,1331],{"class":279,"line":637},[277,1332,1333],{},"        \"rationaleSummary\": \"The pilot preserves rollback and gathers current lock evidence; expansion requires threshold compliance and owner review.\",\n",[277,1335,1336],{"class":279,"line":643},[277,1337,1263],{},[277,1339,1340],{"class":279,"line":648},[277,1341,566],{},[277,1343,1344],{"class":279,"line":654},[277,1345,572],{},[277,1347,1348],{"class":279,"line":659},[277,1349,444],{},[277,1351,1352],{"class":279,"line":664},[277,1353,1354],{},"    decision, ok := decided[\"decisionRecord\"].(map[string]any)\n",[277,1356,1357],{"class":279,"line":669},[277,1358,1359],{},"    if !ok {\n",[277,1361,1362],{"class":279,"line":675},[277,1363,1364],{},"        return nil, fmt.Errorf(\"the decision record was not created\")\n",[277,1366,1367],{"class":279,"line":681},[277,1368,444],{},[277,1370,1371],{"class":279,"line":686},[277,1372,1373],{},"    if decision[\"status\"] == \"draft\" {\n",[277,1375,1376],{"class":279,"line":691},[277,1377,1378],{},"        approverToken, err := requiredEnv(\"NEUTRON_APPROVER_TOKEN\")\n",[277,1380,1381],{"class":279,"line":696},[277,1382,1383],{},"        if err != nil {\n",[277,1385,1386],{"class":279,"line":702},[277,1387,1388],{},"            return nil, err\n",[277,1390,1391],{"class":279,"line":708},[277,1392,1393],{},"        }\n",[277,1395,1396],{"class":279,"line":713},[277,1397,1398],{},"        _, err = postJSON(ctx, httpClient, baseURL, approverToken, \"\u002Fv1\u002Fconsequence\u002Fapprove\", scoped(map[string]any{\n",[277,1400,1401],{"class":279,"line":719},[277,1402,1403],{},"            \"decisionId\": decision[\"decisionId\"],\n",[277,1405,1406],{"class":279,"line":725},[277,1407,1408],{},"            \"scopeIds\": []string{\"service:checkout-api\", \"policy:production-change\"},\n",[277,1410,1411],{"class":279,"line":730},[277,1412,1413],{},"            \"note\": \"Release owner approved the pilot only; expansion needs another review.\",\n",[277,1415,1416],{"class":279,"line":735},[277,1417,1418],{},"        }))\n",[277,1420,1421],{"class":279,"line":741},[277,1422,1383],{},[277,1424,1426],{"class":279,"line":1425},77,[277,1427,1388],{},[277,1429,1431],{"class":279,"line":1430},78,[277,1432,1393],{},[277,1434,1436],{"class":279,"line":1435},79,[277,1437,444],{},[277,1439,1441],{"class":279,"line":1440},80,[277,1442,1443],{},"    return decision, nil\n",[277,1445,1447],{"class":279,"line":1446},81,[277,1448,456],{},[263,1450,1451],{},"Use the approver token only after verifying the authenticated human. Approval records authorization; it does not execute the release.",[300,1453,1455],{"id":1454},"observe-and-reflect","Observe and reflect",[267,1457,1459],{"className":306,"code":1458,"language":284,"meta":272,"style":272},"func observeAndReflect(\n    ctx context.Context,\n    httpClient *http.Client,\n    baseURL string,\n    decision map[string]any,\n) error {\n    agentToken, err := requiredEnv(\"NEUTRON_API_TOKEN\")\n    if err != nil {\n        return err\n    }\n    _, err = postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fobserve\", scoped(map[string]any{\n        \"decisionId\": decision[\"decisionId\"],\n        \"scopeIds\": []string{\"service:checkout-api\", \"history:checkout-releases\"},\n        \"summary\": \"The 1% pilot completed without customer errors and was held for review.\",\n        \"observedMetrics\": map[string]any{\n            \"pilot_percent\": 1, \"pilot_minutes\": 30,\n            \"database_lock_p95_ms\": 180, \"customer_error_rate\": 0,\n        },\n        \"unexpectedConsequences\": []string{\"Cache warm-up took ten minutes longer than estimated.\"},\n        \"sourceRefs\": []string{\n            \"release-run:checkout-3.8-pilot\", \"dashboard:database-locks-2026-08-15\",\n        },\n    }))\n    if err != nil {\n        return err\n    }\n    internalToken, err := requiredEnv(\"NEUTRON_INTERNAL_TOKEN\")\n    if err != nil {\n        return err\n    }\n    _, err = postJSON(ctx, httpClient, baseURL, internalToken, \"\u002Fv1\u002Fconsequence\u002Freflect\", scoped(map[string]any{\n        \"decisionId\": decision[\"decisionId\"],\n        \"scopeIds\": []string{\"service:checkout-api\", \"history:checkout-releases\"},\n    }))\n    return err\n}\n\nfunc main() {\n    ctx := context.Background()\n    httpClient := &http.Client{Timeout: 30 * time.Second}\n    baseURL, err := requiredEnv(\"NEUTRON_API_URL\")\n    if err != nil {\n        panic(err)\n    }\n    if _, err := prepareContext(ctx, httpClient, baseURL); err != nil {\n        panic(err)\n    }\n    decision, err := planAndDecide(ctx, httpClient, baseURL)\n    if err != nil {\n        panic(err)\n    }\n    if err := observeAndReflect(ctx, httpClient, baseURL, decision); err != nil {\n        panic(err)\n    }\n}\n",[274,1460,1461,1466,1470,1474,1478,1483,1488,1492,1496,1501,1505,1510,1515,1520,1525,1530,1535,1540,1544,1549,1554,1559,1563,1567,1571,1575,1579,1584,1588,1592,1596,1601,1605,1609,1613,1618,1622,1626,1631,1636,1641,1646,1650,1655,1659,1664,1668,1672,1677,1681,1685,1689,1694,1698,1702],{"__ignoreMap":272},[277,1462,1463],{"class":279,"line":280},[277,1464,1465],{},"func observeAndReflect(\n",[277,1467,1468],{"class":279,"line":317},[277,1469,518],{},[277,1471,1472],{"class":279,"line":324},[277,1473,524],{},[277,1475,1476],{"class":279,"line":330},[277,1477,530],{},[277,1479,1480],{"class":279,"line":336},[277,1481,1482],{},"    decision map[string]any,\n",[277,1484,1485],{"class":279,"line":342},[277,1486,1487],{},") error {\n",[277,1489,1490],{"class":279,"line":348},[277,1491,850],{},[277,1493,1494],{"class":279,"line":354},[277,1495,566],{},[277,1497,1498],{"class":279,"line":360},[277,1499,1500],{},"        return err\n",[277,1502,1503],{"class":279,"line":366},[277,1504,444],{},[277,1506,1507],{"class":279,"line":372},[277,1508,1509],{},"    _, err = postJSON(ctx, httpClient, baseURL, agentToken, \"\u002Fv1\u002Fconsequence\u002Fobserve\", scoped(map[string]any{\n",[277,1511,1512],{"class":279,"line":378},[277,1513,1514],{},"        \"decisionId\": decision[\"decisionId\"],\n",[277,1516,1517],{"class":279,"line":384},[277,1518,1519],{},"        \"scopeIds\": []string{\"service:checkout-api\", \"history:checkout-releases\"},\n",[277,1521,1522],{"class":279,"line":389},[277,1523,1524],{},"        \"summary\": \"The 1% pilot completed without customer errors and was held for review.\",\n",[277,1526,1527],{"class":279,"line":395},[277,1528,1529],{},"        \"observedMetrics\": map[string]any{\n",[277,1531,1532],{"class":279,"line":401},[277,1533,1534],{},"            \"pilot_percent\": 1, \"pilot_minutes\": 30,\n",[277,1536,1537],{"class":279,"line":406},[277,1538,1539],{},"            \"database_lock_p95_ms\": 180, \"customer_error_rate\": 0,\n",[277,1541,1542],{"class":279,"line":412},[277,1543,954],{},[277,1545,1546],{"class":279,"line":417},[277,1547,1548],{},"        \"unexpectedConsequences\": []string{\"Cache warm-up took ten minutes longer than estimated.\"},\n",[277,1550,1551],{"class":279,"line":423},[277,1552,1553],{},"        \"sourceRefs\": []string{\n",[277,1555,1556],{"class":279,"line":429},[277,1557,1558],{},"            \"release-run:checkout-3.8-pilot\", \"dashboard:database-locks-2026-08-15\",\n",[277,1560,1561],{"class":279,"line":435},[277,1562,954],{},[277,1564,1565],{"class":279,"line":441},[277,1566,1263],{},[277,1568,1569],{"class":279,"line":447},[277,1570,566],{},[277,1572,1573],{"class":279,"line":453},[277,1574,1500],{},[277,1576,1577],{"class":279,"line":459},[277,1578,444],{},[277,1580,1581],{"class":279,"line":464},[277,1582,1583],{},"    internalToken, err := requiredEnv(\"NEUTRON_INTERNAL_TOKEN\")\n",[277,1585,1586],{"class":279,"line":470},[277,1587,566],{},[277,1589,1590],{"class":279,"line":476},[277,1591,1500],{},[277,1593,1594],{"class":279,"line":482},[277,1595,444],{},[277,1597,1598],{"class":279,"line":488},[277,1599,1600],{},"    _, err = postJSON(ctx, httpClient, baseURL, internalToken, \"\u002Fv1\u002Fconsequence\u002Freflect\", scoped(map[string]any{\n",[277,1602,1603],{"class":279,"line":493},[277,1604,1514],{},[277,1606,1607],{"class":279,"line":499},[277,1608,1519],{},[277,1610,1611],{"class":279,"line":504},[277,1612,1263],{},[277,1614,1615],{"class":279,"line":509},[277,1616,1617],{},"    return err\n",[277,1619,1620],{"class":279,"line":515},[277,1621,456],{},[277,1623,1624],{"class":279,"line":521},[277,1625,321],{"emptyLinePlaceholder":320},[277,1627,1628],{"class":279,"line":527},[277,1629,1630],{},"func main() {\n",[277,1632,1633],{"class":279,"line":533},[277,1634,1635],{},"    ctx := context.Background()\n",[277,1637,1638],{"class":279,"line":539},[277,1639,1640],{},"    httpClient := &http.Client{Timeout: 30 * time.Second}\n",[277,1642,1643],{"class":279,"line":545},[277,1644,1645],{},"    baseURL, err := requiredEnv(\"NEUTRON_API_URL\")\n",[277,1647,1648],{"class":279,"line":551},[277,1649,566],{},[277,1651,1652],{"class":279,"line":557},[277,1653,1654],{},"        panic(err)\n",[277,1656,1657],{"class":279,"line":563},[277,1658,444],{},[277,1660,1661],{"class":279,"line":569},[277,1662,1663],{},"    if _, err := prepareContext(ctx, httpClient, baseURL); err != nil {\n",[277,1665,1666],{"class":279,"line":575},[277,1667,1654],{},[277,1669,1670],{"class":279,"line":580},[277,1671,444],{},[277,1673,1674],{"class":279,"line":586},[277,1675,1676],{},"    decision, err := planAndDecide(ctx, httpClient, baseURL)\n",[277,1678,1679],{"class":279,"line":592},[277,1680,566],{},[277,1682,1683],{"class":279,"line":598},[277,1684,1654],{},[277,1686,1687],{"class":279,"line":604},[277,1688,444],{},[277,1690,1691],{"class":279,"line":610},[277,1692,1693],{},"    if err := observeAndReflect(ctx, httpClient, baseURL, decision); err != nil {\n",[277,1695,1696],{"class":279,"line":616},[277,1697,1654],{},[277,1699,1700],{"class":279,"line":621},[277,1701,444],{},[277,1703,1704],{"class":279,"line":626},[277,1705,456],{},[263,1707,1708,1709,1712],{},"Call ",[274,1710,1711],{},"observeAndReflect"," only after a separately authorized action produces trusted evidence, then review the reflection lesson before memory promotion.",[263,1714,1715,1716,1720],{},"Return to the ",[1717,1718,1719],"a",{"href":166},"shared lifecycle and production checklist",".",[1722,1723,1724],"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 .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);}",{"title":272,"searchDepth":317,"depth":317,"links":1726},[1727,1728,1729,1730],{"id":302,"depth":317,"text":303},{"id":749,"depth":317,"text":750},{"id":1062,"depth":317,"text":1063},{"id":1454,"depth":317,"text":1455},"Build a memory-and-consequence agent with the Go SDK and public REST endpoints.","md",{},{"title":94,"description":1731},"0weSBiWGK3sH-bt23thcdYDhKcPUqN7LU5XRHmDen5Y",[1737,1738],{"title":90,"path":177,"stem":178,"children":-1},{"title":98,"path":183,"stem":184,"children":-1},1786883755934]