[{"data":1,"prerenderedAt":1663},["ShallowReactive",2],{"docs-navigation":3,"docs-page-\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Frust":252,"docs-surround-\u002Fdocs\u002Fagents\u002Fmemory-consequence-agents\u002Fend-to-end\u002Frust":1660},[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":98,"body":254,"description":1655,"extension":1656,"meta":1657,"navigation":351,"path":183,"seo":1658,"stem":184,"__hash__":1659},"docs\u002Fdocs\u002F3.agents\u002F11.memory-consequence-agents\u002F2.end-to-end\u002F6.rust.md",{"type":255,"value":256,"toc":1649},"minimark",[257,262,266,308,315,320,586,589,593,845,852,856,1347,1350,1354,1634,1637,1645],[258,259,261],"h1",{"id":260},"rust-memory-consequence","Rust Memory + Consequence",[263,264,265],"p",{},"Use Rust 1.85 or newer:",[267,268,273],"pre",{"className":269,"code":270,"language":271,"meta":272,"style":272},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[dependencies]\nneutron-ai = \"0.2\"\nreqwest = { version = \"0.13\", default-features = false, features = [\"json\", \"rustls\"] }\nserde_json = \"1.0\"\ntokio = { version = \"1.53\", features = [\"macros\", \"rt-multi-thread\"] }\n","toml","",[274,275,276,284,290,296,302],"code",{"__ignoreMap":272},[277,278,281],"span",{"class":279,"line":280},"line",1,[277,282,283],{},"[dependencies]\n",[277,285,287],{"class":279,"line":286},2,[277,288,289],{},"neutron-ai = \"0.2\"\n",[277,291,293],{"class":279,"line":292},3,[277,294,295],{},"reqwest = { version = \"0.13\", default-features = false, features = [\"json\", \"rustls\"] }\n",[277,297,299],{"class":279,"line":298},4,[277,300,301],{},"serde_json = \"1.0\"\n",[277,303,305],{"class":279,"line":304},5,[277,306,307],{},"tokio = { version = \"1.53\", features = [\"macros\", \"rt-multi-thread\"] }\n",[263,309,310,311,314],{},"The SDK handles memory and agent context. ",[274,312,313],{},"reqwest"," calls industry-library and Consequence endpoints that are not yet exposed as typed Rust methods.",[316,317,319],"h2",{"id":318},"client-and-authenticated-rest-helper","Client and authenticated REST helper",[267,321,325],{"className":322,"code":323,"language":324,"meta":272,"style":272},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use neutron_ai::{ClientOptions, NeutronAIClient};\nuse reqwest::Client as HttpClient;\nuse serde_json::{Value, json};\nuse std::{env, error::Error};\n\nconst NUCLEUS_ID: &str = \"checkout-platform\";\n\nfn required_env(name: &str) -> Result\u003CString, Box\u003Cdyn Error>> {\n    let value = env::var(name)?;\n    if value.trim().is_empty() {\n        return Err(format!(\"{name} is required\").into());\n    }\n    Ok(value)\n}\n\nfn scoped(mut body: Value) -> Value {\n    body[\"nucleusId\"] = Value::String(NUCLEUS_ID.to_string());\n    body\n}\n\nasync fn post_json(\n    http: &HttpClient,\n    base_url: &str,\n    token: &str,\n    path: &str,\n    body: Value,\n) -> Result\u003CValue, Box\u003Cdyn Error>> {\n    let response = http\n        .post(format!(\"{}{}\", base_url.trim_end_matches('\u002F'), path))\n        .bearer_auth(token)\n        .json(&body)\n        .send()\n        .await?\n        .error_for_status()?;\n    Ok(response.json::\u003CValue>().await?)\n}\n\nfn memory_client(base_url: &str) -> Result\u003CNeutronAIClient, Box\u003Cdyn Error>> {\n    Ok(NeutronAIClient::new(ClientOptions {\n        base_url: base_url.to_string(),\n        token: Some(required_env(\"NEUTRON_API_TOKEN\")?),\n        nucleus_id: Some(NUCLEUS_ID.to_string()),\n        tenant_id: None,\n    })?)\n}\n","rust",[274,326,327,332,337,342,347,353,359,364,370,376,382,388,394,400,406,411,417,423,429,434,439,445,451,457,463,469,475,481,487,493,499,505,511,517,523,529,534,539,545,551,557,563,569,575,581],{"__ignoreMap":272},[277,328,329],{"class":279,"line":280},[277,330,331],{},"use neutron_ai::{ClientOptions, NeutronAIClient};\n",[277,333,334],{"class":279,"line":286},[277,335,336],{},"use reqwest::Client as HttpClient;\n",[277,338,339],{"class":279,"line":292},[277,340,341],{},"use serde_json::{Value, json};\n",[277,343,344],{"class":279,"line":298},[277,345,346],{},"use std::{env, error::Error};\n",[277,348,349],{"class":279,"line":304},[277,350,352],{"emptyLinePlaceholder":351},true,"\n",[277,354,356],{"class":279,"line":355},6,[277,357,358],{},"const NUCLEUS_ID: &str = \"checkout-platform\";\n",[277,360,362],{"class":279,"line":361},7,[277,363,352],{"emptyLinePlaceholder":351},[277,365,367],{"class":279,"line":366},8,[277,368,369],{},"fn required_env(name: &str) -> Result\u003CString, Box\u003Cdyn Error>> {\n",[277,371,373],{"class":279,"line":372},9,[277,374,375],{},"    let value = env::var(name)?;\n",[277,377,379],{"class":279,"line":378},10,[277,380,381],{},"    if value.trim().is_empty() {\n",[277,383,385],{"class":279,"line":384},11,[277,386,387],{},"        return Err(format!(\"{name} is required\").into());\n",[277,389,391],{"class":279,"line":390},12,[277,392,393],{},"    }\n",[277,395,397],{"class":279,"line":396},13,[277,398,399],{},"    Ok(value)\n",[277,401,403],{"class":279,"line":402},14,[277,404,405],{},"}\n",[277,407,409],{"class":279,"line":408},15,[277,410,352],{"emptyLinePlaceholder":351},[277,412,414],{"class":279,"line":413},16,[277,415,416],{},"fn scoped(mut body: Value) -> Value {\n",[277,418,420],{"class":279,"line":419},17,[277,421,422],{},"    body[\"nucleusId\"] = Value::String(NUCLEUS_ID.to_string());\n",[277,424,426],{"class":279,"line":425},18,[277,427,428],{},"    body\n",[277,430,432],{"class":279,"line":431},19,[277,433,405],{},[277,435,437],{"class":279,"line":436},20,[277,438,352],{"emptyLinePlaceholder":351},[277,440,442],{"class":279,"line":441},21,[277,443,444],{},"async fn post_json(\n",[277,446,448],{"class":279,"line":447},22,[277,449,450],{},"    http: &HttpClient,\n",[277,452,454],{"class":279,"line":453},23,[277,455,456],{},"    base_url: &str,\n",[277,458,460],{"class":279,"line":459},24,[277,461,462],{},"    token: &str,\n",[277,464,466],{"class":279,"line":465},25,[277,467,468],{},"    path: &str,\n",[277,470,472],{"class":279,"line":471},26,[277,473,474],{},"    body: Value,\n",[277,476,478],{"class":279,"line":477},27,[277,479,480],{},") -> Result\u003CValue, Box\u003Cdyn Error>> {\n",[277,482,484],{"class":279,"line":483},28,[277,485,486],{},"    let response = http\n",[277,488,490],{"class":279,"line":489},29,[277,491,492],{},"        .post(format!(\"{}{}\", base_url.trim_end_matches('\u002F'), path))\n",[277,494,496],{"class":279,"line":495},30,[277,497,498],{},"        .bearer_auth(token)\n",[277,500,502],{"class":279,"line":501},31,[277,503,504],{},"        .json(&body)\n",[277,506,508],{"class":279,"line":507},32,[277,509,510],{},"        .send()\n",[277,512,514],{"class":279,"line":513},33,[277,515,516],{},"        .await?\n",[277,518,520],{"class":279,"line":519},34,[277,521,522],{},"        .error_for_status()?;\n",[277,524,526],{"class":279,"line":525},35,[277,527,528],{},"    Ok(response.json::\u003CValue>().await?)\n",[277,530,532],{"class":279,"line":531},36,[277,533,405],{},[277,535,537],{"class":279,"line":536},37,[277,538,352],{"emptyLinePlaceholder":351},[277,540,542],{"class":279,"line":541},38,[277,543,544],{},"fn memory_client(base_url: &str) -> Result\u003CNeutronAIClient, Box\u003Cdyn Error>> {\n",[277,546,548],{"class":279,"line":547},39,[277,549,550],{},"    Ok(NeutronAIClient::new(ClientOptions {\n",[277,552,554],{"class":279,"line":553},40,[277,555,556],{},"        base_url: base_url.to_string(),\n",[277,558,560],{"class":279,"line":559},41,[277,561,562],{},"        token: Some(required_env(\"NEUTRON_API_TOKEN\")?),\n",[277,564,566],{"class":279,"line":565},42,[277,567,568],{},"        nucleus_id: Some(NUCLEUS_ID.to_string()),\n",[277,570,572],{"class":279,"line":571},43,[277,573,574],{},"        tenant_id: None,\n",[277,576,578],{"class":279,"line":577},44,[277,579,580],{},"    })?)\n",[277,582,584],{"class":279,"line":583},45,[277,585,405],{},[263,587,588],{},"Keep workspace, approver, and internal credentials outside the agent runtime.",[316,590,592],{"id":591},"install-knowledge-and-build-context","Install knowledge and build context",[267,594,596],{"className":322,"code":595,"language":324,"meta":272,"style":272},"async fn prepare_context(\n    http: &HttpClient,\n    base_url: &str,\n    memory: &NeutronAIClient,\n) -> Result\u003CValue, Box\u003Cdyn Error>> {\n    post_json(\n        http,\n        base_url,\n        &required_env(\"NEUTRON_WORKSPACE_API_KEY\")?,\n        \"\u002Fv1\u002Fplatform\u002Findustry-library\u002Fplugins\u002Fai-engineering-delivery\u002Finstall\",\n        json!({ \"nucleusId\": NUCLEUS_ID }),\n    )\n    .await?;\n\n    memory.remember(json!({\n        \"scopeId\": \"history:checkout-releases\",\n        \"agentId\": \"agent:release-manager\",\n        \"type\": \"experience\",\n        \"privacyClass\": \"tenant\",\n        \"text\": concat!(\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\": {\n            \"source\": \"approved-release-review\",\n            \"release\": \"3.7\",\n            \"outcome\": \"rolled-back\"\n        }\n    })).await?;\n\n    Ok(memory.agent_context(json!({\n        \"scopeIds\": [\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\": [\"tenant\"],\n        \"tokenBudget\": 1_600,\n        \"cachePolicy\": {\n            \"mode\": \"prefer_cache\",\n            \"keyMode\": \"intent_profile\",\n            \"ttlSeconds\": 300,\n            \"includeDynamicRag\": true\n        }\n    })).await?)\n}\n",[274,597,598,603,607,611,616,620,625,630,635,640,645,650,655,660,664,669,674,679,684,689,694,699,704,709,714,719,724,729,734,739,744,748,753,758,763,768,773,778,783,787,792,797,802,807,812,817,823,829,834,840],{"__ignoreMap":272},[277,599,600],{"class":279,"line":280},[277,601,602],{},"async fn prepare_context(\n",[277,604,605],{"class":279,"line":286},[277,606,450],{},[277,608,609],{"class":279,"line":292},[277,610,456],{},[277,612,613],{"class":279,"line":298},[277,614,615],{},"    memory: &NeutronAIClient,\n",[277,617,618],{"class":279,"line":304},[277,619,480],{},[277,621,622],{"class":279,"line":355},[277,623,624],{},"    post_json(\n",[277,626,627],{"class":279,"line":361},[277,628,629],{},"        http,\n",[277,631,632],{"class":279,"line":366},[277,633,634],{},"        base_url,\n",[277,636,637],{"class":279,"line":372},[277,638,639],{},"        &required_env(\"NEUTRON_WORKSPACE_API_KEY\")?,\n",[277,641,642],{"class":279,"line":378},[277,643,644],{},"        \"\u002Fv1\u002Fplatform\u002Findustry-library\u002Fplugins\u002Fai-engineering-delivery\u002Finstall\",\n",[277,646,647],{"class":279,"line":384},[277,648,649],{},"        json!({ \"nucleusId\": NUCLEUS_ID }),\n",[277,651,652],{"class":279,"line":390},[277,653,654],{},"    )\n",[277,656,657],{"class":279,"line":396},[277,658,659],{},"    .await?;\n",[277,661,662],{"class":279,"line":402},[277,663,352],{"emptyLinePlaceholder":351},[277,665,666],{"class":279,"line":408},[277,667,668],{},"    memory.remember(json!({\n",[277,670,671],{"class":279,"line":413},[277,672,673],{},"        \"scopeId\": \"history:checkout-releases\",\n",[277,675,676],{"class":279,"line":419},[277,677,678],{},"        \"agentId\": \"agent:release-manager\",\n",[277,680,681],{"class":279,"line":425},[277,682,683],{},"        \"type\": \"experience\",\n",[277,685,686],{"class":279,"line":431},[277,687,688],{},"        \"privacyClass\": \"tenant\",\n",[277,690,691],{"class":279,"line":436},[277,692,693],{},"        \"text\": concat!(\n",[277,695,696],{"class":279,"line":441},[277,697,698],{},"            \"Release 3.7 used a 5% cohort for 20 minutes before expansion. \",\n",[277,700,701],{"class":279,"line":447},[277,702,703],{},"            \"The rollout paused when database lock time exceeded 250 ms. \",\n",[277,705,706],{"class":279,"line":453},[277,707,708],{},"            \"Rollback succeeded. Verify lock duration before expanding similar changes.\"\n",[277,710,711],{"class":279,"line":459},[277,712,713],{},"        ),\n",[277,715,716],{"class":279,"line":465},[277,717,718],{},"        \"metadata\": {\n",[277,720,721],{"class":279,"line":471},[277,722,723],{},"            \"source\": \"approved-release-review\",\n",[277,725,726],{"class":279,"line":477},[277,727,728],{},"            \"release\": \"3.7\",\n",[277,730,731],{"class":279,"line":483},[277,732,733],{},"            \"outcome\": \"rolled-back\"\n",[277,735,736],{"class":279,"line":489},[277,737,738],{},"        }\n",[277,740,741],{"class":279,"line":495},[277,742,743],{},"    })).await?;\n",[277,745,746],{"class":279,"line":501},[277,747,352],{"emptyLinePlaceholder":351},[277,749,750],{"class":279,"line":507},[277,751,752],{},"    Ok(memory.agent_context(json!({\n",[277,754,755],{"class":279,"line":513},[277,756,757],{},"        \"scopeIds\": [\n",[277,759,760],{"class":279,"line":519},[277,761,762],{},"            \"industry:ai-engineering-delivery\",\n",[277,764,765],{"class":279,"line":525},[277,766,767],{},"            \"service:checkout-api\",\n",[277,769,770],{"class":279,"line":531},[277,771,772],{},"            \"history:checkout-releases\",\n",[277,774,775],{"class":279,"line":536},[277,776,777],{},"            \"policy:production-change\"\n",[277,779,780],{"class":279,"line":541},[277,781,782],{},"        ],\n",[277,784,785],{"class":279,"line":547},[277,786,678],{},[277,788,789],{"class":279,"line":553},[277,790,791],{},"        \"task\": \"Prepare a safe release recommendation for checkout API version 3.8.\",\n",[277,793,794],{"class":279,"line":559},[277,795,796],{},"        \"privacyClasses\": [\"tenant\"],\n",[277,798,799],{"class":279,"line":565},[277,800,801],{},"        \"tokenBudget\": 1_600,\n",[277,803,804],{"class":279,"line":571},[277,805,806],{},"        \"cachePolicy\": {\n",[277,808,809],{"class":279,"line":577},[277,810,811],{},"            \"mode\": \"prefer_cache\",\n",[277,813,814],{"class":279,"line":583},[277,815,816],{},"            \"keyMode\": \"intent_profile\",\n",[277,818,820],{"class":279,"line":819},46,[277,821,822],{},"            \"ttlSeconds\": 300,\n",[277,824,826],{"class":279,"line":825},47,[277,827,828],{},"            \"includeDynamicRag\": true\n",[277,830,832],{"class":279,"line":831},48,[277,833,738],{},[277,835,837],{"class":279,"line":836},49,[277,838,839],{},"    })).await?)\n",[277,841,843],{"class":279,"line":842},50,[277,844,405],{},[263,846,847,848,851],{},"Treat the returned ",[274,849,850],{},"promptContext"," as supporting context. Current evidence and the current task remain primary.",[316,853,855],{"id":854},"plan-decide-and-approve","Plan, decide, and approve",[267,857,859],{"className":322,"code":858,"language":324,"meta":272,"style":272},"async fn plan_and_decide(\n    http: &HttpClient,\n    base_url: &str,\n) -> Result\u003CValue, Box\u003Cdyn Error>> {\n    let agent_token = required_env(\"NEUTRON_API_TOKEN\")?;\n    let run = post_json(\n        http,\n        base_url,\n        &agent_token,\n        \"\u002Fv1\u002Fconsequence\u002Fplan\",\n        scoped(json!({\n            \"scopeIds\": [\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\": \"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\": [\n                \"Reduce customer impact\",\n                \"Preserve rollback capability\",\n                \"Collect evidence before expansion\"\n            ],\n            \"constraintHints\": [\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\": {\n                \"includeMemory\": true,\n                \"includeKnowledge\": true,\n                \"includeContextCapsules\": true,\n                \"includePastDecisions\": true,\n                \"includeReflections\": true\n            },\n            \"policy\": {\n                \"mode\": \"deep\",\n                \"depth\": 10,\n                \"maxScenarios\": 8,\n                \"maxRuntimeMs\": 8_000,\n                \"requireApprovalAboveRisk\": \"medium\",\n                \"allowExecution\": false,\n                \"storeSafeArtifactsOnly\": true,\n                \"includeCounterfactuals\": true,\n                \"includeReflections\": true\n            }\n        })),\n    )\n    .await?;\n\n    let scenario_id = run[\"recommendedScenarioId\"]\n        .as_str()\n        .ok_or(\"No scenario satisfied the current decision boundary\")?;\n    let run_id = run[\"runId\"].as_str().ok_or(\"runId was not returned\")?;\n    let decided = post_json(\n        http,\n        base_url,\n        &agent_token,\n        \"\u002Fv1\u002Fconsequence\u002Fdecide\",\n        scoped(json!({\n            \"runId\": run_id,\n            \"scopeIds\": [\"service:checkout-api\", \"policy:production-change\"],\n            \"selectedScenarioId\": scenario_id,\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    )\n    .await?;\n    let decision = decided[\"decisionRecord\"].clone();\n    if decision.is_null() {\n        return Err(\"The decision record was not created\".into());\n    }\n\n    if decision[\"status\"] == \"draft\" {\n        post_json(\n            http,\n            base_url,\n            &required_env(\"NEUTRON_APPROVER_TOKEN\")?,\n            \"\u002Fv1\u002Fconsequence\u002Fapprove\",\n            scoped(json!({\n                \"decisionId\": decision[\"decisionId\"],\n                \"scopeIds\": [\"service:checkout-api\", \"policy:production-change\"],\n                \"note\": \"Release owner approved the pilot only; expansion needs another review.\"\n            })),\n        )\n        .await?;\n    }\n    Ok(decision)\n}\n",[274,860,861,866,870,874,878,883,888,892,896,901,906,911,916,921,926,931,936,941,946,951,956,961,966,971,976,980,985,990,995,1000,1004,1009,1014,1019,1024,1029,1034,1039,1044,1049,1054,1059,1064,1069,1074,1079,1084,1089,1094,1098,1103,1109,1114,1119,1124,1130,1136,1142,1148,1154,1159,1164,1169,1175,1180,1186,1192,1198,1204,1210,1215,1220,1225,1231,1237,1243,1248,1253,1259,1265,1271,1277,1283,1289,1295,1301,1307,1313,1319,1325,1331,1336,1342],{"__ignoreMap":272},[277,862,863],{"class":279,"line":280},[277,864,865],{},"async fn plan_and_decide(\n",[277,867,868],{"class":279,"line":286},[277,869,450],{},[277,871,872],{"class":279,"line":292},[277,873,456],{},[277,875,876],{"class":279,"line":298},[277,877,480],{},[277,879,880],{"class":279,"line":304},[277,881,882],{},"    let agent_token = required_env(\"NEUTRON_API_TOKEN\")?;\n",[277,884,885],{"class":279,"line":355},[277,886,887],{},"    let run = post_json(\n",[277,889,890],{"class":279,"line":361},[277,891,629],{},[277,893,894],{"class":279,"line":366},[277,895,634],{},[277,897,898],{"class":279,"line":372},[277,899,900],{},"        &agent_token,\n",[277,902,903],{"class":279,"line":378},[277,904,905],{},"        \"\u002Fv1\u002Fconsequence\u002Fplan\",\n",[277,907,908],{"class":279,"line":384},[277,909,910],{},"        scoped(json!({\n",[277,912,913],{"class":279,"line":390},[277,914,915],{},"            \"scopeIds\": [\n",[277,917,918],{"class":279,"line":396},[277,919,920],{},"                \"industry:ai-engineering-delivery\",\n",[277,922,923],{"class":279,"line":402},[277,924,925],{},"                \"service:checkout-api\",\n",[277,927,928],{"class":279,"line":408},[277,929,930],{},"                \"history:checkout-releases\",\n",[277,932,933],{"class":279,"line":413},[277,934,935],{},"                \"policy:production-change\"\n",[277,937,938],{"class":279,"line":419},[277,939,940],{},"            ],\n",[277,942,943],{"class":279,"line":425},[277,944,945],{},"            \"agentId\": \"agent:release-manager\",\n",[277,947,948],{"class":279,"line":431},[277,949,950],{},"            \"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,952,953],{"class":279,"line":436},[277,954,955],{},"            \"domain\": \"engineering_ops\",\n",[277,957,958],{"class":279,"line":441},[277,959,960],{},"            \"objectiveHints\": [\n",[277,962,963],{"class":279,"line":447},[277,964,965],{},"                \"Reduce customer impact\",\n",[277,967,968],{"class":279,"line":453},[277,969,970],{},"                \"Preserve rollback capability\",\n",[277,972,973],{"class":279,"line":459},[277,974,975],{},"                \"Collect evidence before expansion\"\n",[277,977,978],{"class":279,"line":465},[277,979,940],{},[277,981,982],{"class":279,"line":471},[277,983,984],{},"            \"constraintHints\": [\n",[277,986,987],{"class":279,"line":477},[277,988,989],{},"                \"Database lock time must remain below the approved threshold\",\n",[277,991,992],{"class":279,"line":483},[277,993,994],{},"                \"Expansion requires the accountable release owner\",\n",[277,996,997],{"class":279,"line":489},[277,998,999],{},"                \"Rollback must remain available\"\n",[277,1001,1002],{"class":279,"line":495},[277,1003,940],{},[277,1005,1006],{"class":279,"line":501},[277,1007,1008],{},"            \"idempotencyKey\": \"checkout-3.8-release-review-v1\",\n",[277,1010,1011],{"class":279,"line":507},[277,1012,1013],{},"            \"retentionDays\": 90,\n",[277,1015,1016],{"class":279,"line":513},[277,1017,1018],{},"            \"contextPolicy\": {\n",[277,1020,1021],{"class":279,"line":519},[277,1022,1023],{},"                \"includeMemory\": true,\n",[277,1025,1026],{"class":279,"line":525},[277,1027,1028],{},"                \"includeKnowledge\": true,\n",[277,1030,1031],{"class":279,"line":531},[277,1032,1033],{},"                \"includeContextCapsules\": true,\n",[277,1035,1036],{"class":279,"line":536},[277,1037,1038],{},"                \"includePastDecisions\": true,\n",[277,1040,1041],{"class":279,"line":541},[277,1042,1043],{},"                \"includeReflections\": true\n",[277,1045,1046],{"class":279,"line":547},[277,1047,1048],{},"            },\n",[277,1050,1051],{"class":279,"line":553},[277,1052,1053],{},"            \"policy\": {\n",[277,1055,1056],{"class":279,"line":559},[277,1057,1058],{},"                \"mode\": \"deep\",\n",[277,1060,1061],{"class":279,"line":565},[277,1062,1063],{},"                \"depth\": 10,\n",[277,1065,1066],{"class":279,"line":571},[277,1067,1068],{},"                \"maxScenarios\": 8,\n",[277,1070,1071],{"class":279,"line":577},[277,1072,1073],{},"                \"maxRuntimeMs\": 8_000,\n",[277,1075,1076],{"class":279,"line":583},[277,1077,1078],{},"                \"requireApprovalAboveRisk\": \"medium\",\n",[277,1080,1081],{"class":279,"line":819},[277,1082,1083],{},"                \"allowExecution\": false,\n",[277,1085,1086],{"class":279,"line":825},[277,1087,1088],{},"                \"storeSafeArtifactsOnly\": true,\n",[277,1090,1091],{"class":279,"line":831},[277,1092,1093],{},"                \"includeCounterfactuals\": true,\n",[277,1095,1096],{"class":279,"line":836},[277,1097,1043],{},[277,1099,1100],{"class":279,"line":842},[277,1101,1102],{},"            }\n",[277,1104,1106],{"class":279,"line":1105},51,[277,1107,1108],{},"        })),\n",[277,1110,1112],{"class":279,"line":1111},52,[277,1113,654],{},[277,1115,1117],{"class":279,"line":1116},53,[277,1118,659],{},[277,1120,1122],{"class":279,"line":1121},54,[277,1123,352],{"emptyLinePlaceholder":351},[277,1125,1127],{"class":279,"line":1126},55,[277,1128,1129],{},"    let scenario_id = run[\"recommendedScenarioId\"]\n",[277,1131,1133],{"class":279,"line":1132},56,[277,1134,1135],{},"        .as_str()\n",[277,1137,1139],{"class":279,"line":1138},57,[277,1140,1141],{},"        .ok_or(\"No scenario satisfied the current decision boundary\")?;\n",[277,1143,1145],{"class":279,"line":1144},58,[277,1146,1147],{},"    let run_id = run[\"runId\"].as_str().ok_or(\"runId was not returned\")?;\n",[277,1149,1151],{"class":279,"line":1150},59,[277,1152,1153],{},"    let decided = post_json(\n",[277,1155,1157],{"class":279,"line":1156},60,[277,1158,629],{},[277,1160,1162],{"class":279,"line":1161},61,[277,1163,634],{},[277,1165,1167],{"class":279,"line":1166},62,[277,1168,900],{},[277,1170,1172],{"class":279,"line":1171},63,[277,1173,1174],{},"        \"\u002Fv1\u002Fconsequence\u002Fdecide\",\n",[277,1176,1178],{"class":279,"line":1177},64,[277,1179,910],{},[277,1181,1183],{"class":279,"line":1182},65,[277,1184,1185],{},"            \"runId\": run_id,\n",[277,1187,1189],{"class":279,"line":1188},66,[277,1190,1191],{},"            \"scopeIds\": [\"service:checkout-api\", \"policy:production-change\"],\n",[277,1193,1195],{"class":279,"line":1194},67,[277,1196,1197],{},"            \"selectedScenarioId\": scenario_id,\n",[277,1199,1201],{"class":279,"line":1200},68,[277,1202,1203],{},"            \"decisionSummary\": \"Selected the bounded pilot scenario for owner review.\",\n",[277,1205,1207],{"class":279,"line":1206},69,[277,1208,1209],{},"            \"rationaleSummary\": \"The pilot preserves rollback and gathers current lock evidence; expansion requires threshold compliance and owner review.\"\n",[277,1211,1213],{"class":279,"line":1212},70,[277,1214,1108],{},[277,1216,1218],{"class":279,"line":1217},71,[277,1219,654],{},[277,1221,1223],{"class":279,"line":1222},72,[277,1224,659],{},[277,1226,1228],{"class":279,"line":1227},73,[277,1229,1230],{},"    let decision = decided[\"decisionRecord\"].clone();\n",[277,1232,1234],{"class":279,"line":1233},74,[277,1235,1236],{},"    if decision.is_null() {\n",[277,1238,1240],{"class":279,"line":1239},75,[277,1241,1242],{},"        return Err(\"The decision record was not created\".into());\n",[277,1244,1246],{"class":279,"line":1245},76,[277,1247,393],{},[277,1249,1251],{"class":279,"line":1250},77,[277,1252,352],{"emptyLinePlaceholder":351},[277,1254,1256],{"class":279,"line":1255},78,[277,1257,1258],{},"    if decision[\"status\"] == \"draft\" {\n",[277,1260,1262],{"class":279,"line":1261},79,[277,1263,1264],{},"        post_json(\n",[277,1266,1268],{"class":279,"line":1267},80,[277,1269,1270],{},"            http,\n",[277,1272,1274],{"class":279,"line":1273},81,[277,1275,1276],{},"            base_url,\n",[277,1278,1280],{"class":279,"line":1279},82,[277,1281,1282],{},"            &required_env(\"NEUTRON_APPROVER_TOKEN\")?,\n",[277,1284,1286],{"class":279,"line":1285},83,[277,1287,1288],{},"            \"\u002Fv1\u002Fconsequence\u002Fapprove\",\n",[277,1290,1292],{"class":279,"line":1291},84,[277,1293,1294],{},"            scoped(json!({\n",[277,1296,1298],{"class":279,"line":1297},85,[277,1299,1300],{},"                \"decisionId\": decision[\"decisionId\"],\n",[277,1302,1304],{"class":279,"line":1303},86,[277,1305,1306],{},"                \"scopeIds\": [\"service:checkout-api\", \"policy:production-change\"],\n",[277,1308,1310],{"class":279,"line":1309},87,[277,1311,1312],{},"                \"note\": \"Release owner approved the pilot only; expansion needs another review.\"\n",[277,1314,1316],{"class":279,"line":1315},88,[277,1317,1318],{},"            })),\n",[277,1320,1322],{"class":279,"line":1321},89,[277,1323,1324],{},"        )\n",[277,1326,1328],{"class":279,"line":1327},90,[277,1329,1330],{},"        .await?;\n",[277,1332,1334],{"class":279,"line":1333},91,[277,1335,393],{},[277,1337,1339],{"class":279,"line":1338},92,[277,1340,1341],{},"    Ok(decision)\n",[277,1343,1345],{"class":279,"line":1344},93,[277,1346,405],{},[263,1348,1349],{},"Use the approver token only after verifying the authenticated human. Approval records authorization; it does not execute the release.",[316,1351,1353],{"id":1352},"observe-and-reflect","Observe and reflect",[267,1355,1357],{"className":322,"code":1356,"language":324,"meta":272,"style":272},"async fn observe_and_reflect(\n    http: &HttpClient,\n    base_url: &str,\n    decision: &Value,\n) -> Result\u003CValue, Box\u003Cdyn Error>> {\n    post_json(\n        http,\n        base_url,\n        &required_env(\"NEUTRON_API_TOKEN\")?,\n        \"\u002Fv1\u002Fconsequence\u002Fobserve\",\n        scoped(json!({\n            \"decisionId\": decision[\"decisionId\"],\n            \"scopeIds\": [\"service:checkout-api\", \"history:checkout-releases\"],\n            \"summary\": \"The 1% pilot completed without customer errors and was held for review.\",\n            \"observedMetrics\": {\n                \"pilot_percent\": 1,\n                \"pilot_minutes\": 30,\n                \"database_lock_p95_ms\": 180,\n                \"customer_error_rate\": 0\n            },\n            \"unexpectedConsequences\": [\n                \"Cache warm-up took ten minutes longer than estimated.\"\n            ],\n            \"sourceRefs\": [\n                \"release-run:checkout-3.8-pilot\",\n                \"dashboard:database-locks-2026-08-15\"\n            ]\n        })),\n    )\n    .await?;\n\n    post_json(\n        http,\n        base_url,\n        &required_env(\"NEUTRON_INTERNAL_TOKEN\")?,\n        \"\u002Fv1\u002Fconsequence\u002Freflect\",\n        scoped(json!({\n            \"decisionId\": decision[\"decisionId\"],\n            \"scopeIds\": [\"service:checkout-api\", \"history:checkout-releases\"]\n        })),\n    )\n    .await\n}\n\n#[tokio::main]\nasync fn main() -> Result\u003C(), Box\u003Cdyn Error>> {\n    let base_url = required_env(\"NEUTRON_API_URL\")?;\n    let http = HttpClient::new();\n    let memory = memory_client(&base_url)?;\n    prepare_context(&http, &base_url, &memory).await?;\n    let decision = plan_and_decide(&http, &base_url).await?;\n\n    \u002F\u002F Call only after a separately authorized action produces trusted evidence.\n    let reflected = observe_and_reflect(&http, &base_url, &decision).await?;\n    let lesson = reflected[\"reflectionLessons\"].as_array().and_then(|items| items.last());\n    if lesson.is_none() {\n        return Err(\"Reflection did not return a lesson\".into());\n    }\n    Ok(())\n}\n",[274,1358,1359,1364,1368,1372,1377,1381,1385,1389,1393,1398,1403,1407,1412,1417,1422,1427,1432,1437,1442,1447,1451,1456,1461,1465,1470,1475,1480,1485,1489,1493,1497,1501,1505,1509,1513,1518,1523,1527,1531,1536,1540,1544,1549,1553,1557,1562,1567,1572,1577,1582,1587,1592,1596,1601,1606,1611,1616,1621,1625,1630],{"__ignoreMap":272},[277,1360,1361],{"class":279,"line":280},[277,1362,1363],{},"async fn observe_and_reflect(\n",[277,1365,1366],{"class":279,"line":286},[277,1367,450],{},[277,1369,1370],{"class":279,"line":292},[277,1371,456],{},[277,1373,1374],{"class":279,"line":298},[277,1375,1376],{},"    decision: &Value,\n",[277,1378,1379],{"class":279,"line":304},[277,1380,480],{},[277,1382,1383],{"class":279,"line":355},[277,1384,624],{},[277,1386,1387],{"class":279,"line":361},[277,1388,629],{},[277,1390,1391],{"class":279,"line":366},[277,1392,634],{},[277,1394,1395],{"class":279,"line":372},[277,1396,1397],{},"        &required_env(\"NEUTRON_API_TOKEN\")?,\n",[277,1399,1400],{"class":279,"line":378},[277,1401,1402],{},"        \"\u002Fv1\u002Fconsequence\u002Fobserve\",\n",[277,1404,1405],{"class":279,"line":384},[277,1406,910],{},[277,1408,1409],{"class":279,"line":390},[277,1410,1411],{},"            \"decisionId\": decision[\"decisionId\"],\n",[277,1413,1414],{"class":279,"line":396},[277,1415,1416],{},"            \"scopeIds\": [\"service:checkout-api\", \"history:checkout-releases\"],\n",[277,1418,1419],{"class":279,"line":402},[277,1420,1421],{},"            \"summary\": \"The 1% pilot completed without customer errors and was held for review.\",\n",[277,1423,1424],{"class":279,"line":408},[277,1425,1426],{},"            \"observedMetrics\": {\n",[277,1428,1429],{"class":279,"line":413},[277,1430,1431],{},"                \"pilot_percent\": 1,\n",[277,1433,1434],{"class":279,"line":419},[277,1435,1436],{},"                \"pilot_minutes\": 30,\n",[277,1438,1439],{"class":279,"line":425},[277,1440,1441],{},"                \"database_lock_p95_ms\": 180,\n",[277,1443,1444],{"class":279,"line":431},[277,1445,1446],{},"                \"customer_error_rate\": 0\n",[277,1448,1449],{"class":279,"line":436},[277,1450,1048],{},[277,1452,1453],{"class":279,"line":441},[277,1454,1455],{},"            \"unexpectedConsequences\": [\n",[277,1457,1458],{"class":279,"line":447},[277,1459,1460],{},"                \"Cache warm-up took ten minutes longer than estimated.\"\n",[277,1462,1463],{"class":279,"line":453},[277,1464,940],{},[277,1466,1467],{"class":279,"line":459},[277,1468,1469],{},"            \"sourceRefs\": [\n",[277,1471,1472],{"class":279,"line":465},[277,1473,1474],{},"                \"release-run:checkout-3.8-pilot\",\n",[277,1476,1477],{"class":279,"line":471},[277,1478,1479],{},"                \"dashboard:database-locks-2026-08-15\"\n",[277,1481,1482],{"class":279,"line":477},[277,1483,1484],{},"            ]\n",[277,1486,1487],{"class":279,"line":483},[277,1488,1108],{},[277,1490,1491],{"class":279,"line":489},[277,1492,654],{},[277,1494,1495],{"class":279,"line":495},[277,1496,659],{},[277,1498,1499],{"class":279,"line":501},[277,1500,352],{"emptyLinePlaceholder":351},[277,1502,1503],{"class":279,"line":507},[277,1504,624],{},[277,1506,1507],{"class":279,"line":513},[277,1508,629],{},[277,1510,1511],{"class":279,"line":519},[277,1512,634],{},[277,1514,1515],{"class":279,"line":525},[277,1516,1517],{},"        &required_env(\"NEUTRON_INTERNAL_TOKEN\")?,\n",[277,1519,1520],{"class":279,"line":531},[277,1521,1522],{},"        \"\u002Fv1\u002Fconsequence\u002Freflect\",\n",[277,1524,1525],{"class":279,"line":536},[277,1526,910],{},[277,1528,1529],{"class":279,"line":541},[277,1530,1411],{},[277,1532,1533],{"class":279,"line":547},[277,1534,1535],{},"            \"scopeIds\": [\"service:checkout-api\", \"history:checkout-releases\"]\n",[277,1537,1538],{"class":279,"line":553},[277,1539,1108],{},[277,1541,1542],{"class":279,"line":559},[277,1543,654],{},[277,1545,1546],{"class":279,"line":565},[277,1547,1548],{},"    .await\n",[277,1550,1551],{"class":279,"line":571},[277,1552,405],{},[277,1554,1555],{"class":279,"line":577},[277,1556,352],{"emptyLinePlaceholder":351},[277,1558,1559],{"class":279,"line":583},[277,1560,1561],{},"#[tokio::main]\n",[277,1563,1564],{"class":279,"line":819},[277,1565,1566],{},"async fn main() -> Result\u003C(), Box\u003Cdyn Error>> {\n",[277,1568,1569],{"class":279,"line":825},[277,1570,1571],{},"    let base_url = required_env(\"NEUTRON_API_URL\")?;\n",[277,1573,1574],{"class":279,"line":831},[277,1575,1576],{},"    let http = HttpClient::new();\n",[277,1578,1579],{"class":279,"line":836},[277,1580,1581],{},"    let memory = memory_client(&base_url)?;\n",[277,1583,1584],{"class":279,"line":842},[277,1585,1586],{},"    prepare_context(&http, &base_url, &memory).await?;\n",[277,1588,1589],{"class":279,"line":1105},[277,1590,1591],{},"    let decision = plan_and_decide(&http, &base_url).await?;\n",[277,1593,1594],{"class":279,"line":1111},[277,1595,352],{"emptyLinePlaceholder":351},[277,1597,1598],{"class":279,"line":1116},[277,1599,1600],{},"    \u002F\u002F Call only after a separately authorized action produces trusted evidence.\n",[277,1602,1603],{"class":279,"line":1121},[277,1604,1605],{},"    let reflected = observe_and_reflect(&http, &base_url, &decision).await?;\n",[277,1607,1608],{"class":279,"line":1126},[277,1609,1610],{},"    let lesson = reflected[\"reflectionLessons\"].as_array().and_then(|items| items.last());\n",[277,1612,1613],{"class":279,"line":1132},[277,1614,1615],{},"    if lesson.is_none() {\n",[277,1617,1618],{"class":279,"line":1138},[277,1619,1620],{},"        return Err(\"Reflection did not return a lesson\".into());\n",[277,1622,1623],{"class":279,"line":1144},[277,1624,393],{},[277,1626,1627],{"class":279,"line":1150},[277,1628,1629],{},"    Ok(())\n",[277,1631,1632],{"class":279,"line":1156},[277,1633,405],{},[263,1635,1636],{},"Review the reflection lesson before any durable memory promotion.",[263,1638,1639,1640,1644],{},"Return to the ",[1641,1642,1643],"a",{"href":166},"shared lifecycle and production checklist",".",[1646,1647,1648],"style",{},"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":286,"depth":286,"links":1650},[1651,1652,1653,1654],{"id":318,"depth":286,"text":319},{"id":591,"depth":286,"text":592},{"id":854,"depth":286,"text":855},{"id":1352,"depth":286,"text":1353},"Build a memory-and-consequence agent with the Rust SDK and public REST endpoints.","md",{},{"title":98,"description":1655},"Tmo7EMAqMhaKf4sJPWwERKl4j25qi4wqeuunh1QVHLw",[1661,1662],{"title":94,"path":180,"stem":181,"children":-1},{"title":186,"path":187,"stem":188,"children":-1},1786883757086]