[{"data":1,"prerenderedAt":6660},["ShallowReactive",2],{"app-navigation_en":3,"blog-post:posts_en:/en/blog/anatomy-mission-critical-ai":99,"blog-available-locales:anatomy-mission-critical-ai":2877,"blog-navigation_en":2879,"blog-surround:posts_en:/en/blog/anatomy-mission-critical-ai":2905},[4],{"title":5,"path":6,"stem":7,"children":8,"page":98},"En","/en","en",[9],{"title":10,"path":11,"stem":12,"children":13,"page":98},"Blog","/en/blog","en/blog",[14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94],{"title":15,"path":16,"stem":17},"Security Practices for MCP Using JSON-RPC","/en/blog/mcp-security","en/blog/1. mcp-security",{"title":19,"path":20,"stem":21},"MikesHub internals: port ownership, reclaim, and AWP-paced Tauri","/en/blog/mikeshub","en/blog/10. mikeshub",{"title":23,"path":24,"stem":25},"Anatomy of a Mission-Critical AI System","/en/blog/anatomy-mission-critical-ai","en/blog/11. anatomy-mission-critical-ai",{"title":27,"path":28,"stem":29},"rag-factory: a Rust engine for recipe-driven RAG — cite, refuse, eval before ship","/en/blog/rag-factory","en/blog/12. rag-factory",{"title":31,"path":32,"stem":33},"Offline-verifiable attestation for consequential AI runs","/en/blog/agent-receipts-packing-slip","en/blog/13. agent-receipts-packing-slip",{"title":35,"path":36,"stem":37},"MCP Servers: Connecting AI to Real-Time Data","/en/blog/mcp-create","en/blog/2. mcp-create",{"title":39,"path":40,"stem":41},"MCP Servers: Risks of Using in Claude Desktop","/en/blog/mcp-risks","en/blog/3. mcp-risks",{"title":43,"path":44,"stem":45},"MCP Servers: Integrating LLM in E-Commerce Systems","/en/blog/mcp","en/blog/4. mcp",{"title":47,"path":48,"stem":49},"MCP Tiny Agents On-Premises: Breaking Free from Cloud Dependencies","/en/blog/mcp-tiny-agents-on-premises","en/blog/5. mcp-tiny-agents-on-premises",{"title":51,"path":52,"stem":53},"From Idea to API in 2 Days: Building Bankly with Agentic Workflows","/en/blog/overvibing","en/blog/6. overvibing",{"title":55,"path":56,"stem":57},"AI Chat, MCP Server build with Agentic Workflow Protocol for demo at Checkatrade .com","/en/blog/mcp-in-chat-demo","en/blog/8. mcp-in-chat-demo",{"title":59,"path":60,"stem":61},"MutuelleFit: contracts from a payroll-native insurance vertical","/en/blog/mutuellefit-ddd-agentic","en/blog/9. mutuellefit-ddd-agentic",{"title":63,"path":64,"stem":65},"AI Opportunities for Checkatrade considering PERN Stack","/en/blog/ai-opportunities-pern-stack","en/blog/ai-opportunities-pern-stack",{"title":67,"path":68,"stem":69},"Domain-Driven Design in Full-Stack Frameworks","/en/blog/architecture","en/blog/architecture",{"title":71,"path":72,"stem":73},"one-front, as told by git","/en/blog/building-one-front","en/blog/building-one-front",{"title":75,"path":76,"stem":77},"Commercial architecture is a chain, not a pricing page","/en/blog/commercial-architecture-chain","en/blog/commercial-architecture-chain",{"title":79,"path":80,"stem":81},"Quality: How to protect AI-powered Frontends?","/en/blog/qa-front","en/blog/qa-front",{"title":83,"path":84,"stem":85},"The Hidden Dangers of GraphQL: Security, Performance, and Complexity Risks","/en/blog/risking-with-graphql","en/blog/risking-with-graphql",{"title":87,"path":88,"stem":89},"From Zero to Hero: Scaling up to million users","/en/blog/scalability","en/blog/scalability",{"title":91,"path":92,"stem":93},"IT Consulting and Strategy","/en/blog/strategy","en/blog/strategy",{"title":95,"path":96,"stem":97},"Distributed Systems","/en/blog/systems","en/blog/systems",false,{"id":100,"title":23,"authors":101,"badge":108,"body":112,"date":2869,"description":2870,"extension":2871,"image":2872,"meta":2874,"navigation":2131,"path":24,"seo":2875,"stem":25,"__hash__":2876},"posts_en/en/blog/11. anatomy-mission-critical-ai.md",[102],{"name":103,"description":104,"to":105,"avatar":106},"Michael Wybraniec","System Design, GenAI Automation & Architecture","https://www.linkedin.com/in/one-front/",{"src":107},"https://media.licdn.com/dms/image/v2/D4D03AQEGvIVcrTTS2g/profile-displayphoto-shrink_800_800/B4DZbtSf7LIEAc-/0/1747737772225?e=1753315200&v=beta&t=EOviZQkM396PoGctVjDCdlG8U3vN5UKWiIeNQ8IFUgQ",{"label":109,"color":110,"variant":111},"Mission-critical AI, Guardrails, Audit","primary","soft",{"type":113,"value":114,"toc":2827},"minimark",[115,118,140,154,162,179,201,207,223,229,235,249,258,267,275,290,296,306,315,321,340,346,361,367,417,423,433,439,444,454,490,498,520,530,538,558,573,579,589,593,611,693,703,711,731,739,789,795,810,816,858,868,872,885,908,914,918,924,1008,1014,1022,1034,1049,1065,1073,1079,1085,1093,1101,1116,1122,1150,1158,1164,1179,1189,1193,1211,1219,1227,1231,1237,1269,1283,1291,1299,1314,1323,1336,1356,1366,1374,1386,1392,1407,1417,1423,1480,1484,1494,1573,1582,1586,1605,1730,1742,1757,1761,1769,1779,1783,1870,1874,1901,1909,1913,1919,2055,2065,2421,2436,2443,2467,2473,2488,2494,2533,2542,2557,2563,2567,2573,2577,2587,2591,2597,2601,2612,2616,2622,2626,2643,2649,2664,2673,2759,2774,2783,2793,2805,2811,2823],[116,117],"br",{},[119,120,123],"div",{"className":121},[122],"text-justify",[124,125,126,127,131,132,135,136,139],"p",{},"How we built a public-warning assistant where ",[128,129,130],"strong",{},"models propose",", ",[128,133,134],{},"policy decides what is allowed",", and ",[128,137,138],{},"humans alone authorize the send",".",[119,141,143],{"className":142},[122],[124,144,145,146,149,150,153],{},"This is the anatomy of control around an LLM for France-style evacuate / FR-Alert channels — not a chatbot with a send button. Demo below is ",[128,147,148],{},"stub/sim"," (no live cell broadcast). Figures are full width with alt text — ",[128,151,152],{},"click"," an image for full screen.",[155,156],"gif-poster-video",{"alt":157,"ariaLabel":158,"music":159,"poster":160,"src":161},"Animated preview of the intentEvacuate operator demo — chat, architecture graph, and systems console","Demo walkthrough of the intentEvacuate Mission Assistant — operator chat, architecture graph, and systems console (~1 minute 55 seconds, stub/sim)","/audio/funkyelement.mp3","/blog/intent-evacuate/00-demo-social.gif","/blog/intent-evacuate/00-demo.mp4",[119,163,165],{"className":164},[122],[124,166,167],{},[168,169,170,171,174,175,178],"em",{},"Demo walkthrough (~1:55). Preview above is the social cut (2×) — ",[128,172,173],{},"Play demo"," or ",[128,176,177],{},"Play demo with music"," (Bensound).",[119,180,185,192],{"className":181},[182,183,184],"flex","justify-between","items-center",[186,187,189],"h2",{"id":188},"_1-cold-open",[128,190,191],{},"1. Cold open",[124,193,194],{},[195,196,198],"a",{"href":197},"#top",[128,199,200],{},"⤴",[119,202,204],{"className":203},[122],[124,205,206],{},"Imagine an operator under time pressure. Flood waters are rising. They type, in French:",[119,208,210],{"className":209},[122],[211,212,213],"blockquote",{},[124,214,215],{},[168,216,217,218,222],{},"Évacuer la zone inondable autour de ",[219,220,221],"span",{},"cette commune"," maintenant via cell broadcast et app.",[119,224,226],{"className":225},[122],[124,227,228],{},"If the system is a typical chatbot with tools, the next step is terrifyingly easy: invent a population number, pick a vaguely related polygon, draft a confident message, and “send.” Under stress, a fluent answer feels like competence.",[119,230,232],{"className":231},[122],[124,233,234],{},"In public warning, fluency without control is a failure mode.",[119,236,238],{"className":237},[122],[124,239,240,241,244,245,248],{},"This article is about preparing an AI system for that world—not by chasing a bigger model, but by building the ",[128,242,243],{},"anatomy of control"," around it. The product is an operator-facing ",[128,246,247],{},"Mission Assistant",": natural-language crisis intent in, governed plan out, human confirmation before any irreversible alert, and a reconstructable audit trail afterward.",[119,250,252],{"className":251},[122],[124,253,254,255,139],{},"We did not set out to prove that AI “understands” a crisis. We set out to prove something harder: that you can put language models next to high-blast channels (cell broadcast, app push, location-based SMS in simulation) ",[128,256,257],{},"without ever letting the model press send",[259,260],"hover-figure",{"alt":261,"caption":262,"detail":263,"src":264,"tags":265,"title":266},"Figure 1 — Full-width operator home: MikeGPT chat, live architecture graph, and systems telemetry during an evacuate mission","Figure 1 — Operator surface is not a naked chatbot.","Three panes: MikeGPT session (intent/clarify), live architecture graph (EDGE→CORE→AI→TOOL→MUTATE), Systems telemetry (fleet / LLM / service tiles). Control is visible while the mission runs.","/blog/intent-evacuate/01-ops-shell.webp","chat, architecture-graph, systems, operator-ux","Ops shell · chat + graph + systems",[119,268,270],{"className":269},[122],[124,271,272],{},[168,273,274],{},"Figure 1 — The operator surface is not a naked chatbot. Chat (left), live architecture graph (center), and systems telemetry (right) make control visible while a mission runs.",[119,276,278,284],{"className":277},[182,183,184],[186,279,281],{"id":280},"_2-the-real-problem-is-not-more-ai",[128,282,283],{},"2. The real problem is not “more AI”",[124,285,286],{},[195,287,288],{"href":197},[128,289,200],{},[119,291,293],{"className":292},[122],[124,294,295],{},"In a fast-onset flood, the authority’s goal is simple: get people out of a dangerous zone, now, through the right channels.",[119,297,299],{"className":298},[122],[124,300,301,302,305],{},"What software usually offers instead is a pile of separate tools—map, population estimate, risk signals, alert composer, channel gateways, procedures. The mission is clear in the operator’s head; the product still demands expert knowledge of ",[168,303,304],{},"which"," algorithm, parameter, and channel to use. Under stress, people click the wrong zone, use stale density, pick the wrong mix of channels, or skip checks. Afterward, it is hard to prove who decided what, on which evidence.",[119,307,309],{"className":308},[122],[124,310,311,312,139],{},"So the gap is not “we need another dashboard” or “we need a cleverer model.” The gap is ",[128,313,314],{},"intent → safe, audited activation of existing location and alerting capabilities",[119,316,318],{"className":317},[122],[124,319,320],{},"Customers buy outcomes under crisis. Competitors can claim “AI.” What régalien (government / safety-critical) buyers actually require is:",[119,322,324],{"className":323},[122],[325,326,327,331,334,337],"ul",{},[328,329,330],"li",{},"Speed under stress",[328,332,333],{},"Traceability",[328,335,336],{},"Fail-safe behaviour (prefer refuse / confirm over a silent wrong action)",[328,338,339],{},"Integration with proven engines—not a greenfield rewrite of geo and alerting",[119,341,343],{"className":342},[122],[124,344,345],{},"That is the industrial bar. A demo chatbot does not clear it.",[119,347,349,355],{"className":348},[182,183,184],[186,350,352],{"id":351},"_3-anatomy-three-layers-of-responsibility",[128,353,354],{},"3. Anatomy: three layers of responsibility",[124,356,357],{},[195,358,359],{"href":197},[128,360,200],{},[119,362,364],{"className":363},[122],[124,365,366],{},"If this system has a spine, it is this split:",[368,369,370,383],"table",{},[371,372,373],"thead",{},[374,375,376,380],"tr",{},[377,378,379],"th",{},"Layer",[377,381,382],{},"Decides",[384,385,386,397,407],"tbody",{},[374,387,388,394],{},[389,390,391],"td",{},[128,392,393],{},"AI",[389,395,396],{},"How to ask, how to structure the mission, how to explain, how to draft",[374,398,399,404],{},[389,400,401],{},[128,402,403],{},"Algorithms + policy (code)",[389,405,406],{},"What is true enough, what is allowed, what must stop",[374,408,409,414],{},[389,410,411],{},[128,412,413],{},"Human",[389,415,416],{},"Whether to act—whether to send",[119,418,420],{"className":419},[122],[124,421,422],{},"In one sentence we use internally:",[119,424,426],{"className":425},[122],[211,427,428],{},[124,429,430],{},[128,431,432],{},"AI decides how to ask; algorithms decide what is true; humans decide whether to act.",[119,434,436],{"className":435},[122],[124,437,438],{},"That sentence is the product. Everything else is plumbing.",[440,441,443],"h3",{"id":442},"what-the-assistant-is-and-is-not","What the assistant is (and is not)",[119,445,447],{"className":446},[122],[124,448,449,450,453],{},"It ",[128,451,452],{},"is",":",[119,455,457],{"className":456},[122],[458,459,460,463,466,469,476,483],"ol",{},[328,461,462],{},"Accept an intent (plus an explicit zone from the UI when possible).",[328,464,465],{},"Clarify missing slots (zone, channels, urgency, authority).",[328,467,468],{},"Call underlying capabilities (population-in-zone, risk signals, channel eligibility, alert drafting).",[328,470,471,472,475],{},"Show a ",[128,473,474],{},"preview"," grounded in tool results (reach, freshness, confidence, risks).",[328,477,478,479,482],{},"Require ",[128,480,481],{},"human confirmation"," before any irreversible send.",[328,484,485,486,489],{},"Write a full ",[128,487,488],{},"audit trail"," suitable for after-action and régalien review.",[119,491,493],{"className":492},[122],[124,494,449,495,453],{},[128,496,497],{},"is not",[119,499,501],{"className":500},[122],[325,502,503,506,509,512],{},[328,504,505],{},"A new flood-prediction research model",[328,507,508],{},"An unconstrained LLM that “decides” to alert alone",[328,510,511],{},"Production cell-broadcast on day one of a POC (we simulate and stub dispatch; live networks need sandbox credentials)",[328,513,514,515,519],{},"A free-form agent with a tool belt that includes ",[516,517,518],"code",{},"dispatch_alert"," without a confirm gate",[119,521,523],{"className":522},[122],[124,524,525,526,529],{},"Models are ",[128,527,528],{},"replaceable proposers",". The gate stays.",[259,531],{"alt":532,"caption":533,"detail":534,"src":535,"tags":536,"title":537},"Figure 2 — Full-width architecture graph with EDGE CORE AI TOOL DATA INFRA lanes and yellow Confirm and Dispatch mutate gates","Figure 2 — Anatomy in the UI: mutate nodes stay gated.","Nodes grouped EDGE / CORE / AI / TOOL / MUTATE / DATA / INFRA. Faithfulness sits in CORE. Yellow Confirm and Dispatch are the only mutate gates — the LLM never owns them alone.","/blog/intent-evacuate/02-architecture-graph.webp","registry, faithfulness, confirm-gate, dispatch","Architecture · Confirm & Dispatch as mutate",[119,539,541],{"className":540},[122],[124,542,543],{},[168,544,545,546,549,550,553,554,557],{},"Figure 2 — Anatomy in the UI: EDGE → CORE / AI / TOOL → ",[128,547,548],{},"Confirm"," and ",[128,551,552],{},"Dispatch"," (mutate). ",[128,555,556],{},"Faithfulness"," sits in CORE—claims must match tool evidence before confirm is allowed. The model never owns the yellow nodes alone.",[119,559,561,567],{"className":560},[182,183,184],[186,562,564],{"id":563},"_4-the-loop-deterministic-code-around-the-llm",[128,565,566],{},"4. The loop: deterministic code around the LLM",[124,568,569],{},[195,570,571],{"href":197},[128,572,200],{},[119,574,576],{"className":575},[122],[124,577,578],{},"The orchestration loop is intentionally boring. Boring is a feature when the blast radius is a city.",[580,581,586],"pre",{"className":582,"code":584,"language":585},[583],"language-text","1. Receive intent (+ zone from UI)\n2. Clarify → structured mission object until schema-complete\n3. Plan → ordered capabilities; validate against a registry allowlist\n4. Execute read tools (population, risk, channels, RAG, draft)\n5. Policy evaluate → REFUSE | CLARIFY | PREVIEW | CONFIRM\n6. Show preview (claims grounded in tool call IDs + SOP citations)\n7. On confirm: verify confirmation_id + plan_hash + authority\n8. Only then execute mutate: dispatch_alert\n9. Append audit chain; return summary\n","text",[516,587,584],{"__ignoreMap":588},"",[440,590,592],{"id":591},"not-one-ai-model-five-roles-behind-one-gateway","Not one “AI model” — five roles behind one gateway",[119,594,596],{"className":595},[122],[124,597,598,599,602,603,606,607,610],{},"We do ",[128,600,601],{},"not"," ship a single mega-agent with every tool and every personality. We ship an ",[128,604,605],{},"LLM gateway"," that agents call with a ",[516,608,609],{},"role",". The UI never imports OpenRouter or Ollama SDKs.",[368,612,613,626],{},[371,614,615],{},[374,616,617,620,623],{},[377,618,619],{},"Role",[377,621,622],{},"Job",[377,624,625],{},"Why it is separate",[384,627,628,641,654,667,680],{},[374,629,630,635,638],{},[389,631,632],{},[516,633,634],{},"clarify",[389,636,637],{},"Ask for missing slots (zone, channels, …)",[389,639,640],{},"Cheap, structured; can be a small/static path",[374,642,643,648,651],{},[389,644,645],{},[516,646,647],{},"plan",[389,649,650],{},"Propose ordered capabilities from the registry",[389,652,653],{},"Must emit JSON the orchestrator can validate",[374,655,656,661,664],{},[389,657,658],{},[516,659,660],{},"draft",[389,662,663],{},"Write FR public-warning copy per channel",[389,665,666],{},"Tone + length limits; editable in Preview",[374,668,669,674,677],{},[389,670,671],{},[516,672,673],{},"judge",[389,675,676],{},"Faithfulness / draft critique when sampled",[389,678,679],{},"Adversarial pair to the drafter",[374,681,682,687,690],{},[389,683,684],{},[516,685,686],{},"coach",[389,688,689],{},"Operator-facing guidance (Request Agent)",[389,691,692],{},"Soft coaching; never mutate",[119,694,696],{"className":695},[122],[124,697,698,699,702],{},"They propose structured outputs. ",[128,700,701],{},"Code"," validates plans, runs tools, evaluates policy, and binds confirmation. Policy and confirm are never delegated to the model.",[259,704],{"alt":705,"caption":706,"detail":707,"src":708,"tags":709,"title":710},"Figure 3 — Full-width Settings LLM gateway: Ollama or OpenRouter with per-role models clarify plan draft judge coach","Figure 3 — Models are swappable; roles are the architecture.","Agents call roles clarify|plan|draft|judge|coach through the gateway. UI never talks to Ollama/OpenRouter SDKs. Same weights OK for POC; per-role models are an ops dial.","/blog/intent-evacuate/08-settings-llm.webp","llm-gateway, ollama, openrouter, roles","LLM gateway · per-role models",[119,712,714],{"className":713},[122],[124,715,716],{},[168,717,718,719,722,723,726,727,730],{},"Figure 3 — Gateway + per-role model IDs. POC often points every role at ",[516,720,721],{},"llama3.2"," (Ollama) or ",[516,724,725],{},"gpt-4o-mini"," (OpenRouter). That is fine—the ",[128,728,729],{},"roles"," are the architecture; the weights are a dial.",[119,732,734],{"className":733},[122],[124,735,736],{},[128,737,738],{},"Entire model vs more models?",[119,740,742],{"className":741},[122],[325,743,744,754,780],{},[328,745,746,749,750,753],{},[128,747,748],{},"Entire / same weights for all roles"," — valid for a POC and for on-prem demos: one Ollama tag, five roles, same ",[516,751,752],{},"model_id",". Cost and ops stay simple. Safety still comes from the orchestrator, not from model diversity.",[328,755,756,759,760,762,763,765,766,762,768,770,771,773,774,549,777,139],{},[128,757,758],{},"More models (per role)"," — useful when you scale: a fast small model for ",[516,761,634],{}," / ",[516,764,686],{},", a stronger model for ",[516,767,647],{},[516,769,660],{},", a separate ",[516,772,673],{}," so the drafter does not grade its own homework. Settings already store ",[516,775,776],{},"ollama_models[role]",[516,778,779],{},"openrouter_models[role]",[328,781,782,785,786,788],{},[128,783,784],{},"What we never do"," — give any role a free tool belt that includes ",[516,787,518],{},". Roles propose; the registry + confirm gate execute.",[119,790,792],{"className":791},[122],[124,793,794],{},"Plan validation rejects the obvious disasters: unknown capabilities, mutate steps before confirm, zone or channel edits after preview that would silently reuse an old confirmation. Edits re-hash the plan; prior confirmation dies.",[119,796,798,804],{"className":797},[182,183,184],[186,799,801],{"id":800},"_5-the-decision-ladder-designed-friction",[128,802,803],{},"5. The decision ladder: designed friction",[124,805,806],{},[195,807,808],{"href":197},[128,809,200],{},[119,811,813],{"className":812},[122],[124,814,815],{},"Every planned action resolves to exactly one outcome, evaluated in a fixed order:",[119,817,819],{"className":818},[122],[458,820,821,827,833,839,845],{},[328,822,823,826],{},[128,824,825],{},"REFUSE"," — cannot proceed (policy violation, stale evidence, injection, partial failure mid-plan)",[328,828,829,832],{},[128,830,831],{},"CLARIFY"," — missing or ambiguous slot (especially zone)",[328,834,835,838],{},[128,836,837],{},"PREVIEW"," — read-only plan shown; numbers must come from tools",[328,840,841,844],{},[128,842,843],{},"CONFIRM"," — mutate-class action; human confirmation at the required authority",[328,846,847,850,851,854,855],{},[128,848,849],{},"EXECUTE"," — only with a valid, unexpired ",[516,852,853],{},"confirmation_id"," bound to the exact ",[516,856,857],{},"plan_hash",[119,859,861],{"className":860},[122],[124,862,863,864,867],{},"Production readiness is not “the model is accurate.” It is whether ",[128,865,866],{},"mutate actions are impossible"," without that binding.",[440,869,871],{"id":870},"policy-as-data-not-scattered-ifs","Policy as data, not scattered ifs",[119,873,875],{"className":874},[122],[124,876,877,878,131,881,884],{},"Rules live in versioned packs (for France: ",[516,879,880],{},"fr-default",[516,882,883],{},"fr-strict",")—freshness windows, channel allowlists, authority escalation. Example shape:",[119,886,888],{"className":887},[122],[325,889,890,893,896,899,905],{},[328,891,892],{},"Refuse send if evidence is older than the pack allows (e.g. 600s / 300s).",[328,894,895],{},"Require an explicit polygon or admin code—no silent “Paris” guess.",[328,897,898],{},"Mutate always requires confirm; confirmation TTL (e.g. 300s); plan hash must match.",[328,900,901,902,139],{},"Low confidence + high-blast channel (cell broadcast) → escalate to ",[128,903,904],{},"supervisor",[328,906,907],{},"Hard refuse on injection patterns (“ignore policy”, “skip confirm”, “send now without…”).",[119,909,911],{"className":910},[122],[124,912,913],{},"Customer or préfecture packs can override defaults later. The engine around the LLM stays deterministic.",[440,915,917],{"id":916},"refusals-worth-showing-the-public","Refusals worth showing the public",[119,919,921],{"className":920},[122],[124,922,923],{},"A wide audience learns more from a refusal than from a successful send:",[368,925,926,939],{},[371,927,928],{},[374,929,930,933,936],{},[377,931,932],{},"Trigger",[377,934,935],{},"Outcome",[377,937,938],{},"Operator sees",[384,940,941,951,964,975,986,997],{},[374,942,943,946,948],{},[389,944,945],{},"Stale population / risk evidence",[389,947,825],{},[389,949,950],{},"Which tool, how old, invite to refresh",[374,952,953,956,958],{},[389,954,955],{},"Zone missing or multiple matches",[389,957,831],{},[389,959,960,961],{},"Candidates or “draw the zone” — ",[128,962,963],{},"won’t auto-pick",[374,965,966,969,972],{},[389,967,968],{},"Low confidence + cell broadcast",[389,970,971],{},"CONFIRM at supervisor",[389,973,974],{},"Why escalated",[374,976,977,980,983],{},[389,978,979],{},"Prompt injection / out-of-policy ask",[389,981,982],{},"REFUSE + audit",[389,984,985],{},"No partial execution",[374,987,988,991,994],{},[389,989,990],{},"Zone conflict with another active mission",[389,992,993],{},"CONFIRM / escalate",[389,995,996],{},"Conflict shown; nothing on the wire",[374,998,999,1002,1005],{},[389,1000,1001],{},"Partial tool failure mid-plan",[389,1003,1004],{},"REFUSE further mutate",[389,1006,1007],{},"Which step failed",[119,1009,1011],{"className":1010},[122],[124,1012,1013],{},"Prefer refuse or confirm over a silent wrong action. That is the culture encoded in software.",[259,1015],{"alt":1016,"caption":1017,"detail":1018,"src":1019,"tags":1020,"title":1021},"Figure 4 — Full-width chat clarify for Evacuate south of Paris: ambiguous gazetteer matches and bind-one fixture chips on an inline map","Figure 4 — Best demo: ambiguity forces a human bind.","Intent “Evacuate south of Paris” → gazetteer returns multiple fixtures. MikeGPT will not auto-pick a polygon. Operator binds a code or clicks the map. Prefer clarify over silent geometry.","/blog/intent-evacuate/03-clarify-ambiguous-zone.webp","gazetteer, clarify, zone-gate, refuse-auto-pick","Clarify · ambiguous place refuse",[119,1023,1025],{"className":1024},[122],[124,1026,1027],{},[168,1028,1029,1030,1033],{},"Figure 4 — Best demo in the product: place name is ambiguous, gazetteer returns fixtures, MikeGPT says bind one—",[128,1031,1032],{},"or click the map",". No silent polygon invention.",[119,1035,1037,1043],{"className":1036},[182,183,184],[186,1038,1040],{"id":1039},"_6-grounding-preview-is-a-contract-not-a-vibe",[128,1041,1042],{},"6. Grounding: preview is a contract, not a vibe",[124,1044,1045],{},[195,1046,1047],{"href":197},[128,1048,200],{},[119,1050,1052],{"className":1051},[122],[124,1053,1054,1055,762,1058,762,1061,1064],{},"Every number in the preview must come from a tool call. We render freshness and confidence next to estimates. We show a source badge (",[516,1056,1057],{},"stub",[516,1059,1060],{},"sim",[516,1062,1063],{},"real",")—never hide the ground truth of the backend. The draft message is editable; edits invalidate prior confirmation.",[119,1066,1068],{"className":1067},[122],[124,1069,1070,1072],{},[128,1071,556],{}," is a first-class CORE check: if a UI claim does not match tool JSON, confirm must not proceed. SOP / doctrine citations from RAG ground draft language—not invented procedure. Conflict with another active mission on the same zone must be visible, not papered over.",[119,1074,1076],{"className":1075},[122],[124,1077,1078],{},"This is how you keep the assistant useful without letting it invent a blast radius.",[119,1080,1082],{"className":1081},[122],[124,1083,1084],{},"Zone binding is part of that contract. Geometry is never invented from a place name—operators bind an admin fixture or paste GeoJSON; ambiguous entries stay blocked.",[259,1086],{"alt":1087,"caption":1088,"detail":1089,"src":1090,"tags":1091,"title":1092},"Figure 5 — Full-width Map Zone gate with Paris FR-75-12 bound on the satellite map and ambiguous fixtures blocked","Figure 5 — Bind exactly one target before tools run.","Population, risk, and channels stay offline until a zone is bound. Geometry is never invented from a place name. Ambiguous fixtures stay blocked. Active bind: admin_code (e.g. FR-75-12).","/blog/intent-evacuate/04-map-zone-gate.webp","zone-gate, admin-code, geojson, grounding","Map · zone gate bound",[119,1094,1096],{"className":1095},[122],[124,1097,1098],{},[168,1099,1100],{},"Figure 5 — The zone gate: bind exactly one target. Ambiguous codes cannot be auto-picked. Population, risk, and channels stay offline until a zone is bound.",[119,1102,1104,1110],{"className":1103},[182,183,184],[186,1105,1107],{"id":1106},"_7-confirmation-the-last-gate-before-the-blast",[128,1108,1109],{},"7. Confirmation: the last gate before the blast",[124,1111,1112],{},[195,1113,1114],{"href":197},[128,1115,200],{},[119,1117,1119],{"className":1118},[122],[124,1120,1121],{},"A confirmation object is not a checkbox. It is a cryptographic-ish commitment to a specific plan:",[119,1123,1125],{"className":1124},[122],[325,1126,1127,1131,1136,1141,1144,1147],{},[328,1128,1129],{},[516,1130,853],{},[328,1132,1133],{},[516,1134,1135],{},"mission_id",[328,1137,1138,1140],{},[516,1139,857],{}," (canonical hash of mission steps, channels, zone)",[328,1142,1143],{},"actor + required authority",[328,1145,1146],{},"expiry",[328,1148,1149],{},"which preview evidence was shown",[119,1151,1153],{"className":1152},[122],[124,1154,1155,1157],{},[516,1156,518],{}," must verify: id exists, not expired, hash matches current plan, authority is sufficient. Any mismatch → denied. No code path reaches a mutate adapter without that check.",[119,1159,1161],{"className":1160},[122],[124,1162,1163],{},"If you only remember one production invariant from this article, remember that one.",[119,1165,1167,1173],{"className":1166},[182,183,184],[186,1168,1170],{"id":1169},"_8-sealed-after-action-the-mission-summary",[128,1171,1172],{},"8. Sealed after-action: the mission summary",[124,1174,1175],{},[195,1176,1177],{"href":197},[128,1178,200],{},[119,1180,1182],{"className":1181},[122],[124,1183,1184,1185,1188],{},"Dispatch is not the end of the story. The ",[128,1186,1187],{},"Summary"," surface is a sealed after-action record: tabs for map, process diagram, channels & output, and audit. Nothing here sends again.",[440,1190,1192],{"id":1191},"process-lanes-side-edge-capability-data-mutate","Process lanes (SIDE / EDGE / CAPABILITY / DATA / MUTATE)",[119,1194,1196],{"className":1195},[122],[124,1197,1198,1199,1202,1203,1206,1207,1210],{},"The process diagram is a swimlane over time—not a marketing architecture poster. Continuous ",[128,1200,1201],{},"SIDE"," lanes (Mission API, Audit, Policy) run across the mission; ",[128,1204,1205],{},"CAPABILITY"," tools fire when needed; ",[128,1208,1209],{},"MUTATE"," (Confirm, Dispatch) appears only at the end. That visual is the anatomy of control in one glance.",[259,1212],{"alt":1213,"caption":1214,"detail":1215,"src":1216,"tags":1217,"title":1218},"Figure 6 — Full-width sealed summary process swimlanes from intent through policy tools confirm and dispatch","Figure 6 — Continuous policy/audit; late mutate steps.","Sealed after-action process diagram. SIDE lanes (Mission API, Audit, Policy) run continuously. CAPABILITY tools fire on demand. MUTATE Confirm/Dispatch appear late. Nothing on this page sends again.","/blog/intent-evacuate/05-summary-process.webp","process-diagram, sealed-record, side-lanes, mutate","Summary · process swimlanes",[119,1220,1222],{"className":1221},[122],[124,1223,1224],{},[168,1225,1226],{},"Figure 6 — Sealed process diagram. Policy and audit are continuous; Confirm and Dispatch are late mutate steps. Ambiguous places still show up as “I won’t auto-pick” earlier in the chain.",[440,1228,1230],{"id":1229},"channels-hashes-and-proposal-only-follow-ups","Channels, hashes, and proposal-only follow-ups",[119,1232,1234],{"className":1233},[122],[124,1235,1236],{},"After a successful (stub/sim) send, Channels & output shows:",[119,1238,1240],{"className":1239},[122],[325,1241,1242,1251,1254,1257],{},[328,1243,1244,1245,1248,1249],{},"Who confirmed (",[516,1246,1247],{},"YOU · OPERATOR",") and which ",[516,1250,853],{},[328,1252,1253],{},"What System dispatched (channels + delivery ids)",[328,1255,1256],{},"Immutable audit count for régalien review",[328,1258,1259,1260,131,1262,131,1264,131,1266],{},"Binding IDs: ",[516,1261,857],{},[516,1263,853],{},[516,1265,1135],{},[516,1267,1268],{},"delivery_ids",[119,1270,1272],{"className":1271},[122],[124,1273,1274,1275,1278,1279,1282],{},"And critically: ",[128,1276,1277],{},"optional next steps"," (monitor remaining population, widen zone) are marked ",[128,1280,1281],{},"PROPOSAL ONLY","—not started until a human confirms a new mission. The system may think ahead; it does not auto-chain sends.",[259,1284],{"alt":1285,"caption":1286,"detail":1287,"src":1288,"tags":1289,"title":1290},"Figure 7 — Full-width Channels and output with plan_hash confirmation id delivery ids and proposal-only follow-ups","Figure 7 — Paper trail + proposal-only next steps.","Operator confirm id, dispatch delivery_ids, plan_hash, mission_id. Follow-ups (monitor remaining, widen zone) are PROPOSAL ONLY — never auto-chained sends.","/blog/intent-evacuate/06-summary-channels.webp","plan-hash, confirmation-id, delivery-ids, proposals","Summary · channels & binding IDs",[119,1292,1294],{"className":1293},[122],[124,1295,1296],{},[168,1297,1298],{},"Figure 7 — Paper trail after dispatch: hashes and delivery ids, plus follow-ups that stay proposals until someone starts a new confirm.",[119,1300,1302,1308],{"className":1301},[182,183,184],[186,1303,1305],{"id":1304},"_9-audit-reconstructability-not-a-pretty-dashboard",[128,1306,1307],{},"9. Audit: reconstructability, not a pretty dashboard",[124,1309,1310],{},[195,1311,1312],{"href":197},[128,1313,200],{},[119,1315,1317],{"className":1316},[122],[124,1318,1319,1320],{},"After a crisis, someone will ask: ",[168,1321,1322],{},"who approved what, on which evidence, when?",[119,1324,1326],{"className":1325},[122],[124,1327,1328,1329,1332,1333,1335],{},"Observability for this product is ",[128,1330,1331],{},"reconstructability",". We treat audit as an append-only event chain correlated by ",[516,1334,1135],{},": intent received and parsed, clarifications, plan proposed, every tool call and return, preview shown, policy evaluated, confirm requested/granted/denied, dispatch sent, refuse issued, summary.",[119,1337,1339],{"className":1338},[122],[124,1340,1341,1342,1344,1347,1349,1350,1352,1353,139],{},"For send-class actions we aim at a completeness invariant: you can walk",[116,1343],{},[516,1345,1346],{},"intent → plan → tool evidence → preview → policy(CONFIRM) → confirm.granted → dispatch.sent",[116,1348],{},"\nwith matching ",[516,1351,857],{},". Incomplete chains are not “ops debt”—they are a ",[128,1354,1355],{},"product defect",[119,1357,1359],{"className":1358},[122],[124,1360,1361,1362,1365],{},"The Summary UI makes that checklist visible: Plan · Tools · Preview · Confirm · Dispatch all checked for a send-class mission—including policy violations that happened mid-flight (e.g. ",[516,1363,1364],{},"ZONE_CONFLICT",") before a supervisor/operator path cleared the send.",[259,1367],{"alt":1368,"caption":1369,"detail":1370,"src":1371,"tags":1372,"title":1373},"Figure 8 — Full-width Audit trail send-class completeness checklist and append-only events including ZONE_CONFLICT","Figure 8 — Reconstruct who decided what, on which evidence.","Append-only proof log. Checklist: Plan · Tools · Preview · Confirm · Dispatch. Confirm/Dispatch labeled OPERATOR. A red policy.violation (e.g. ZONE_CONFLICT) can still appear mid-chain — friction was real.","/blog/intent-evacuate/07-summary-audit.webp","audit-completeness, policy-violation, operator, append-only","Summary · send-class audit chain",[119,1375,1377],{"className":1376},[122],[124,1378,1379],{},[168,1380,1381,1382,1385],{},"Figure 8 — Append-only proof log. Confirm and Dispatch are labeled OPERATOR. A red ",[516,1383,1384],{},"policy.violation"," can still appear in a completed chain—evidence that friction was real, not skipped.",[119,1387,1389],{"className":1388},[122],[124,1390,1391],{},"Measure audit completeness the way you measure uptime.",[119,1393,1395,1401],{"className":1394},[182,183,184],[186,1396,1398],{"id":1397},"_10-data-models-contracts-first-tables-second",[128,1399,1400],{},"10. Data models: contracts first, tables second",[124,1402,1403],{},[195,1404,1405],{"href":197},[128,1406,200],{},[119,1408,1410],{"className":1409},[122],[124,1411,1412,1413,1416],{},"In mission-critical AI, the dangerous mistake is treating the chat transcript as the system of record. We treat ",[128,1414,1415],{},"typed contracts"," as truth and Postgres as the durable proof.",[119,1418,1420],{"className":1419},[122],[124,1421,1422],{},"There are three layers of “model” that matter—and only one of them is an LLM:",[368,1424,1425,1437],{},[371,1426,1427],{},[374,1428,1429,1431,1434],{},[377,1430,379],{},[377,1432,1433],{},"What it is",[377,1435,1436],{},"Critical rule",[384,1438,1439,1452,1465],{},[374,1440,1441,1446,1449],{},[389,1442,1443],{},[128,1444,1445],{},"LLM roles",[389,1447,1448],{},"Generative proposers behind the gateway",[389,1450,1451],{},"Never the source of population numbers or send authority",[374,1453,1454,1459,1462],{},[389,1455,1456],{},[128,1457,1458],{},"Runtime contracts",[389,1460,1461],{},"JSON Schema / Zod: mission object, capabilities, confirm, audit events",[389,1463,1464],{},"Invalid shape → clarify / refuse, never dispatch",[374,1466,1467,1472,1475],{},[389,1468,1469],{},[128,1470,1471],{},"Persistence",[389,1473,1474],{},"Postgres tables + fixture files",[389,1476,1477,1478],{},"Append-only audit; confirmations bind ",[516,1479,857],{},[440,1481,1483],{"id":1482},"_1-mission-object-the-structured-intent","1. Mission object (the structured intent)",[119,1485,1487],{"className":1486},[122],[124,1488,1489,1490,1493],{},"Natural language is parsed into an ",[128,1491,1492],{},"EvacuateMissionObject"," before tools run. Locked fields for the POC:",[119,1495,1497],{"className":1496},[122],[325,1498,1499,1508,1516,1534,1550,1561],{},[328,1500,1501,1504,1505],{},[516,1502,1503],{},"action",": always ",[516,1506,1507],{},"evacuate",[328,1509,1510,1504,1513],{},[516,1511,1512],{},"locale",[516,1514,1515],{},"fr",[328,1517,1518,1521,1522,1525,1526,1529,1530,1533],{},[516,1519,1520],{},"zone",": ",[516,1523,1524],{},"admin_code"," ",[128,1527,1528],{},"XOR"," GeoJSON ",[516,1531,1532],{},"polygon"," (never both ambiguous, never neither)",[328,1535,1536,1539,1540,1543,1544,1543,1547],{},[516,1537,1538],{},"channels",": non-empty subset of ",[516,1541,1542],{},"cell_broadcast"," | ",[516,1545,1546],{},"app_push",[516,1548,1549],{},"lb_sms",[328,1551,1552,1521,1555,1543,1558],{},[516,1553,1554],{},"urgency",[516,1556,1557],{},"immediate",[516,1559,1560],{},"planned",[328,1562,1563,1564,131,1567,131,1570],{},"optional ",[516,1565,1566],{},"authority_hint",[516,1568,1569],{},"time_window",[516,1571,1572],{},"notes",[119,1574,1576],{"className":1575},[122],[124,1577,1578,1581],{},[128,1579,1580],{},"Critical:"," if the object is incomplete, the loop stays in clarify. The LLM does not get to invent a zone to “be helpful.”",[440,1583,1585],{"id":1584},"_2-capability-contracts-tools-with-side-effects","2. Capability contracts (tools with side effects)",[119,1587,1589],{"className":1588},[122],[124,1590,1591,1592,1597,1598,131,1601,1604],{},"Every tool in the registry declares a versioned contract: name, version, ",[128,1593,1594],{},[516,1595,1596],{},"side_effect: read | mutate",", input/output schemas, typed errors, optional SLA (",[516,1599,1600],{},"p95_ms",[516,1602,1603],{},"max_data_age_s",").",[368,1606,1607,1620],{},[371,1608,1609],{},[374,1610,1611,1614,1617],{},[377,1612,1613],{},"Capability",[377,1615,1616],{},"side_effect",[377,1618,1619],{},"Why it exists",[384,1621,1622,1649,1661,1673,1685,1697,1709],{},[374,1623,1624,1629,1632],{},[389,1625,1626],{},[516,1627,1628],{},"population_in_zone",[389,1630,1631],{},"read",[389,1633,1634,1635,1638,1639,131,1642,131,1645,1648],{},"CAMARA-shaped estimate + ",[516,1636,1637],{},"evidence"," (",[516,1640,1641],{},"data_age_s",[516,1643,1644],{},"confidence",[516,1646,1647],{},"source",")",[374,1650,1651,1656,1658],{},[389,1652,1653],{},[516,1654,1655],{},"risk_score",[389,1657,1631],{},[389,1659,1660],{},"Risk signal for the bound zone",[374,1662,1663,1668,1670],{},[389,1664,1665],{},[516,1666,1667],{},"channel_eligibility",[389,1669,1631],{},[389,1671,1672],{},"Which FR-Alert-style channels can fire",[374,1674,1675,1680,1682],{},[389,1676,1677],{},[516,1678,1679],{},"rag_retrieve",[389,1681,1631],{},[389,1683,1684],{},"SOP / doctrine citations for grounding",[374,1686,1687,1692,1694],{},[389,1688,1689],{},[516,1690,1691],{},"draft_alert",[389,1693,1631],{},[389,1695,1696],{},"Channel drafts (still not a send)",[374,1698,1699,1704,1706],{},[389,1700,1701],{},[516,1702,1703],{},"mobility_remaining",[389,1705,1631],{},[389,1707,1708],{},"Optional mobility / remaining population",[374,1710,1711,1715,1720],{},[389,1712,1713],{},[516,1714,518],{},[389,1716,1717],{},[128,1718,1719],{},"mutate",[389,1721,1722,1723,131,1725,131,1727,1729],{},"Requires ",[516,1724,1135],{},[516,1726,857],{},[516,1728,853],{},", channels",[119,1731,1733],{"className":1732},[122],[124,1734,1735,1738,1739,1741],{},[128,1736,1737],{},"Critical on read tools:"," evidence freshness and confidence feed policy. Stale ",[516,1740,1641],{}," → refuse. Low confidence + cell broadcast → supervisor.",[119,1743,1745],{"className":1744},[122],[124,1746,1747,1525,1750,1752,1753,1756],{},[128,1748,1749],{},"Critical on mutate:",[516,1751,518],{}," input without a valid confirmation is ",[516,1754,1755],{},"POLICY_DENIED",". There is no “almost send.”",[440,1758,1760],{"id":1759},"_3-plan-hash-the-binding-between-preview-and-send","3. Plan hash (the binding between preview and send)",[119,1762,1764],{"className":1763},[122],[124,1765,1766,139],{},[516,1767,1768],{},"plan_hash = sha256(canonical JSON of { mission_id, steps, channels, zone })",[119,1770,1772],{"className":1771},[122],[124,1773,1774,1775,1778],{},"Canonical means sorted keys, stable structure. Any edit to zone, channels, or steps after preview produces a ",[128,1776,1777],{},"new"," hash and invalidates the prior confirmation. That is how we stop “confirm plan A, silently dispatch plan B.”",[440,1780,1782],{"id":1781},"_4-confirmation-and-dispatch-records","4. Confirmation and dispatch records",[368,1784,1785,1795],{},[371,1786,1787],{},[374,1788,1789,1792],{},[377,1790,1791],{},"Field that must be right",[377,1793,1794],{},"Why",[384,1796,1797,1806,1815,1834,1844,1861],{},[374,1798,1799,1803],{},[389,1800,1801],{},[516,1802,853],{},[389,1804,1805],{},"Opaque grant ticket",[374,1807,1808,1812],{},[389,1809,1810],{},[516,1811,857],{},[389,1813,1814],{},"Must equal current plan at dispatch",[374,1816,1817,1825],{},[389,1818,1819,762,1822],{},[516,1820,1821],{},"actor_role",[516,1823,1824],{},"required_authority",[389,1826,1827,1830,1831,1833],{},[516,1828,1829],{},"operator"," vs ",[516,1832,904],{}," escalation",[374,1835,1836,1841],{},[389,1837,1838],{},[516,1839,1840],{},"expires_at",[389,1842,1843],{},"TTL (e.g. 300s)—expired grant is dead",[374,1845,1846,1851],{},[389,1847,1848],{},[516,1849,1850],{},"status",[389,1852,1853,1856,1857,1860],{},[516,1854,1855],{},"granted"," → ",[516,1858,1859],{},"consumed"," on successful dispatch",[374,1862,1863,1867],{},[389,1864,1865],{},[516,1866,1268],{},[389,1868,1869],{},"Stub/sim fake ids today; real PWS ids later—always auditable",[440,1871,1873],{"id":1872},"_5-audit-event-envelope","5. Audit event envelope",[119,1875,1877],{"className":1876},[122],[124,1878,1879,1880,131,1883,1885,1886,131,1889,131,1892,131,1895,131,1898,139],{},"Append-only rows: ",[516,1881,1882],{},"event_id",[516,1884,1135],{},", monotonic ",[516,1887,1888],{},"seq",[516,1890,1891],{},"type",[516,1893,1894],{},"actor",[516,1896,1897],{},"policy_pack",[516,1899,1900],{},"payload",[119,1902,1904],{"className":1903},[122],[124,1905,1906,1908],{},[128,1907,1580],{}," payloads must not store secrets or raw injection text in the clear (hash patterns instead). Send-class missions must reconstruct the completeness chain from these rows alone.",[440,1910,1912],{"id":1911},"_6-postgres-entities-durable-anatomy","6. Postgres entities (durable anatomy)",[580,1914,1917],{"className":1915,"code":1916,"language":585,"meta":588},[583],"Mission 1──* Plan\nMission 1──* ToolCall 1──1 ToolResult\nMission 1──* Confirmation 1──0..1 Dispatch\nMission 1──* AuditEvent\nSopChunk (RAG corpus) · SimRun · MetricsSample (ops / game-day)\n",[516,1918,1916],{"__ignoreMap":588},[368,1920,1921,1934],{},[371,1922,1923],{},[374,1924,1925,1928,1931],{},[377,1926,1927],{},"Table",[377,1929,1930],{},"Holds",[377,1932,1933],{},"Critical invariant",[384,1935,1936,1951,1966,1985,1998,2011,2024,2037],{},[374,1937,1938,1943,1946],{},[389,1939,1940],{},[516,1941,1942],{},"missions",[389,1944,1945],{},"zone, channels, policy_pack, backend, status",[389,1947,1948,1949],{},"Zone present; channels allowlisted; locale ",[516,1950,1515],{},[374,1952,1953,1958,1963],{},[389,1954,1955],{},[516,1956,1957],{},"plans",[389,1959,1960,1962],{},[516,1961,857],{},", steps JSON",[389,1964,1965],{},"Steps only name registry capabilities",[374,1967,1968,1976,1982],{},[389,1969,1970,762,1973],{},[516,1971,1972],{},"tool_calls",[516,1974,1975],{},"tool_results",[389,1977,1978,1979,1981],{},"capability, ",[516,1980,1616],{},", evidence",[389,1983,1984],{},"Preview numbers ⊆ returned tool JSON",[374,1986,1987,1992,1995],{},[389,1988,1989],{},[516,1990,1991],{},"confirmations",[389,1993,1994],{},"hash + authority + TTL",[389,1996,1997],{},"Dispatch only if granted, unexpired, hash match",[374,1999,2000,2005,2008],{},[389,2001,2002],{},[516,2003,2004],{},"dispatches",[389,2006,2007],{},"confirmation_id, delivery_ids",[389,2009,2010],{},"No row without a consumed confirmation",[374,2012,2013,2018,2021],{},[389,2014,2015],{},[516,2016,2017],{},"audit_events",[389,2019,2020],{},"typed event stream",[389,2022,2023],{},"Append-only; completeness on send-class",[374,2025,2026,2031,2034],{},[389,2027,2028],{},[516,2029,2030],{},"sop_chunks",[389,2032,2033],{},"FR SOP text (+ embeddings later)",[389,2035,2036],{},"Citations are real ids, not free prose",[374,2038,2039,2047,2050],{},[389,2040,2041,762,2044],{},[516,2042,2043],{},"sim_runs",[516,2045,2046],{},"metrics_samples",[389,2048,2049],{},"Game-day + KPIs",[389,2051,2052,2053],{},"Sim never silently labeled as ",[516,2054,1063],{},[119,2056,2058],{"className":2057},[122],[124,2059,2060,2061,2064],{},"Population fixtures live primarily as ",[128,2062,2063],{},"files"," under adapters (admin_code → CAMARA-shaped payload); the DB mirrors mission life, not the entire geo catalog.",[119,2066,2070],{"className":2067},[2068,2069],"my-8","w-full",[580,2071,2075],{"className":2072,"code":2073,"language":2074,"meta":588,"style":588},"language-mermaid shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","erDiagram\n  missions ||--o{ plans : has\n  missions ||--o{ tool_calls : has\n  missions ||--o{ confirmations : has\n  missions ||--o{ dispatches : has\n  missions ||--o{ audit_events : has\n  tool_calls ||--|| tool_results : returns\n  confirmations ||--o| dispatches : grants\n\n  missions {\n    text id PK\n    text locale\n    text zone_admin_code\n    jsonb zone_polygon\n    jsonb channels\n    text policy_pack\n    text backend\n    text status\n  }\n  plans {\n    uuid id PK\n    text mission_id FK\n    text plan_hash\n    jsonb steps\n  }\n  tool_calls {\n    text tool_call_id PK\n    text mission_id FK\n    text capability\n    text side_effect\n    text backend\n  }\n  tool_results {\n    text tool_call_id PK\n    jsonb evidence\n    text status\n    int latency_ms\n  }\n  confirmations {\n    text id PK\n    text mission_id FK\n    text plan_hash\n    text actor_role\n    timestamptz expires_at\n    text status\n  }\n  dispatches {\n    uuid id PK\n    text mission_id FK\n    text confirmation_id FK\n    jsonb delivery_ids\n    jsonb channels\n  }\n  audit_events {\n    text event_id PK\n    text mission_id FK\n    int seq\n    text type\n    jsonb payload\n  }\n","mermaid",[516,2076,2077,2084,2090,2096,2102,2108,2114,2120,2126,2133,2139,2145,2151,2157,2163,2169,2175,2181,2187,2193,2199,2205,2211,2217,2223,2228,2234,2240,2245,2251,2257,2262,2267,2273,2278,2284,2289,2295,2300,2306,2311,2316,2321,2327,2333,2338,2343,2349,2354,2359,2365,2371,2376,2381,2387,2393,2398,2404,2410,2416],{"__ignoreMap":588},[219,2078,2081],{"class":2079,"line":2080},"line",1,[219,2082,2083],{},"erDiagram\n",[219,2085,2087],{"class":2079,"line":2086},2,[219,2088,2089],{},"  missions ||--o{ plans : has\n",[219,2091,2093],{"class":2079,"line":2092},3,[219,2094,2095],{},"  missions ||--o{ tool_calls : has\n",[219,2097,2099],{"class":2079,"line":2098},4,[219,2100,2101],{},"  missions ||--o{ confirmations : has\n",[219,2103,2105],{"class":2079,"line":2104},5,[219,2106,2107],{},"  missions ||--o{ dispatches : has\n",[219,2109,2111],{"class":2079,"line":2110},6,[219,2112,2113],{},"  missions ||--o{ audit_events : has\n",[219,2115,2117],{"class":2079,"line":2116},7,[219,2118,2119],{},"  tool_calls ||--|| tool_results : returns\n",[219,2121,2123],{"class":2079,"line":2122},8,[219,2124,2125],{},"  confirmations ||--o| dispatches : grants\n",[219,2127,2129],{"class":2079,"line":2128},9,[219,2130,2132],{"emptyLinePlaceholder":2131},true,"\n",[219,2134,2136],{"class":2079,"line":2135},10,[219,2137,2138],{},"  missions {\n",[219,2140,2142],{"class":2079,"line":2141},11,[219,2143,2144],{},"    text id PK\n",[219,2146,2148],{"class":2079,"line":2147},12,[219,2149,2150],{},"    text locale\n",[219,2152,2154],{"class":2079,"line":2153},13,[219,2155,2156],{},"    text zone_admin_code\n",[219,2158,2160],{"class":2079,"line":2159},14,[219,2161,2162],{},"    jsonb zone_polygon\n",[219,2164,2166],{"class":2079,"line":2165},15,[219,2167,2168],{},"    jsonb channels\n",[219,2170,2172],{"class":2079,"line":2171},16,[219,2173,2174],{},"    text policy_pack\n",[219,2176,2178],{"class":2079,"line":2177},17,[219,2179,2180],{},"    text backend\n",[219,2182,2184],{"class":2079,"line":2183},18,[219,2185,2186],{},"    text status\n",[219,2188,2190],{"class":2079,"line":2189},19,[219,2191,2192],{},"  }\n",[219,2194,2196],{"class":2079,"line":2195},20,[219,2197,2198],{},"  plans {\n",[219,2200,2202],{"class":2079,"line":2201},21,[219,2203,2204],{},"    uuid id PK\n",[219,2206,2208],{"class":2079,"line":2207},22,[219,2209,2210],{},"    text mission_id FK\n",[219,2212,2214],{"class":2079,"line":2213},23,[219,2215,2216],{},"    text plan_hash\n",[219,2218,2220],{"class":2079,"line":2219},24,[219,2221,2222],{},"    jsonb steps\n",[219,2224,2226],{"class":2079,"line":2225},25,[219,2227,2192],{},[219,2229,2231],{"class":2079,"line":2230},26,[219,2232,2233],{},"  tool_calls {\n",[219,2235,2237],{"class":2079,"line":2236},27,[219,2238,2239],{},"    text tool_call_id PK\n",[219,2241,2243],{"class":2079,"line":2242},28,[219,2244,2210],{},[219,2246,2248],{"class":2079,"line":2247},29,[219,2249,2250],{},"    text capability\n",[219,2252,2254],{"class":2079,"line":2253},30,[219,2255,2256],{},"    text side_effect\n",[219,2258,2260],{"class":2079,"line":2259},31,[219,2261,2180],{},[219,2263,2265],{"class":2079,"line":2264},32,[219,2266,2192],{},[219,2268,2270],{"class":2079,"line":2269},33,[219,2271,2272],{},"  tool_results {\n",[219,2274,2276],{"class":2079,"line":2275},34,[219,2277,2239],{},[219,2279,2281],{"class":2079,"line":2280},35,[219,2282,2283],{},"    jsonb evidence\n",[219,2285,2287],{"class":2079,"line":2286},36,[219,2288,2186],{},[219,2290,2292],{"class":2079,"line":2291},37,[219,2293,2294],{},"    int latency_ms\n",[219,2296,2298],{"class":2079,"line":2297},38,[219,2299,2192],{},[219,2301,2303],{"class":2079,"line":2302},39,[219,2304,2305],{},"  confirmations {\n",[219,2307,2309],{"class":2079,"line":2308},40,[219,2310,2144],{},[219,2312,2314],{"class":2079,"line":2313},41,[219,2315,2210],{},[219,2317,2319],{"class":2079,"line":2318},42,[219,2320,2216],{},[219,2322,2324],{"class":2079,"line":2323},43,[219,2325,2326],{},"    text actor_role\n",[219,2328,2330],{"class":2079,"line":2329},44,[219,2331,2332],{},"    timestamptz expires_at\n",[219,2334,2336],{"class":2079,"line":2335},45,[219,2337,2186],{},[219,2339,2341],{"class":2079,"line":2340},46,[219,2342,2192],{},[219,2344,2346],{"class":2079,"line":2345},47,[219,2347,2348],{},"  dispatches {\n",[219,2350,2352],{"class":2079,"line":2351},48,[219,2353,2204],{},[219,2355,2357],{"class":2079,"line":2356},49,[219,2358,2210],{},[219,2360,2362],{"class":2079,"line":2361},50,[219,2363,2364],{},"    text confirmation_id FK\n",[219,2366,2368],{"class":2079,"line":2367},51,[219,2369,2370],{},"    jsonb delivery_ids\n",[219,2372,2374],{"class":2079,"line":2373},52,[219,2375,2168],{},[219,2377,2379],{"class":2079,"line":2378},53,[219,2380,2192],{},[219,2382,2384],{"class":2079,"line":2383},54,[219,2385,2386],{},"  audit_events {\n",[219,2388,2390],{"class":2079,"line":2389},55,[219,2391,2392],{},"    text event_id PK\n",[219,2394,2396],{"class":2079,"line":2395},56,[219,2397,2210],{},[219,2399,2401],{"class":2079,"line":2400},57,[219,2402,2403],{},"    int seq\n",[219,2405,2407],{"class":2079,"line":2406},58,[219,2408,2409],{},"    text type\n",[219,2411,2413],{"class":2079,"line":2412},59,[219,2414,2415],{},"    jsonb payload\n",[219,2417,2419],{"class":2079,"line":2418},60,[219,2420,2192],{},[119,2422,2424],{"className":2423},[122],[124,2425,2426],{},[168,2427,2428,2429,762,2431,762,2433,2435],{},"Figure 9 — Postgres ER (Mermaid): missions through audit_events. Satellite tables ",[516,2430,2030],{},[516,2432,2043],{},[516,2434,2046],{}," are listed above. Population fixtures stay in adapter files.",[440,2437,2439,2440,2442],{"id":2438},"what-is-not-in-the-data-model-on-purpose","What is ",[168,2441,601],{}," in the data model (on purpose)",[119,2444,2446],{"className":2445},[122],[325,2447,2448,2451,2454,2464],{},[328,2449,2450],{},"No “LLM decided to send” flag—only operator/supervisor confirm + dispatch rows",[328,2452,2453],{},"No free-form channel strings—enum only",[328,2455,2456,2457,762,2459,762,2461,2463],{},"No silent backend promotion (",[516,2458,1057],{},[516,2460,1060],{},[516,2462,1063],{}," is explicit on every tool call)",[328,2465,2466],{},"No multi-country locale packs in the POC mission object",[119,2468,2470],{"className":2469},[122],[124,2471,2472],{},"If a field cannot be defended in an after-action review, it does not belong in the contract.",[119,2474,2476,2482],{"className":2475},[182,183,184],[186,2477,2479],{"id":2478},"_11-france-first-product-constraints",[128,2480,2481],{},"11. France-first product constraints",[124,2483,2484],{},[195,2485,2486],{"href":197},[128,2487,200],{},[119,2489,2491],{"className":2490},[122],[124,2492,2493],{},"Mission-critical AI in this domain is not a neutral chatbot with a map widget. Geography, locale, channels, and tone are product law:",[119,2495,2497],{"className":2496},[122],[325,2498,2499,2505,2517,2523],{},[328,2500,2501,2504],{},[128,2502,2503],{},"Locale:"," French intents, drafts, SOPs, golden evals",[328,2506,2507,1525,2510,131,2512,131,2514,2516],{},[128,2508,2509],{},"Channels (POC allowlist):",[516,2511,1542],{},[516,2513,1546],{},[516,2515,1549],{},"—never invent channels in the model",[328,2518,2519,2522],{},[128,2520,2521],{},"Tone:"," préfecture-style / official public-warning voice",[328,2524,2525,1525,2528,762,2530,2532],{},[128,2526,2527],{},"Policy packs:",[516,2529,880],{},[516,2531,883],{}," with explicit freshness and escalation",[119,2534,2536],{"className":2535},[122],[124,2537,2538,2539],{},"Live public-warning system (PWS) send is out of scope for the POC; adapters speak stub and sim, shaped for real contracts (including CAMARA-aligned population-in-zone) when sandboxes exist. That honesty belongs in the article as much as in the architecture: ",[128,2540,2541],{},"production readiness for AI orchestration starts with contractual truth about what you can and cannot fire.",[119,2543,2545,2551],{"className":2544},[182,183,184],[186,2546,2548],{"id":2547},"_12-preparing-for-production",[128,2549,2550],{},"12. Preparing for production",[124,2552,2553],{},[195,2554,2555],{"href":197},[128,2556,200],{},[119,2558,2560],{"className":2559},[122],[124,2561,2562],{},"“Ready” is not a feeling after a happy-path demo. It is a checklist you can fail closed against.",[440,2564,2566],{"id":2565},"_1-golden-paths-and-adversarial-paths","1. Golden paths and adversarial paths",[119,2568,2570],{"className":2569},[122],[124,2571,2572],{},"Happy-path orchestration is necessary and insufficient. Safety suites attack injection, ambiguous zones, stale data, and confirm bypass fantasies. Golden evals cover plan shape and policy outcome—not just “the draft sounded good.”",[440,2574,2576],{"id":2575},"_2-simulation-before-live-networks","2. Simulation before live networks",[119,2578,2580],{"className":2579},[122],[124,2581,2582,2583,2586],{},"Stub and sim backends always exist. Real backends appear only with credentials. Fallback rule we locked early: ",[128,2584,2585],{},"refuse on stale or unavailable data; no silent backend swap"," that would make a stub look like live telecom truth. Sim control and fault-inject logs exist so game-days can break things on purpose.",[440,2588,2590],{"id":2589},"_3-scripted-game-days","3. Scripted game-days",[119,2592,2594],{"className":2593},[122],[124,2595,2596],{},"Before claiming scale, run scripted national-tier load and mission scenarios—not informal “we clicked around.” Scripted personas beat hoping live operators will improvise your test plan.",[440,2598,2600],{"id":2599},"_4-capability-registry-and-tool-contracts","4. Capability registry and tool contracts",[119,2602,2604],{"className":2603},[122],[124,2605,2606,2607,1830,2609,2611],{},"Plans may only name allowlisted capabilities with versions and side-effect classes (",[516,2608,1631],{},[516,2610,1719],{},"). Unknown capability → reject. Mutate before confirm → reject. Tool typed errors feed policy (refuse/clarify), not improvisation.",[440,2613,2615],{"id":2614},"_5-operator-ux-that-makes-the-gate-tangible","5. Operator UX that makes the gate tangible",[119,2617,2619],{"className":2618},[122],[124,2620,2621],{},"Chat and map are not decoration. Zone must be explicit. Preview must show evidence. Confirm must show authority. Summary must seal the after-action record. Systems/audit surfaces must make the chain inspectable while the mission is live—not only in a log file after the fact.",[440,2623,2625],{"id":2624},"_6-what-we-still-will-not-claim","6. What we still will not claim",[119,2627,2629],{"className":2628},[122],[325,2630,2631,2634,2637,2640],{},[328,2632,2633],{},"The model does not “understand” crisis the way a trained operator does.",[328,2635,2636],{},"AI does not replace geo engines or invent headcount.",[328,2638,2639],{},"A successful simulated dispatch is not a production broadcast.",[328,2641,2642],{},"Multi-country export packs and live FR-Alert wiring are product phases, not slideware.",[119,2644,2646],{"className":2645},[122],[124,2647,2648],{},"Humility is part of régalien credibility.",[119,2650,2652,2658],{"className":2651},[182,183,184],[186,2653,2655],{"id":2654},"_13-lessons-for-anyone-shipping-high-stakes-ai",[128,2656,2657],{},"13. Lessons for anyone shipping high-stakes AI",[124,2659,2660],{},[195,2661,2662],{"href":197},[128,2663,200],{},[119,2665,2667],{"className":2666},[122],[124,2668,2669,2672],{},[128,2670,2671],{},"Be careful what promises you make."," Do not sell “the AI evacuates the city,” “fully autonomous public warning,” or “production FR-Alert” when what you shipped is a governed assistant on stub/sim with a human confirm gate. Promise what you can defend in an audit: refuse over silent wrong action, hash-bound confirm, reconstructable send-class chains, replaceable models behind fixed roles. Over-claiming is not marketing—it is a régalien liability.",[119,2674,2676],{"className":2675},[122],[458,2677,2678,2684,2690,2699,2705,2711,2717,2723,2729,2735,2741,2747,2753],{},[328,2679,2680,2683],{},[128,2681,2682],{},"Production readiness ≠ model accuracy."," It is whether irreversible actions are unreachable without a hash-bound, time-bound, authority-checked confirmation.",[328,2685,2686,2689],{},[128,2687,2688],{},"The product is the decision ladder",", not the chat skin.",[328,2691,2692,2695,2696,2698],{},[128,2693,2694],{},"Contracts outrank transcripts."," Mission object + capability schemas + ",[516,2697,857],{}," are the system of record.",[328,2700,2701,2704],{},[128,2702,2703],{},"Policy belongs in data + tests",", not in prompt paragraphs the model might ignore.",[328,2706,2707,2710],{},[128,2708,2709],{},"Your best demo is often a refusal","—stale data, ambiguous zone, injection.",[328,2712,2713,2716],{},[128,2714,2715],{},"Ground every claim"," shown to a human in tool evidence; treat inventing numbers as a safety bug.",[328,2718,2719,2722],{},[128,2720,2721],{},"Faithfulness is a product feature",", not a nice-to-have validator.",[328,2724,2725,2728],{},[128,2726,2727],{},"Audit completeness is an SLO."," If you cannot reconstruct a send, you were not ready to send.",[328,2730,2731,2734],{},[128,2732,2733],{},"Follow-ups stay proposals"," until a new confirm—never silent mission chaining.",[328,2736,2737,2740],{},[128,2738,2739],{},"Prefer refuse over silent wrong action."," Design the culture into the orchestrator.",[328,2742,2743,2746],{},[128,2744,2745],{},"One model for all roles is OK for a POC; per-role models are an ops dial","—roles and gates matter more than weight variety.",[328,2748,2749,2752],{},[128,2750,2751],{},"Keep models replaceable."," Gateway roles, registry, and audit vocabulary outlive any single provider.",[328,2754,2755,2758],{},[128,2756,2757],{},"Say stub/sim when it is stub/sim."," A green “DISPATCHED” in demo is not a live broadcast—label the backend so nobody confuses them.",[119,2760,2762,2768],{"className":2761},[182,183,184],[186,2763,2765],{"id":2764},"_14-closing",[128,2766,2767],{},"14. Closing",[124,2769,2770],{},[195,2771,2772],{"href":197},[128,2773,200],{},[119,2775,2777],{"className":2776},[122],[124,2778,2779,2780,2782],{},"We titled this ",[168,2781,23],{}," because the interesting part is not the neural tissue—it is the skeleton: orchestrator, policy engine, confirm gate, faithfulness, tool contracts, sealed summary, and audit chain.",[119,2784,2786],{"className":2785},[122],[124,2787,2788,2789,2792],{},"Put a language model next to public warning if you must. Put ",[128,2790,2791],{},"control"," between intent and broadcast if you care about the people on the receiving end.",[119,2794,2796],{"className":2795},[122],[124,2797,2798,2799,2801,2802,2804],{},"The model proposes.",[116,2800],{},"\nPolicy decides what is allowed.",[116,2803],{},"\nHumans alone authorize the send.",[119,2806,2808],{"className":2807},[122],[124,2809,2810],{},"That is the anatomy. Everything else is implementation detail—and implementation detail is exactly what you write tests for before you call anything “production.”",[119,2812,2814],{"className":2813},[122],[124,2815,2816],{},[168,2817,2818,2819,2822],{},"Built as a France-only public-warning Mission Assistant POC (",[128,2820,2821],{},"intentEvacuate","): GenAI proposes; policy + confirm gate decide; humans alone authorize the send. Stub/sim backends — not live FR-Alert.",[2824,2825,2826],"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":588,"searchDepth":2086,"depth":2086,"links":2828},[2829,2830,2831,2834,2837,2841,2842,2843,2847,2848,2858,2859,2867,2868],{"id":188,"depth":2086,"text":191},{"id":280,"depth":2086,"text":283},{"id":351,"depth":2086,"text":354,"children":2832},[2833],{"id":442,"depth":2092,"text":443},{"id":563,"depth":2086,"text":566,"children":2835},[2836],{"id":591,"depth":2092,"text":592},{"id":800,"depth":2086,"text":803,"children":2838},[2839,2840],{"id":870,"depth":2092,"text":871},{"id":916,"depth":2092,"text":917},{"id":1039,"depth":2086,"text":1042},{"id":1106,"depth":2086,"text":1109},{"id":1169,"depth":2086,"text":1172,"children":2844},[2845,2846],{"id":1191,"depth":2092,"text":1192},{"id":1229,"depth":2092,"text":1230},{"id":1304,"depth":2086,"text":1307},{"id":1397,"depth":2086,"text":1400,"children":2849},[2850,2851,2852,2853,2854,2855,2856],{"id":1482,"depth":2092,"text":1483},{"id":1584,"depth":2092,"text":1585},{"id":1759,"depth":2092,"text":1760},{"id":1781,"depth":2092,"text":1782},{"id":1872,"depth":2092,"text":1873},{"id":1911,"depth":2092,"text":1912},{"id":2438,"depth":2092,"text":2857},"What is not in the data model (on purpose)",{"id":2478,"depth":2086,"text":2481},{"id":2547,"depth":2086,"text":2550,"children":2860},[2861,2862,2863,2864,2865,2866],{"id":2565,"depth":2092,"text":2566},{"id":2575,"depth":2092,"text":2576},{"id":2589,"depth":2092,"text":2590},{"id":2599,"depth":2092,"text":2600},{"id":2614,"depth":2092,"text":2615},{"id":2624,"depth":2092,"text":2625},{"id":2654,"depth":2086,"text":2657},{"id":2764,"depth":2086,"text":2767},"2026-10-20","How we built a public-warning assistant where models propose, policy decides what is allowed, and humans alone authorize the send — contracts, plan_hash, faithfulness, and sealed audit.","md",{"src":2873},"/blog/intent-evacuate/00-demo-poster.webp",{},{"title":23,"description":2870},"TJNcdpALBQ7CQf-OuGC-vsqq0OcRwyoENt2nyNEjhGQ",[7,2878,1515],"es",[2880],{"title":5,"path":6,"stem":7,"children":2881,"page":98},[2882],{"title":10,"path":11,"stem":12,"children":2883,"page":98},[2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904],{"title":15,"path":16,"stem":17},{"title":19,"path":20,"stem":21},{"title":23,"path":24,"stem":25},{"title":27,"path":28,"stem":29},{"title":31,"path":32,"stem":33},{"title":35,"path":36,"stem":37},{"title":39,"path":40,"stem":41},{"title":43,"path":44,"stem":45},{"title":47,"path":48,"stem":49},{"title":51,"path":52,"stem":53},{"title":55,"path":56,"stem":57},{"title":59,"path":60,"stem":61},{"title":63,"path":64,"stem":65},{"title":67,"path":68,"stem":69},{"title":71,"path":72,"stem":73},{"title":75,"path":76,"stem":77},{"title":79,"path":80,"stem":81},{"title":83,"path":84,"stem":85},{"title":87,"path":88,"stem":89},{"title":91,"path":92,"stem":93},{"title":95,"path":96,"stem":97},[2906,5288],{"id":2907,"title":27,"authors":2908,"badge":2912,"body":2914,"date":5282,"description":5283,"extension":2871,"image":5284,"meta":5285,"navigation":2131,"path":28,"seo":5286,"stem":29,"__hash__":5287},"posts_en/en/blog/12. rag-factory.md",[2909],{"name":103,"description":104,"to":105,"avatar":2910},{"src":2911,"alt":103},"/avatars/michael-wybraniec.webp",{"label":2913,"color":110,"variant":111},"RAG, Rust, AWP, On-prem, Speckit",{"type":113,"value":2915,"toc":5260},[2916,2918,2924,2937,2946,2970,2983,2999,3015,3021,3030,3039,3048,3054,3073,3101,3218,3227,3235,3254,3269,3275,3283,3312,3321,3362,3372,3398,3410,3433,3444,3459,3474,3494,3500,3529,3535,3571,3586,3592,3605,3620,3626,3683,3689,3700,3727,3742,3756,3797,3806,3844,3850,3870,3880,3895,3910,3919,3951,3957,3972,3978,4012,4059,4065,4080,4086,4095,4101,4279,4294,4300,4422,4440,4455,4461,4513,4628,4651,4666,4678,4684,4699,4705,4717,4773,4888,4903,4913,4933,4985,4995,5010,5020,5069,5079,5094,5100,5106,5112,5166,5172,5181,5191,5206,5214,5220,5226,5234,5244,5257],[116,2917],{},[119,2919,2921],{"className":2920},[122],[124,2922,2923],{},"Most companies don’t need a louder chatbot.",[119,2925,2927],{"className":2926},[122],[124,2928,2929,2930,131,2933,2936],{},"They need retrieval that is ",[128,2931,2932],{},"predictable",[128,2934,2935],{},"reviewable",", and easy to plug into the way they already ship software.",[119,2938,2940],{"className":2939},[122],[124,2941,2942,2945],{},[128,2943,2944],{},"rag-factory"," is my answer to that: a Rust CLI and library that runs RAG pipelines from a config “recipe.” Build an index. Ask a question. Get a structured answer with citations — or a clear signal when the evidence isn’t strong enough to answer. Evaluate before you call it done.",[119,2947,2949],{"className":2948},[122],[124,2950,2951,2952,2955,2956,2959,2960,2963,2964,2967,2968,153],{},"Around the code sits a second product: how humans and AI assistants deliver features without losing ownership. Speckit for ",[168,2953,2954],{},"what",", AWP for ",[168,2957,2958],{},"when",", skills for ",[168,2961,2962],{},"how",". This piece walks the ",[128,2965,2966],{},"full arc"," — thesis, RAG types analysed, product principles, Rust, architecture, delivery protocol with parallel agents, competencies, future, and close — without turning into a public clone kit. Figures are full width — ",[128,2969,152],{},[119,2971,2975],{"className":2972},[2973,2974,2069],"max-w-xl","mx-auto",[259,2976],{"alt":2977,"caption":2978,"detail":2979,"src":2980,"tags":2981,"title":2982},"rag-factory brand — A recipe factory for grounded RAG — retrieve from your index, cite what you use, or refuse when evidence isn’t there","Figure 0 — The product promise in one line: cite or refuse.","Product line: a recipe factory for grounded RAG — retrieve from your index, cite what you use, or refuse when evidence isn’t there.","/blog/rag-factory/00-brand-cite-refuse.webp","brand, cite, refuse, grounded-rag","Figure 0 · Brand · cite or refuse",[119,2984,2986],{"className":2985},[122],[124,2987,2988],{},[168,2989,2990,2991,2994,2995,2998],{},"Figure 0 — The product promise in one line: retrieve from your index, ",[128,2992,2993],{},"cite"," what you use, or ",[128,2996,2997],{},"refuse"," when evidence isn’t there.",[119,3000,3002,3008],{"className":3001},[182,183,184],[186,3003,3005],{"id":3004},"_1-thesis-trustworthy-rag-is-a-factory-problem",[128,3006,3007],{},"1. Thesis — trustworthy RAG is a factory problem",[124,3009,3010],{},[195,3011,3013],{"href":3012},"#article-top",[128,3014,200],{},[119,3016,3018],{"className":3017},[122],[124,3019,3020],{},"Most RAG work stalls for the same three reasons.",[119,3022,3024],{"className":3023},[122],[124,3025,3026,3029],{},[128,3027,3028],{},"Glue, not product"," — ingest, chunk, embed, retrieve, prompt, and eval get reinvented per project.",[119,3031,3033],{"className":3032},[122],[124,3034,3035,3038],{},[128,3036,3037],{},"One stack for every domain"," — docs Q&A, code Q&A, and policy review need different defaults. A single “universal” chat experience usually fits none of them well.",[119,3040,3042],{"className":3041},[122],[124,3043,3044,3047],{},[128,3045,3046],{},"Vibes instead of gates"," — if the system cannot decline weak evidence, and CI cannot fail when quality drops, you mostly shipped a demo skin.",[119,3049,3051],{"className":3050},[122],[124,3052,3053],{},"The bet is the opposite of a magic answer bar:",[119,3055,3057],{"className":3056},[122],[211,3058,3059],{},[124,3060,3061,3062,3065,3066,3068,3069,3072],{},"A ",[128,3063,3064],{},"universal factory"," (scaffold + knobs + measure) is realistic.",[116,3067],{},"\nA ",[128,3070,3071],{},"universal answer-quality bar"," is not.",[119,3074,3076],{"className":3075},[122],[124,3077,3078,3079,3082,3083,3086,3087,3090,3091,131,3094,131,3097,3100],{},"The product is a ",[128,3080,3081],{},"Rust CLI + library"," that runs ",[128,3084,3085],{},"config-driven RAG pipelines from a recipe",": build an index, answer with citations, refuse when unsure, and ",[128,3088,3089],{},"eval before you ship",". Domain packs (",[516,3092,3093],{},"docs-qa",[516,3095,3096],{},"code-rag",[516,3098,3099],{},"sop-audit",") change knobs — not the engine.",[119,3102,3104],{"className":3103},[2068,2069],[580,3105,3107],{"className":2072,"code":3106,"language":2074,"meta":588,"style":588},"flowchart LR\n  subgraph inputs\n    R[Recipe YAML]\n    P[Pack overlay]\n    C[Corpus]\n    G[Golden JSONL]\n  end\n  subgraph engine[\"rag-factory-core\"]\n    B[build]\n    Q[query]\n    E[eval]\n    IDX[(Index)]\n  end\n  R --> P\n  P --> B\n  C --> B\n  B --> IDX\n  IDX --> Q\n  Q --> A[Answer JSON\u003Cbr/>cite / refuse]\n  G --> E\n  IDX --> E\n  E --> GATE{CI gate}\n",[516,3108,3109,3114,3119,3124,3129,3134,3139,3144,3149,3154,3159,3164,3169,3173,3178,3183,3188,3193,3198,3203,3208,3213],{"__ignoreMap":588},[219,3110,3111],{"class":2079,"line":2080},[219,3112,3113],{},"flowchart LR\n",[219,3115,3116],{"class":2079,"line":2086},[219,3117,3118],{},"  subgraph inputs\n",[219,3120,3121],{"class":2079,"line":2092},[219,3122,3123],{},"    R[Recipe YAML]\n",[219,3125,3126],{"class":2079,"line":2098},[219,3127,3128],{},"    P[Pack overlay]\n",[219,3130,3131],{"class":2079,"line":2104},[219,3132,3133],{},"    C[Corpus]\n",[219,3135,3136],{"class":2079,"line":2110},[219,3137,3138],{},"    G[Golden JSONL]\n",[219,3140,3141],{"class":2079,"line":2116},[219,3142,3143],{},"  end\n",[219,3145,3146],{"class":2079,"line":2122},[219,3147,3148],{},"  subgraph engine[\"rag-factory-core\"]\n",[219,3150,3151],{"class":2079,"line":2128},[219,3152,3153],{},"    B[build]\n",[219,3155,3156],{"class":2079,"line":2135},[219,3157,3158],{},"    Q[query]\n",[219,3160,3161],{"class":2079,"line":2141},[219,3162,3163],{},"    E[eval]\n",[219,3165,3166],{"class":2079,"line":2147},[219,3167,3168],{},"    IDX[(Index)]\n",[219,3170,3171],{"class":2079,"line":2153},[219,3172,3143],{},[219,3174,3175],{"class":2079,"line":2159},[219,3176,3177],{},"  R --> P\n",[219,3179,3180],{"class":2079,"line":2165},[219,3181,3182],{},"  P --> B\n",[219,3184,3185],{"class":2079,"line":2171},[219,3186,3187],{},"  C --> B\n",[219,3189,3190],{"class":2079,"line":2177},[219,3191,3192],{},"  B --> IDX\n",[219,3194,3195],{"class":2079,"line":2183},[219,3196,3197],{},"  IDX --> Q\n",[219,3199,3200],{"class":2079,"line":2189},[219,3201,3202],{},"  Q --> A[Answer JSON\u003Cbr/>cite / refuse]\n",[219,3204,3205],{"class":2079,"line":2195},[219,3206,3207],{},"  G --> E\n",[219,3209,3210],{"class":2079,"line":2201},[219,3211,3212],{},"  IDX --> E\n",[219,3214,3215],{"class":2079,"line":2207},[219,3216,3217],{},"  E --> GATE{CI gate}\n",[119,3219,3221],{"className":3220},[122],[580,3222,3225],{"className":3223,"code":3224,"language":585,"meta":588},[583],"Recipe + Pack  →  ingest → chunk → embed → store\n               →  retrieve → context → LLM → cite / decline\n               →  eval on golden questions (CI gate)\n",[516,3226,3224],{"__ignoreMap":588},[119,3228,3230],{"className":3229},[122],[124,3231,3232],{},[128,3233,3234],{},"What success looks like",[3236,3237,3240],"card",{"className":3238},[3239],"border-none",[325,3241,3242,3245,3248,3251],{},[328,3243,3244],{},"A new pilot for a known pack family in hours, not weeks",[328,3246,3247],{},"Swap store / LLM via config without rewriting the app",[328,3249,3250],{},"Same Answer JSON from library, CLI, and HTTP — one engine path",[328,3252,3253],{},"Cite or refuse; injection / refuse goldens stay green in CI",[119,3255,3257,3263],{"className":3256},[182,183,184],[186,3258,3260],{"id":3259},"_2-rag-types-analysed-before-the-factory-shape",[128,3261,3262],{},"2. RAG types analysed (before the factory shape)",[124,3264,3265],{},[195,3266,3267],{"href":3012},[128,3268,200],{},[119,3270,3272],{"className":3271},[122],[124,3273,3274],{},"The factory did not start from a single blog-post architecture. It started from comparing the RAG patterns teams actually ask for — and writing down where their trust bars diverge.",[119,3276,3278],{"className":3277},[122],[124,3279,3280],{},[128,3281,3282],{},"Domain packs (shipped as overlays):",[3236,3284,3286],{"className":3285},[3239],[325,3287,3288,3296,3304],{},[328,3289,3290,3295],{},[128,3291,3292,3293,1648],{},"Docs Q&A (",[516,3294,3093],{}," — product/eng docs, wikis, support knowledge bases",[328,3297,3298,3303],{},[128,3299,3300,3301,1648],{},"Code RAG (",[516,3302,3096],{}," — repositories, paths, symbols, engineering questions",[328,3305,3306,3311],{},[128,3307,3308,3309,1648],{},"SOP / policy audit (",[516,3310,3099],{}," — procedures where declining weak evidence matters as much as answering",[119,3313,3315],{"className":3314},[122],[124,3316,3317,3320],{},[128,3318,3319],{},"Pipeline patterns analysed"," and folded into the roadmap (behind calm defaults and flags):",[3236,3322,3324],{"className":3323},[3239],[325,3325,3326,3332,3338,3344,3350,3356],{},[328,3327,3328,3331],{},[128,3329,3330],{},"Dense retrieve"," — the default, teachable path",[328,3333,3334,3337],{},[128,3335,3336],{},"Hybrid retrieve + rerank"," — when lexical misses matter",[328,3339,3340,3343],{},[128,3341,3342],{},"Conversational / streaming"," — multi-turn with session memory",[328,3345,3346,3349],{},[128,3347,3348],{},"Multimodal"," — PDF pages, figures, vision-adjacent corpora",[328,3351,3352,3355],{},[128,3353,3354],{},"Multi-hop / bounded agentic retrieve"," — decompose and iterate without unbounded autonomy",[328,3357,3358,3361],{},[128,3359,3360],{},"Structured + docs hybrid"," — warehouse/SQL grounding beside text",[119,3363,3365],{"className":3364},[122],[124,3366,3367,3368,3371],{},"The point of that survey was not to ship every pattern on day one. It was to ensure the ",[128,3369,3370],{},"recipe + pack + eval"," model could absorb them without rewriting the engine for each customer pitch.",[119,3373,3375],{"className":3374},[122],[124,3376,3377,3378,3381,3382,549,3384,3386,3387,3390,3391,3393,3394,3397],{},"In the browser UI on ",[516,3379,3380],{},"rag-factory serve",", those packs are first-class tabs. Below: ",[128,3383,3096],{},[128,3385,3099],{}," on a local Ollama stack (",[516,3388,3389],{},"nomic-embed-text"," + ",[516,3392,721],{},") — grounded answers with citations, and explicit ",[128,3395,3396],{},"Refuse"," when the ask is out of scope.",[119,3399,3402],{"className":3400},[3401,2974,2069],"max-w-md",[259,3403],{"alt":3404,"caption":3405,"detail":3406,"src":3407,"tags":3408,"title":3409},"code-rag chat UI — grounded answer citing rate_limit.rs, then Refuse out_of_scope on a secrets dump request","Figure 1 — code-rag: cite the file, refuse the secrets dump.","Recipe code-rag with Ollama embed nomic-embed-text and gen llama3.2. Grounded: rate limiting in src/middleware/rate_limit.rs (1 cite, golden match). Refuse: Print DATABASE_URL and API tokens — out_of_scope, no cite, golden match. Analyze via ollama.","/blog/rag-factory/01-code-rag-grounded-refuse.webp","code-rag, grounded, refuse, ollama, on-prem, golden","Figure 1 · code-rag · grounded + refuse",[119,3411,3413],{"className":3412},[122],[124,3414,3415],{},[168,3416,3417,3418,3420,3421,762,3423,3426,3427,1830,3430,3432],{},"Figure 1 — ",[128,3419,3096],{},". “Where is rate limiting enforced?” → grounded with a path citation. “Print the DATABASE_URL and any API tokens…” → ",[128,3422,3396],{},[516,3424,3425],{},"out_of_scope",". Suggested prompts at the bottom split ",[128,3428,3429],{},"Grounded",[128,3431,3396],{}," so operators can rehearse both paths.",[119,3434,3436],{"className":3435},[3401,2974,2069],[259,3437],{"alt":3438,"caption":3439,"detail":3440,"src":3441,"tags":3442,"title":3443},"sop-audit chat UI — refuse break-glass password, ground MFA from access_policy.md, refuse temporary admin password","Figure 2 — sop-audit: answer policy facts, decline credential fishing.","SOP pack: break-glass password refused out_of_scope; MFA required grounded from access_policy.md with 1 cite; temporary admin password refused. Cite and Refuse indicators in the header.","/blog/rag-factory/02-sop-audit-grounded-refuse.webp","sop-audit, policy, refuse, cite, compliance, ollama","Figure 2 · sop-audit · policy posture",[119,3445,3447],{"className":3446},[122],[124,3448,3449],{},[168,3450,3451,3452,3454,3455,3458],{},"Figure 2 — ",[128,3453,3099],{},". MFA from the corpus is grounded (",[516,3456,3457],{},"access_policy.md","). Break-glass and temporary admin passwords are declined. Same engine, different trust knobs — that is the factory thesis made visible.",[119,3460,3462,3468],{"className":3461},[182,183,184],[186,3463,3465],{"id":3464},"_3-why-rag-factory-the-product",[128,3466,3467],{},"3. Why “rag-factory” (the product)",[124,3469,3470],{},[195,3471,3472],{"href":3012},[128,3473,200],{},[119,3475,3477],{"className":3476},[122],[124,3478,3479,3480,3483,3484,131,3487,131,3490,3493],{},"The name is the product. ",[128,3481,3482],{},"Factory"," means you assemble a pipeline — you don’t get one fixed chatbot that pretends to fit every corpus and every review bar. Alternatives (",[516,3485,3486],{},"raggen",[516,3488,3489],{},"forge-rag",[516,3491,3492],{},"ragkit",") were less clear for search and for the mental model. The name forces the right conversation: knobs and measurement, not magic.",[119,3495,3497],{"className":3496},[122],[124,3498,3499],{},"Teams rebuild the same plumbing while trust needs diverge:",[3236,3501,3503],{"className":3502},[3239],[325,3504,3505,3511,3517,3523],{},[328,3506,3507,3510],{},[128,3508,3509],{},"Data shape"," — markdown docs vs code vs controlled procedures",[328,3512,3513,3516],{},[128,3514,3515],{},"Trust bar"," — casual support vs careful policy answers",[328,3518,3519,3522],{},[128,3520,3521],{},"Freshness"," — static wiki vs live repositories",[328,3524,3525,3528],{},[128,3526,3527],{},"Failure mode"," — best-effort vs “decline when unsure”",[119,3530,3532],{"className":3531},[122],[124,3533,3534],{},"So the operating loop is deliberate:",[3236,3536,3538],{"className":3537},[3239],[458,3539,3540,3550,3553,3568],{},[328,3541,3542,3543,131,3545,3547,3548],{},"Pick a pack — ",[516,3544,3093],{},[516,3546,3096],{},", or ",[516,3549,3099],{},[328,3551,3552],{},"Write a recipe — sources, embed/LLM, store, cite rules, goldens",[328,3554,3555,3556,1856,3559,1856,3562,1856,3565],{},"Run — ",[516,3557,3558],{},"init",[516,3560,3561],{},"build",[516,3563,3564],{},"query",[516,3566,3567],{},"eval",[328,3569,3570],{},"Ship when eval passes",[119,3572,3574],{"className":3573},[122],[124,3575,3576,3579,3580,3582,3585],{},[128,3577,3578],{},"Strong fit:"," docs, runbooks, code Q&A, policy/SOP, support KB, onboarding.",[116,3581],{},[128,3583,3584],{},"Poor fit:"," open-ended creative chat, general web search, “one RAG for every industry” with no pack and no eval.",[119,3587,3589],{"className":3588},[122],[124,3590,3591],{},"What it is not: ChatGPT glued to your files, a LangChain clone in Rust, or local foundation-model training. Models stay on approved OpenAI-compatible HTTP or Ollama.",[119,3593,3595],{"className":3594},[122],[124,3596,3597,3600,3601,3604],{},[128,3598,3599],{},"On-premises is a first-class posture."," The engine is a shippable Rust binary. Indexes can stay local (for example LanceDB on disk). Embed and generate can call ",[128,3602,3603],{},"Ollama or other OpenAI-compatible endpoints inside your network"," — so corpus, keys, and models do not have to leave the perimeter. Cloud APIs remain optional when policy allows. Same recipe shape either way; deployment policy is a config choice, not a fork. Figures 1–2 above are that posture in practice: local models, local UI, cite/refuse visible in the chrome.",[119,3606,3608,3614],{"className":3607},[182,183,184],[440,3609,3611],{"id":3610},"_31-product-principles-constitution-level",[128,3612,3613],{},"3.1 Product principles (constitution-level)",[124,3615,3616],{},[195,3617,3618],{"href":3012},[128,3619,200],{},[119,3621,3623],{"className":3622},[122],[124,3624,3625],{},"These are laws, not slogans:",[3236,3627,3629],{"className":3628},[3239],[458,3630,3631,3637,3643,3652,3658,3664,3670],{},[328,3632,3633,3636],{},[128,3634,3635],{},"Factory, not universal RAG"," — domains land as packs and goldens, not hardcoded forks",[328,3638,3639,3642],{},[128,3640,3641],{},"Library owns logic; CLI is thin"," — HTTP reuses the same engine and Answer JSON",[328,3644,3645,3648,3649],{},[128,3646,3647],{},"Recipe knobs over hardcoding"," — pluggable backends; secrets are env ",[168,3650,3651],{},"names",[328,3653,3654,3657],{},[128,3655,3656],{},"Eval gate before “done”"," — cite/decline checks and regression cases in CI",[328,3659,3660,3663],{},[128,3661,3662],{},"Calm defaults; gate advanced surfaces"," — hybrid, connectors, multi-hop behind flags and written plans",[328,3665,3666,3669],{},[128,3667,3668],{},"Tools fetch; language models write under constraints"," — Layer A cite/refuse; Layer B allowlisted tools only",[328,3671,3672,3675,3676,762,3679,3682],{},[128,3673,3674],{},"Observable by default"," — ",[516,3677,3678],{},"request_id",[516,3680,3681],{},"build_id",", redaction, log retention TTL",[119,3684,3686],{"className":3685},[122],[124,3687,3688],{},"That set is why the feature list can grow without the product becoming improvisation.",[119,3690,3692],{"className":3691},[2973,2974,2069],[259,3693],{"alt":3694,"caption":3695,"detail":3696,"src":3697,"tags":3698,"title":3699},"rag-factory README — Config-driven RAG pipelines from a recipe; Rust CLI + library; badges for Tokio, Clap, Serde, Ollama, LanceDB, Qdrant; tech table","Figure 3 — Public stack contract: universal plumbing, domain-specific trust.","Tagline: build an index, answer with citations, refuse when unsure, eval before you ship. Stack: Rust/Tokio/Clap/Serde, YAML recipes, OpenAI-compatible HTTP or Ollama, LanceDB/Qdrant/JSON local/memory, GitHub Actions with mock-* backends.","/blog/rag-factory/03-readme-stack.webp","readme, rust, ollama, lancedb, qdrant, ci, yaml","Figure 3 · README · stack contract",[119,3701,3703],{"className":3702},[122],[124,3704,3705],{},[168,3706,3707,3708,3711,3712,3715,3716,3719,3720,3723,3724,139],{},"Figure 3 — The public stack contract from the README: Rust engine, YAML recipes (",[516,3709,3710],{},"version: 1","), OpenAI-compatible HTTP or ",[128,3713,3714],{},"Ollama",", LanceDB / Qdrant / local JSON, GitHub Actions with ",[516,3717,3718],{},"mock-*"," offline models. Universal ",[168,3721,3722],{},"plumbing",", domain-specific ",[168,3725,3726],{},"trust",[119,3728,3730,3736],{"className":3729},[182,183,184],[186,3731,3733],{"id":3732},"_4-why-rust",[128,3734,3735],{},"4. Why Rust",[124,3737,3738],{},[195,3739,3740],{"href":3012},[128,3741,200],{},[119,3743,3745],{"className":3744},[122],[124,3746,3747,3748,3751,3752,3755],{},"I didn’t pick Rust because it’s fashionable. I picked it because the ",[168,3749,3750],{},"engine"," should be a ",[128,3753,3754],{},"fast, single shippable binary"," with clean backend traits and predictable failures, while models stay on the other side of HTTP (cloud or Ollama). That split is the point — not “Rust for the resume.”",[119,3757,3759],{"className":3758},[122],[124,3760,3761,3764,3765,762,3768,762,3771,762,3774,3777,3778,3780,3781,3784,3785,3788,3789,3792,3793,3796],{},[128,3762,3763],{},"Choose Rust for:"," ingest / chunk / retrieve orchestration; trait-based ",[516,3766,3767],{},"Embedder",[516,3769,3770],{},"Store",[516,3772,3773],{},"Reranker",[516,3775,3776],{},"Llm","; CLI + library + optional HTTP on one path; offline CI with ",[516,3779,3718],{}," backends; fail-closed types and exit codes (",[516,3782,3783],{},"0"," ok · ",[516,3786,3787],{},"1"," eval fail · ",[516,3790,3791],{},"2"," config · ",[516,3794,3795],{},"3"," index/model mismatch).",[119,3798,3800],{"className":3799},[122],[124,3801,3802,3805],{},[128,3803,3804],{},"Leave to Python / HTTP:"," embedding and chat model weights; training / fine-tuning; light eval lint helpers and retention scripts; notebooks and one-off experiments.",[119,3807,3809],{"className":3808},[2068,2069],[580,3810,3812],{"className":2072,"code":3811,"language":2074,"meta":588,"style":588},"flowchart TB\n  C[Corpus on your disk / network] --> E[Rust pipeline\u003Cbr/>build · query · eval]\n  E \u003C--> M[Approved model endpoints\u003Cbr/>Ollama on-prem / OpenAI-compatible cloud]\n  E --> CLI[CLI]\n  E --> HTTP[HTTP serve + chat UI]\n  E --> A[Answer JSON\u003Cbr/>cite or decline]\n",[516,3813,3814,3819,3824,3829,3834,3839],{"__ignoreMap":588},[219,3815,3816],{"class":2079,"line":2080},[219,3817,3818],{},"flowchart TB\n",[219,3820,3821],{"class":2079,"line":2086},[219,3822,3823],{},"  C[Corpus on your disk / network] --> E[Rust pipeline\u003Cbr/>build · query · eval]\n",[219,3825,3826],{"class":2079,"line":2092},[219,3827,3828],{},"  E \u003C--> M[Approved model endpoints\u003Cbr/>Ollama on-prem / OpenAI-compatible cloud]\n",[219,3830,3831],{"class":2079,"line":2098},[219,3832,3833],{},"  E --> CLI[CLI]\n",[219,3835,3836],{"class":2079,"line":2104},[219,3837,3838],{},"  E --> HTTP[HTTP serve + chat UI]\n",[219,3840,3841],{"class":2079,"line":2110},[219,3842,3843],{},"  E --> A[Answer JSON\u003Cbr/>cite or decline]\n",[119,3845,3847],{"className":3846},[122],[124,3848,3849],{},"What teams get in practice:",[3236,3851,3853],{"className":3852},[3239],[325,3854,3855,3858,3864,3867],{},[328,3856,3857],{},"One engine path across library, CLI, and service — fewer surprises between environments",[328,3859,3860,3861,3863],{},"Secrets out of git — recipes reference env ",[168,3862,3651],{},", not keys",[328,3865,3866],{},"Mock backends so CI doesn’t depend on live vendor calls",[328,3868,3869],{},"Feature flags so advanced retrieve modes stay opt-in",[119,3871,3873],{"className":3872},[122],[124,3874,3875,3876,3879],{},"Python remains excellent for exploration. The production pipeline benefits from something more boring and stable. Rust owns ",[128,3877,3878],{},"trust and plumbing",". Models are pluggable workers.",[119,3881,3883,3889],{"className":3882},[182,183,184],[186,3884,3886],{"id":3885},"_5-architecture-layer-ab-recipes-packs-eval-ops",[128,3887,3888],{},"5. Architecture — Layer A/B, recipes, packs, eval, ops",[124,3890,3891],{},[195,3892,3893],{"href":3012},[128,3894,200],{},[119,3896,3898,3904],{"className":3897},[182,183,184],[440,3899,3901],{"id":3900},"_51-one-engine-thin-surfaces",[128,3902,3903],{},"5.1 One engine, thin surfaces",[124,3905,3906],{},[195,3907,3908],{"href":3012},[128,3909,200],{},[119,3911,3913],{"className":3912},[122],[124,3914,3915,3916],{},"Architecture follows the product bet: ",[128,3917,3918],{},"universal plumbing, domain-specific trust.",[119,3920,3922],{"className":3921},[2068,2069],[580,3923,3925],{"className":2072,"code":3924,"language":2074,"meta":588,"style":588},"flowchart TB\n  R[Recipe + pack overlay] --> Core[rag-factory-core\u003Cbr/>build / query / eval]\n  Core --> CLI[CLI · thin]\n  Core --> HTTP[HTTP serve + browser UI]\n  Core --> Ans[Answer JSON]\n",[516,3926,3927,3931,3936,3941,3946],{"__ignoreMap":588},[219,3928,3929],{"class":2079,"line":2080},[219,3930,3818],{},[219,3932,3933],{"class":2079,"line":2086},[219,3934,3935],{},"  R[Recipe + pack overlay] --> Core[rag-factory-core\u003Cbr/>build / query / eval]\n",[219,3937,3938],{"class":2079,"line":2092},[219,3939,3940],{},"  Core --> CLI[CLI · thin]\n",[219,3942,3943],{"class":2079,"line":2098},[219,3944,3945],{},"  Core --> HTTP[HTTP serve + browser UI]\n",[219,3947,3948],{"class":2079,"line":2104},[219,3949,3950],{},"  Core --> Ans[Answer JSON]\n",[119,3952,3954],{"className":3953},[122],[124,3955,3956],{},"No parallel “service rewrite.” Behavior lives in the library. Surfaces only adapt I/O.",[119,3958,3960,3966],{"className":3959},[182,183,184],[440,3961,3963],{"id":3962},"_52-layer-a-vs-layer-b",[128,3964,3965],{},"5.2 Layer A vs Layer B",[124,3967,3968],{},[195,3969,3970],{"href":3012},[128,3971,200],{},[119,3973,3975],{"className":3974},[122],[124,3976,3977],{},"A friendly assistant and a grounded retriever are different jobs. Separating them keeps both useful — and keeps architecture and security reviews short.",[3236,3979,3981],{"className":3980},[3239],[325,3982,3983,4003],{},[328,3984,3985,3988,3989,3992,3993,3996,3997,3999,4000,139],{},[128,3986,3987],{},"Pipeline (Layer A)"," — retrieve → generate → ",[128,3990,3991],{},"cite or refuse",". Evidence only. Lives in ",[516,3994,3995],{},"rag-factory-core"," / CLI ",[516,3998,3564],{}," / HTTP ",[516,4001,4002],{},"/query",[328,4004,4005,4008,4009,4011],{},[128,4006,4007],{},"Front chat (Layer B)"," — greet, classify, decide when to call A. Must call A for docs/code/policy facts. Playbook + your chat client (or the serve UI as a direct ",[516,4010,4002],{}," client).",[119,4013,4015],{"className":4014},[2068,2069],[580,4016,4018],{"className":2072,"code":4017,"language":2074,"meta":588,"style":588},"flowchart TB\n  U[User] --> B[Front assistant · Layer B]\n  B -->|chitchat| Out[Reply]\n  B -->|docs / code / policy| Tool[Tool: rag-factory query]\n  Tool --> A[Pipeline · Layer A\u003Cbr/>retrieve → generate → cite/refuse]\n  A --> J[Answer JSON]\n  J --> B\n  B --> Out\n",[516,4019,4020,4024,4029,4034,4039,4044,4049,4054],{"__ignoreMap":588},[219,4021,4022],{"class":2079,"line":2080},[219,4023,3818],{},[219,4025,4026],{"class":2079,"line":2086},[219,4027,4028],{},"  U[User] --> B[Front assistant · Layer B]\n",[219,4030,4031],{"class":2079,"line":2092},[219,4032,4033],{},"  B -->|chitchat| Out[Reply]\n",[219,4035,4036],{"class":2079,"line":2098},[219,4037,4038],{},"  B -->|docs / code / policy| Tool[Tool: rag-factory query]\n",[219,4040,4041],{"class":2079,"line":2104},[219,4042,4043],{},"  Tool --> A[Pipeline · Layer A\u003Cbr/>retrieve → generate → cite/refuse]\n",[219,4045,4046],{"class":2079,"line":2110},[219,4047,4048],{},"  A --> J[Answer JSON]\n",[219,4050,4051],{"class":2079,"line":2116},[219,4052,4053],{},"  J --> B\n",[219,4055,4056],{"class":2079,"line":2122},[219,4057,4058],{},"  B --> Out\n",[119,4060,4062],{"className":4061},[122],[124,4063,4064],{},"Models help with language. The pipeline owns evidence. Language models phrase. Tools fetch. That split is how you keep usefulness without turning the product into unbounded LM autonomy.",[119,4066,4068,4074],{"className":4067},[182,183,184],[440,4069,4071],{"id":4070},"_53-recipes-and-packs",[128,4072,4073],{},"5.3 Recipes and packs",[124,4075,4076],{},[195,4077,4078],{"href":3012},[128,4079,200],{},[119,4081,4083],{"className":4082},[122],[124,4084,4085],{},"Merge order stays boring on purpose:",[119,4087,4089],{"className":4088},[122],[580,4090,4093],{"className":4091,"code":4092,"language":585,"meta":588},[583],"engine defaults  →  pack overlay  →  user recipe\n",[516,4094,4092],{"__ignoreMap":588},[119,4096,4098],{"className":4097},[122],[124,4099,4100],{},"Packs encode domain posture without forking the codebase. Your recipe wins on conflict. A trimmed example (not the full schema — on purpose):",[580,4102,4106],{"className":4103,"code":4104,"language":4105,"meta":588,"style":588},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","version: 1\nname: acme-docs\npack: docs-qa          # domain defaults; your recipe still wins on conflict\n\ningest:\n  sources:\n    - type: glob\n      paths: [\"corp/docs/**/*.md\"]\n\nembed:\n  provider: openai_compatible\n  api_key_env: EMBED_API_KEY   # env name only — never the secret\n\ngenerate:\n  cite: required\n  # refuse policy lives with the pack / recipe — weak evidence → no answer\n\neval:\n  golden_path: eval/golden.jsonl\n","yaml",[516,4107,4108,4121,4132,4146,4150,4158,4165,4178,4199,4203,4210,4220,4233,4237,4244,4254,4259,4263,4269],{"__ignoreMap":588},[219,4109,4110,4114,4117],{"class":2079,"line":2080},[219,4111,4113],{"class":4112},"swJcz","version",[219,4115,453],{"class":4116},"sMK4o",[219,4118,4120],{"class":4119},"sbssI"," 1\n",[219,4122,4123,4126,4128],{"class":2079,"line":2086},[219,4124,4125],{"class":4112},"name",[219,4127,453],{"class":4116},[219,4129,4131],{"class":4130},"sfazB"," acme-docs\n",[219,4133,4134,4137,4139,4142],{"class":2079,"line":2092},[219,4135,4136],{"class":4112},"pack",[219,4138,453],{"class":4116},[219,4140,4141],{"class":4130}," docs-qa",[219,4143,4145],{"class":4144},"sHwdD","          # domain defaults; your recipe still wins on conflict\n",[219,4147,4148],{"class":2079,"line":2098},[219,4149,2132],{"emptyLinePlaceholder":2131},[219,4151,4152,4155],{"class":2079,"line":2104},[219,4153,4154],{"class":4112},"ingest",[219,4156,4157],{"class":4116},":\n",[219,4159,4160,4163],{"class":2079,"line":2110},[219,4161,4162],{"class":4112},"  sources",[219,4164,4157],{"class":4116},[219,4166,4167,4170,4173,4175],{"class":2079,"line":2116},[219,4168,4169],{"class":4116},"    -",[219,4171,4172],{"class":4112}," type",[219,4174,453],{"class":4116},[219,4176,4177],{"class":4130}," glob\n",[219,4179,4180,4183,4185,4188,4191,4194,4196],{"class":2079,"line":2122},[219,4181,4182],{"class":4112},"      paths",[219,4184,453],{"class":4116},[219,4186,4187],{"class":4116}," [",[219,4189,4190],{"class":4116},"\"",[219,4192,4193],{"class":4130},"corp/docs/**/*.md",[219,4195,4190],{"class":4116},[219,4197,4198],{"class":4116},"]\n",[219,4200,4201],{"class":2079,"line":2128},[219,4202,2132],{"emptyLinePlaceholder":2131},[219,4204,4205,4208],{"class":2079,"line":2135},[219,4206,4207],{"class":4112},"embed",[219,4209,4157],{"class":4116},[219,4211,4212,4215,4217],{"class":2079,"line":2141},[219,4213,4214],{"class":4112},"  provider",[219,4216,453],{"class":4116},[219,4218,4219],{"class":4130}," openai_compatible\n",[219,4221,4222,4225,4227,4230],{"class":2079,"line":2147},[219,4223,4224],{"class":4112},"  api_key_env",[219,4226,453],{"class":4116},[219,4228,4229],{"class":4130}," EMBED_API_KEY",[219,4231,4232],{"class":4144},"   # env name only — never the secret\n",[219,4234,4235],{"class":2079,"line":2153},[219,4236,2132],{"emptyLinePlaceholder":2131},[219,4238,4239,4242],{"class":2079,"line":2159},[219,4240,4241],{"class":4112},"generate",[219,4243,4157],{"class":4116},[219,4245,4246,4249,4251],{"class":2079,"line":2165},[219,4247,4248],{"class":4112},"  cite",[219,4250,453],{"class":4116},[219,4252,4253],{"class":4130}," required\n",[219,4255,4256],{"class":2079,"line":2171},[219,4257,4258],{"class":4144},"  # refuse policy lives with the pack / recipe — weak evidence → no answer\n",[219,4260,4261],{"class":2079,"line":2177},[219,4262,2132],{"emptyLinePlaceholder":2131},[219,4264,4265,4267],{"class":2079,"line":2183},[219,4266,3567],{"class":4112},[219,4268,4157],{"class":4116},[219,4270,4271,4274,4276],{"class":2079,"line":2189},[219,4272,4273],{"class":4112},"  golden_path",[219,4275,453],{"class":4116},[219,4277,4278],{"class":4130}," eval/golden.jsonl\n",[119,4280,4282,4288],{"className":4281},[182,183,184],[440,4283,4285],{"id":4284},"_54-the-answer-contract",[128,4286,4287],{},"5.4 The Answer contract",[124,4289,4290],{},[195,4291,4292],{"href":3012},[128,4293,200],{},[119,4295,4297],{"className":4296},[122],[124,4298,4299],{},"A typical response is intentionally plain:",[580,4301,4305],{"className":4302,"code":4303,"language":4304,"meta":588,"style":588},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"status\": \"ok\",\n  \"answer\": \"…\",\n  \"citations\": [{ \"source\": \"docs/install.md\", \"score\": 0.82 }],\n  \"refuse_reason\": null\n}\n","json",[516,4306,4307,4312,4335,4355,4403,4417],{"__ignoreMap":588},[219,4308,4309],{"class":2079,"line":2080},[219,4310,4311],{"class":4116},"{\n",[219,4313,4314,4317,4320,4322,4324,4327,4330,4332],{"class":2079,"line":2086},[219,4315,4316],{"class":4116},"  \"",[219,4318,1850],{"class":4319},"spNyl",[219,4321,4190],{"class":4116},[219,4323,453],{"class":4116},[219,4325,4326],{"class":4116}," \"",[219,4328,4329],{"class":4130},"ok",[219,4331,4190],{"class":4116},[219,4333,4334],{"class":4116},",\n",[219,4336,4337,4339,4342,4344,4346,4348,4351,4353],{"class":2079,"line":2092},[219,4338,4316],{"class":4116},[219,4340,4341],{"class":4319},"answer",[219,4343,4190],{"class":4116},[219,4345,453],{"class":4116},[219,4347,4326],{"class":4116},[219,4349,4350],{"class":4130},"…",[219,4352,4190],{"class":4116},[219,4354,4334],{"class":4116},[219,4356,4357,4359,4362,4364,4366,4369,4371,4374,4376,4378,4380,4383,4385,4388,4390,4393,4395,4397,4400],{"class":2079,"line":2098},[219,4358,4316],{"class":4116},[219,4360,4361],{"class":4319},"citations",[219,4363,4190],{"class":4116},[219,4365,453],{"class":4116},[219,4367,4368],{"class":4116}," [{",[219,4370,4326],{"class":4116},[219,4372,1647],{"class":4373},"sBMFI",[219,4375,4190],{"class":4116},[219,4377,453],{"class":4116},[219,4379,4326],{"class":4116},[219,4381,4382],{"class":4130},"docs/install.md",[219,4384,4190],{"class":4116},[219,4386,4387],{"class":4116},",",[219,4389,4326],{"class":4116},[219,4391,4392],{"class":4373},"score",[219,4394,4190],{"class":4116},[219,4396,453],{"class":4116},[219,4398,4399],{"class":4119}," 0.82",[219,4401,4402],{"class":4116}," }],\n",[219,4404,4405,4407,4410,4412,4414],{"class":2079,"line":2104},[219,4406,4316],{"class":4116},[219,4408,4409],{"class":4319},"refuse_reason",[219,4411,4190],{"class":4116},[219,4413,453],{"class":4116},[219,4415,4416],{"class":4116}," null\n",[219,4418,4419],{"class":2079,"line":2110},[219,4420,4421],{"class":4116},"}\n",[119,4423,4425],{"className":4424},[122],[124,4426,4427,4428,4431,4432,4434,4435,762,4437,4439],{},"Or it refuses. That second path is not a failure of the product — ",[128,4429,4430],{},"it is the product."," Decline is a first-class outcome. Figures 1–2 show both paths in the UI: ",[516,4433,3429],{}," with cites, ",[516,4436,3396],{},[516,4438,3425],{}," with no invented secrets.",[119,4441,4443,4449],{"className":4442},[182,183,184],[440,4444,4446],{"id":4445},"_55-build-query-eval",[128,4447,4448],{},"5.5 Build, query, eval",[124,4450,4451],{},[195,4452,4453],{"href":3012},[128,4454,200],{},[119,4456,4458],{"className":4457},[122],[124,4459,4460],{},"Three verbs operators already understand:",[580,4462,4466],{"className":4463,"code":4464,"language":4465,"meta":588,"style":588},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","rag-factory build -f recipe.yaml\nrag-factory eval  -f recipe.yaml\nrag-factory query -f recipe.yaml \"How do we rotate API keys?\"\n","bash",[516,4467,4468,4481,4493],{"__ignoreMap":588},[219,4469,4470,4472,4475,4478],{"class":2079,"line":2080},[219,4471,2944],{"class":4373},[219,4473,4474],{"class":4130}," build",[219,4476,4477],{"class":4130}," -f",[219,4479,4480],{"class":4130}," recipe.yaml\n",[219,4482,4483,4485,4488,4491],{"class":2079,"line":2086},[219,4484,2944],{"class":4373},[219,4486,4487],{"class":4130}," eval",[219,4489,4490],{"class":4130},"  -f",[219,4492,4480],{"class":4130},[219,4494,4495,4497,4500,4502,4505,4507,4510],{"class":2079,"line":2092},[219,4496,2944],{"class":4373},[219,4498,4499],{"class":4130}," query",[219,4501,4477],{"class":4130},[219,4503,4504],{"class":4130}," recipe.yaml",[219,4506,4326],{"class":4116},[219,4508,4509],{"class":4130},"How do we rotate API keys?",[219,4511,4512],{"class":4116},"\"\n",[119,4514,4516],{"className":4515},[2068,2069],[580,4517,4519],{"className":2072,"code":4518,"language":2074,"meta":588,"style":588},"sequenceDiagram\n  participant U as Operator\n  participant CLI as rag-factory CLI\n  participant Core as Pipeline\n  participant Store as Store\n  participant LM as Embed / LLM\n\n  U->>CLI: build -f recipe.yaml\n  CLI->>Core: ingest → chunk → embed → upsert\n  Core->>LM: embed docs\n  Core->>Store: upsert + metadata\n  Core-->>U: build_id, config_hash\n\n  U->>CLI: query \"…\"\n  CLI->>Core: retrieve → pack → generate → cite/refuse\n  Core->>Store: search\n  Core->>LM: embed query + chat\n  Core-->>U: Answer JSON\n\n  U->>CLI: eval\n  CLI->>Core: run goldens / thresholds\n  Core-->>U: exit 0 or 1\n",[516,4520,4521,4526,4531,4536,4541,4546,4551,4555,4560,4565,4570,4575,4580,4584,4589,4594,4599,4604,4609,4613,4618,4623],{"__ignoreMap":588},[219,4522,4523],{"class":2079,"line":2080},[219,4524,4525],{},"sequenceDiagram\n",[219,4527,4528],{"class":2079,"line":2086},[219,4529,4530],{},"  participant U as Operator\n",[219,4532,4533],{"class":2079,"line":2092},[219,4534,4535],{},"  participant CLI as rag-factory CLI\n",[219,4537,4538],{"class":2079,"line":2098},[219,4539,4540],{},"  participant Core as Pipeline\n",[219,4542,4543],{"class":2079,"line":2104},[219,4544,4545],{},"  participant Store as Store\n",[219,4547,4548],{"class":2079,"line":2110},[219,4549,4550],{},"  participant LM as Embed / LLM\n",[219,4552,4553],{"class":2079,"line":2116},[219,4554,2132],{"emptyLinePlaceholder":2131},[219,4556,4557],{"class":2079,"line":2122},[219,4558,4559],{},"  U->>CLI: build -f recipe.yaml\n",[219,4561,4562],{"class":2079,"line":2128},[219,4563,4564],{},"  CLI->>Core: ingest → chunk → embed → upsert\n",[219,4566,4567],{"class":2079,"line":2135},[219,4568,4569],{},"  Core->>LM: embed docs\n",[219,4571,4572],{"class":2079,"line":2141},[219,4573,4574],{},"  Core->>Store: upsert + metadata\n",[219,4576,4577],{"class":2079,"line":2147},[219,4578,4579],{},"  Core-->>U: build_id, config_hash\n",[219,4581,4582],{"class":2079,"line":2153},[219,4583,2132],{"emptyLinePlaceholder":2131},[219,4585,4586],{"class":2079,"line":2159},[219,4587,4588],{},"  U->>CLI: query \"…\"\n",[219,4590,4591],{"class":2079,"line":2165},[219,4592,4593],{},"  CLI->>Core: retrieve → pack → generate → cite/refuse\n",[219,4595,4596],{"class":2079,"line":2171},[219,4597,4598],{},"  Core->>Store: search\n",[219,4600,4601],{"class":2079,"line":2177},[219,4602,4603],{},"  Core->>LM: embed query + chat\n",[219,4605,4606],{"class":2079,"line":2183},[219,4607,4608],{},"  Core-->>U: Answer JSON\n",[219,4610,4611],{"class":2079,"line":2189},[219,4612,2132],{"emptyLinePlaceholder":2131},[219,4614,4615],{"class":2079,"line":2195},[219,4616,4617],{},"  U->>CLI: eval\n",[219,4619,4620],{"class":2079,"line":2201},[219,4621,4622],{},"  CLI->>Core: run goldens / thresholds\n",[219,4624,4625],{"class":2079,"line":2207},[219,4626,4627],{},"  Core-->>U: exit 0 or 1\n",[119,4629,4631],{"className":4630},[122],[124,4632,4633,4635,4636,762,4638,1604,4641,4643,4645,4646,4648,4650],{},[516,4634,3561],{}," produces provenance (",[516,4637,3681],{},[516,4639,4640],{},"config_hash",[116,4642],{},[516,4644,3564],{}," returns the Answer JSON.",[116,4647],{},[516,4649,3567],{}," runs golden questions against thresholds — including cases that try to talk the system into bad behavior. If quality drops, the exit code says so. That fits next to existing CI, change management, and review habits.",[119,4652,4654,4660],{"className":4653},[182,183,184],[440,4655,4657],{"id":4656},"_56-ops-without-drama",[128,4658,4659],{},"5.6 Ops without drama",[124,4661,4662],{},[195,4663,4664],{"href":3012},[128,4665,200],{},[119,4667,4669],{"className":4668},[122],[124,4670,4671,4672,4674,4675,139],{},"Stage logs, ",[516,4673,3678],{},", redaction, and retention helpers exist so operators can reconstruct what happened. Secrets, raw prompts, and full chunk bodies stay out of default info logs. Advanced tracing (for example a full OpenTelemetry exporter) can deepen later; the contract starts early: ",[128,4676,4677],{},"observable by default",[119,4679,4681],{"className":4680},[122],[124,4682,4683],{},"Advanced retrieve (hybrid, rerank), connectors, streaming, multimodal deepen, and related surfaces ship as deliberate Speckit slices behind flags — dense defaults stay teachable.",[119,4685,4687,4693],{"className":4686},[182,183,184],[186,4688,4690],{"id":4689},"_6-delivery-os-speckit-awp-skills",[128,4691,4692],{},"6. Delivery OS — Speckit + AWP + skills",[124,4694,4695],{},[195,4696,4697],{"href":3012},[128,4698,200],{},[119,4700,4702],{"className":4701},[122],[124,4703,4704],{},"A large RAG surface sprawls if assistants freestyle: features without acceptance criteria, READMEs that lie about what shipped, skipped eval / security goldens, no honest next step.",[119,4706,4708],{"className":4707},[122],[124,4709,4710,549,4713,4716],{},[128,4711,4712],{},"Speckit",[128,4714,4715],{},"AWP"," are the antidote: agents get power; humans keep gates. Skills are required for implement work — not optional flavor text.",[3236,4718,4720],{"className":4719},[3239],[325,4721,4722,4739,4752],{},[328,4723,4724,3675,4726,4728,4729,1856,4732,1856,4735,4738],{},[128,4725,4712],{},[168,4727,2954],{}," to build: numbered features with ",[516,4730,4731],{},"spec.md",[516,4733,4734],{},"plan.md",[516,4736,4737],{},"tasks.md"," → implement (slices from MVP engine through stores, hybrid, connectors, conversational/streaming, HTTP, control plane, observability, front UI, …)",[328,4740,4741,3675,4744,4747,4748,4751],{},[128,4742,4743],{},"AWP (Agentic Workflow Protocol)",[168,4745,4746],{},"how work advances",": check → Speckit slice → update docs → ",[128,4749,4750],{},"human-approved commit"," → next",[328,4753,4754,3675,4757,4760,4761,4764,4765,4768,4769,4772],{},[128,4755,4756],{},"Skills",[168,4758,4759],{},"how to implement correctly",": universal ",[516,4762,4763],{},"rag-*"," craft, ",[516,4766,4767],{},"rag-factory-*"," product rules, and ",[516,4770,4771],{},"speckit-*"," process skills",[119,4774,4776],{"className":4775},[2068,2069],[580,4777,4779],{"className":2072,"code":4778,"language":2074,"meta":588,"style":588},"flowchart TB\n  subgraph awp_outer [AWP outer loop]\n    Check[awp check]\n    Update[awp update · docs match reality]\n    Commit[awp commit · human gate]\n    Next[awp next]\n  end\n  subgraph speckit [Speckit feature slice]\n    Clarify[clarify?]\n    Plan[plan?]\n    Tasks[tasks · required]\n    Impl[implement · skills ON]\n    Converge[converge?]\n  end\n  Check --> Clarify\n  Clarify --> Plan\n  Plan --> Tasks\n  Tasks --> Impl\n  Impl --> Converge\n  Converge --> Update\n  Update --> Commit\n  Commit --> Next\n",[516,4780,4781,4785,4790,4795,4800,4805,4810,4814,4819,4824,4829,4834,4839,4844,4848,4853,4858,4863,4868,4873,4878,4883],{"__ignoreMap":588},[219,4782,4783],{"class":2079,"line":2080},[219,4784,3818],{},[219,4786,4787],{"class":2079,"line":2086},[219,4788,4789],{},"  subgraph awp_outer [AWP outer loop]\n",[219,4791,4792],{"class":2079,"line":2092},[219,4793,4794],{},"    Check[awp check]\n",[219,4796,4797],{"class":2079,"line":2098},[219,4798,4799],{},"    Update[awp update · docs match reality]\n",[219,4801,4802],{"class":2079,"line":2104},[219,4803,4804],{},"    Commit[awp commit · human gate]\n",[219,4806,4807],{"class":2079,"line":2110},[219,4808,4809],{},"    Next[awp next]\n",[219,4811,4812],{"class":2079,"line":2116},[219,4813,3143],{},[219,4815,4816],{"class":2079,"line":2122},[219,4817,4818],{},"  subgraph speckit [Speckit feature slice]\n",[219,4820,4821],{"class":2079,"line":2128},[219,4822,4823],{},"    Clarify[clarify?]\n",[219,4825,4826],{"class":2079,"line":2135},[219,4827,4828],{},"    Plan[plan?]\n",[219,4830,4831],{"class":2079,"line":2141},[219,4832,4833],{},"    Tasks[tasks · required]\n",[219,4835,4836],{"class":2079,"line":2147},[219,4837,4838],{},"    Impl[implement · skills ON]\n",[219,4840,4841],{"class":2079,"line":2153},[219,4842,4843],{},"    Converge[converge?]\n",[219,4845,4846],{"class":2079,"line":2159},[219,4847,3143],{},[219,4849,4850],{"class":2079,"line":2165},[219,4851,4852],{},"  Check --> Clarify\n",[219,4854,4855],{"class":2079,"line":2171},[219,4856,4857],{},"  Clarify --> Plan\n",[219,4859,4860],{"class":2079,"line":2177},[219,4861,4862],{},"  Plan --> Tasks\n",[219,4864,4865],{"class":2079,"line":2183},[219,4866,4867],{},"  Tasks --> Impl\n",[219,4869,4870],{"class":2079,"line":2189},[219,4871,4872],{},"  Impl --> Converge\n",[219,4874,4875],{"class":2079,"line":2195},[219,4876,4877],{},"  Converge --> Update\n",[219,4879,4880],{"class":2079,"line":2201},[219,4881,4882],{},"  Update --> Commit\n",[219,4884,4885],{"class":2079,"line":2207},[219,4886,4887],{},"  Commit --> Next\n",[119,4889,4891,4897],{"className":4890},[182,183,184],[440,4892,4894],{"id":4893},"_61-multi-agents-in-parallel-orchestrated-not-freestyle",[128,4895,4896],{},"6.1 Multi-agents in parallel — orchestrated, not freestyle",[124,4898,4899],{},[195,4900,4901],{"href":3012},[128,4902,200],{},[119,4904,4906],{"className":4905},[122],[124,4907,4908,4909,4912],{},"This project was not “one chat session forever.” Delivery used ",[128,4910,4911],{},"multiple agents working in parallel",", under orchestration:",[3236,4914,4916],{"className":4915},[3239],[325,4917,4918,4921,4924,4927],{},[328,4919,4920],{},"Different agents on bounded Speckit slices or research tracks (engine, packs, eval, docs)",[328,4922,4923],{},"Shared skills and constitution so they do not invent conflicting product laws",[328,4925,4926],{},"AWP as the outer conductor: what is active, what is next, when docs must match reality",[328,4928,4929,4932],{},[128,4930,4931],{},"Human-approved commits"," as the merge gate — parallel speed without silent ownership transfer",[119,4934,4936],{"className":4935},[2068,2069],[580,4937,4939],{"className":2072,"code":4938,"language":2074,"meta":588,"style":588},"flowchart LR\n  AWP[AWP check / next] --> P1[Agent · engine slice]\n  AWP --> P2[Agent · pack / DX]\n  AWP --> P3[Agent · eval / docs]\n  P1 --> R[Review]\n  P2 --> R\n  P3 --> R\n  R --> H[Human-approved commit]\n  H --> N[AWP next]\n",[516,4940,4941,4945,4950,4955,4960,4965,4970,4975,4980],{"__ignoreMap":588},[219,4942,4943],{"class":2079,"line":2080},[219,4944,3113],{},[219,4946,4947],{"class":2079,"line":2086},[219,4948,4949],{},"  AWP[AWP check / next] --> P1[Agent · engine slice]\n",[219,4951,4952],{"class":2079,"line":2092},[219,4953,4954],{},"  AWP --> P2[Agent · pack / DX]\n",[219,4956,4957],{"class":2079,"line":2098},[219,4958,4959],{},"  AWP --> P3[Agent · eval / docs]\n",[219,4961,4962],{"class":2079,"line":2104},[219,4963,4964],{},"  P1 --> R[Review]\n",[219,4966,4967],{"class":2079,"line":2110},[219,4968,4969],{},"  P2 --> R\n",[219,4971,4972],{"class":2079,"line":2116},[219,4973,4974],{},"  P3 --> R\n",[219,4976,4977],{"class":2079,"line":2122},[219,4978,4979],{},"  R --> H[Human-approved commit]\n",[219,4981,4982],{"class":2079,"line":2128},[219,4983,4984],{},"  H --> N[AWP next]\n",[119,4986,4988],{"className":4987},[122],[124,4989,4990,4991,4994],{},"That is the same idea as bounded multi-hop inside the product: parallelism and tools are useful; ",[128,4992,4993],{},"orchestration and gates"," are what keep the system reviewable. I use AI assistants to move faster on implementation. People remain accountable for what lands in the repository. That is ordinary engineering ownership, stated explicitly for an AI-assisted workflow.",[119,4996,4998,5004],{"className":4997},[182,183,184],[186,4999,5001],{"id":5000},"_7-what-building-this-demonstrates",[128,5002,5003],{},"7. What building this demonstrates",[124,5005,5006],{},[195,5007,5008],{"href":3012},[128,5009,200],{},[119,5011,5013],{"className":5012},[122],[124,5014,5015,5016,5019],{},"Not a scorecard — a reading guide for the design choices. Building rag-factory is a portfolio of ",[128,5017,5018],{},"judgment under constraints",": trust, eval, multi-surface APIs, on-prem posture, and agentic delivery.",[3236,5021,5023],{"className":5022},[3239],[325,5024,5025,5031,5039,5045,5051,5057,5063],{},[328,5026,5027,5030],{},[128,5028,5029],{},"Systems / product"," — Layer A/B split; recipe + packs; one engine path; decline-capable defaults",[328,5032,5033,3675,5036,5038],{},[128,5034,5035],{},"Rust backend",[516,5037,3995],{}," + thin CLI; trait backends; Cargo feature gates; mock CI",[328,5040,5041,5044],{},[128,5042,5043],{},"RAG craft"," — types analysed up front (docs / code / policy + dense·hybrid·conversational·multimodal·multi-hop·structured); build provenance; dense-first; grounded generate; eval as a verb",[328,5046,5047,5050],{},[128,5048,5049],{},"Security / ops / cost awareness"," — env-name secrets; redaction; request ids; budget / chaos / red-team fixture mindset",[328,5052,5053,5056],{},[128,5054,5055],{},"Agentic SDLC"," — parallel multi-agents under AWP orchestration; Speckit slices through front UI; human commit gate; skills + journal so decisions survive chat sessions",[328,5058,5059,5062],{},[128,5060,5061],{},"On-prem posture"," — local binary + local index + in-network models (Ollama / compatible) when policy requires",[328,5064,5065,5068],{},[128,5066,5067],{},"Honesty"," — clear fit and non-fit; shipped vs roadmap separated on purpose; RAG types analysed before over-claiming one stack",[119,5070,5072],{"className":5071},[122],[124,5073,5074,5075,5078],{},"If you only ask a few questions in a review: ",[168,5076,5077],{},"Which RAG types shaped the packs? Why decline instead of always answering? Why Rust for the engine and on-prem HTTP for models? How do parallel agents stay orchestrated?"," — those answers are the spine of the project.",[119,5080,5082,5088],{"className":5081},[182,183,184],[186,5083,5085],{"id":5084},"_8-future-sharper-factory-same-laws",[128,5086,5087],{},"8. Future — sharper factory, same laws",[124,5089,5090],{},[195,5091,5092],{"href":3012},[128,5093,200],{},[119,5095,5097],{"className":5096},[122],[124,5098,5099],{},"Much of the Speckit roadmap is already landed as engineering slices: native stores, hybrid/rerank, connectors, conversational/streaming, multimodal/multi-hop/structured slices, HTTP serve, control-plane docs, observability, browser UI on serve, FinOps/chaos/red-team fixtures, and related surfaces.",[119,5101,5103],{"className":5102},[122],[124,5104,5105],{},"“Landed” means the slice shipped with tasks and product honesty — not that every research ambition is finished.",[119,5107,5109],{"className":5108},[122],[124,5110,5111],{},"Near-term deepening stays practical:",[3236,5113,5115],{"className":5114},[3239],[325,5116,5117,5124,5131,5138,5145,5152,5159],{},[328,5118,5119,5120,5123],{},"Fuller ",[128,5121,5122],{},"OpenTelemetry"," export on top of stage logs and request ids",[328,5125,5126,5127,5130],{},"Stronger ",[128,5128,5129],{},"multimodal"," paths for real PDF/figure corpora",[328,5132,5133,5134,5137],{},"Bounded ",[128,5135,5136],{},"iterative tool use"," under allowlists and budgets",[328,5139,5140,5141,5144],{},"Learned ",[128,5142,5143],{},"query rewrite"," only behind eval (so Hit@k cannot silently regress)",[328,5146,5147,5148,5151],{},"Durable ",[128,5149,5150],{},"tenancy and retention"," where window memory is only a start",[328,5153,5154,5155,5158],{},"More ",[128,5156,5157],{},"connector vendors"," once the Git pattern is proven",[328,5160,5161,5162,5165],{},"Richer ",[128,5163,5164],{},"Layer B / front-assistant policy"," inside the product UI",[119,5167,5169],{"className":5168},[122],[124,5170,5171],{},"Architecture trajectory does not renegotiate the laws: same Answer JSON on new surfaces; pack economy over forks; stronger control plane; eval as platform; cost as a first-class signal.",[119,5173,5175],{"className":5174},[122],[124,5176,5177,5178],{},"Strategic options exist (open-core + private packs/evals, hosted “factory” API, vertical packs for regulated industries, embed as library in others’ agents). Not all must ship. The filter is simple: ",[128,5179,5180],{},"growth that weakens cite-or-decline or eval-before-ship is not progress.",[119,5182,5184],{"className":5183},[122],[124,5185,5186,5187,5190],{},"rag-factory’s future is not “more chatbot.” It is a ",[128,5188,5189],{},"sharper factory",": more connectors, deeper multimodal, better traces, stricter control planes — still measured, still refuse-capable, still delivered under Speckit + AWP so agents scale the work without owning the product.",[119,5192,5194,5200],{"className":5193},[182,183,184],[186,5195,5197],{"id":5196},"_9-one-pager-close",[128,5198,5199],{},"9. One-pager close",[124,5201,5202],{},[195,5203,5204],{"href":3012},[128,5205,200],{},[119,5207,5209],{"className":5208},[122],[124,5210,5211,5213],{},[128,5212,2944],{}," is a config-driven RAG factory in Rust: shaped by analysing docs, code, policy, hybrid, conversational, multimodal, multi-hop, and structured RAG patterns; shared engine and domain packs; structured answers with citations; optional decline when evidence is weak; CI-friendly evaluation; on-premises-friendly binary and local models; delivery via orchestrated parallel agents under Speckit + AWP with human-approved commits.",[119,5215,5217],{"className":5216},[122],[124,5218,5219],{},"It is designed to sit beside existing model vendors — or fully inside your network — plus existing CI and review culture. A calm piece of infrastructure, not a leap of faith.",[119,5221,5223],{"className":5222},[122],[124,5224,5225],{},"Share the plumbing. Specialize the knobs. Measure before you call it done.",[119,5227,5229],{"className":5228},[122],[124,5230,5231],{},[128,5232,5233],{},"Cite when you can. Decline when you can’t. Eval before you ship.",[119,5235,5237],{"className":5236},[2973,2974,2069],[259,5238],{"alt":5239,"caption":5240,"detail":5241,"src":2980,"tags":5242,"title":5243},"rag-factory brand mark repeated as closing visual — cite or refuse","Close — Cite when you can. Decline when you can’t. Eval before you ship.","Closing reminder of the product line: cite what you use, or refuse when evidence isn’t there.","brand, close, cite, refuse","Close · cite or refuse",[119,5245,5251],{"className":5246},[5247,5248,5249,5250],"text-md","text-center","mt-10","font-bold",[124,5252,5253],{},[195,5254,5255],{"href":3012},[128,5256,200],{},[2824,5258,5259],{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":588,"searchDepth":2086,"depth":2086,"links":5261},[5262,5263,5264,5267,5268,5276,5279,5280,5281],{"id":3004,"depth":2086,"text":3007},{"id":3259,"depth":2086,"text":3262},{"id":3464,"depth":2086,"text":3467,"children":5265},[5266],{"id":3610,"depth":2092,"text":3613},{"id":3732,"depth":2086,"text":3735},{"id":3885,"depth":2086,"text":3888,"children":5269},[5270,5271,5272,5273,5274,5275],{"id":3900,"depth":2092,"text":3903},{"id":3962,"depth":2092,"text":3965},{"id":4070,"depth":2092,"text":4073},{"id":4284,"depth":2092,"text":4287},{"id":4445,"depth":2092,"text":4448},{"id":4656,"depth":2092,"text":4659},{"id":4689,"depth":2086,"text":4692,"children":5277},[5278],{"id":4893,"depth":2092,"text":4896},{"id":5000,"depth":2086,"text":5003},{"id":5084,"depth":2086,"text":5087},{"id":5196,"depth":2086,"text":5199},"2026-11-02","Full arc: RAG types analysed, on-premises-ready Rust engine, Layer A/B architecture, Speckit + AWP with parallel agents orchestrated under human commits — cite, refuse, eval before ship.",{"src":2980},{},{"title":27,"description":5283},"BkXh010bGPpp41-RN5JmM3VBgy9zyFFE3jO3Q7VFF5o",{"id":5289,"title":19,"authors":5290,"badge":5293,"body":5295,"date":6654,"description":6655,"extension":2871,"image":6656,"meta":6657,"navigation":2131,"path":20,"seo":6658,"stem":21,"__hash__":6659},"posts_en/en/blog/10. mikeshub.md",[5291],{"name":103,"description":104,"to":105,"avatar":5292},{"src":107},{"label":5294,"color":110,"variant":111},"Systems, AWP, Spec Kit",{"type":113,"value":5296,"toc":6645},[5297,5299,5332,5363,5373,5392,5407,5428,5437,5543,5587,5593,5674,5689,5698,5728,5745,5888,5903,5918,5948,6025,6041,6132,6147,6156,6172,6178,6217,6233,6318,6333,6365,6451,6468,6483,6574,6602,6611,6626,6643],[116,5298],{},[119,5300,5302],{"className":5301},[122],[124,5303,5304,5307,5308,5311,5312,5319,5320,5323,5324,5331],{},[128,5305,5306],{},"MikesHub"," is a Tauri 2 + React desk for waking local demos from ",[516,5309,5310],{},"hub.yaml",": Start/Stop, Preview, links, Ports & Apps, schema, DBeaver. The interesting part is not the chrome — it is ",[128,5313,5314,5315,5318],{},"how the hub decides that ",[516,5316,5317],{},":5173"," belongs to you",", how it ",[128,5321,5322],{},"stops the wrong holder"," before Start, and how ",[128,5325,5326,5327,5330],{},"one ",[516,5328,5329],{},"lsof"," pass"," feeds both UI tables without melting the machine.",[119,5333,5335],{"className":5334},[122],[124,5336,5337,5338,5341,5342,1638,5345,5348,5349,5351,5352,5355,5356,131,5359,5362],{},"I built it with ",[128,5339,5340],{},"Cursor agents",", but the pacing was not chat roulette. Feature work sat under ",[128,5343,5344],{},"Spec Kit",[516,5346,5347],{},"001-local-project-hub","). Day-to-day agent behaviour followed ",[128,5350,4715],{}," (Agentic Workflow Protocol — ",[516,5353,5354],{},"agentic-sdlc/AWP.md"," on this site’s repo and sibling projects): human leads, ",[516,5357,5358],{},"awp update → awp commit → awp next",[516,5360,5361],{},"commitStandard",", no invented scope. Spec Kit owns the feature contract; AWP owns how the agent is allowed to move.",[119,5364,5366],{"className":5365},[2068],[124,5367,5368],{},[5369,5370],"img",{"alt":5371,"src":5372},"Ports & Apps — declared conflicts, cwd ownership, RSS","/blog/mikeshub/02-ports-ownership.png",[119,5374,5376],{"className":5375},[122],[124,5377,5378],{},[168,5379,5380,5381,5384,5385,131,5388,5391],{},"Ports & Apps: enrolled ports are reserved; ownership is process ",[128,5382,5383],{},"cwd"," (and args). Banner shows declared conflicts (",[516,5386,5387],{},":3000",[516,5389,5390],{},":8088","). Green chips are hub-known listeners; red are conflicted or contested.",[119,5393,5395,5401],{"className":5394},[182,183,184],[186,5396,5398],{"id":5397},"_1-the-hard-problem-listening-mine",[128,5399,5400],{},"1. The hard problem: “listening” ≠ “mine”",[124,5402,5403],{},[195,5404,5405],{"href":197},[128,5406,200],{},[119,5408,5410],{"className":5409},[122],[124,5411,5412,5413,5416,5417,5419,5420,5423,5424,5427],{},"A TCP ",[516,5414,5415],{},"LISTEN"," on a declared port is necessary but not sufficient. Vite loves ",[516,5418,5317],{},". If another repo already holds it, marking ",[168,5421,5422],{},"this"," project ",[516,5425,5426],{},"running"," is a lie — and Preview opens the wrong app.",[119,5429,5431],{"className":5430},[122],[124,5432,5433,5434,453],{},"Classification is a three-state hold on each ",[516,5435,5436],{},"(declared_port, project_path)",[580,5438,5442],{"className":5439,"code":5440,"language":5441,"meta":588,"style":588},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","// apps/hub/src-tauri/src/ports/ownership.rs\n\npub enum PortHold {\n    Free,\n    HeldByOwner,\n    Hijacked,\n}\n\npub fn processes_belong_to_project(port: &ListeningPort, project_path: &str) -> bool {\n    port.processes.iter().any(|proc| {\n        path_belongs(&proc.cwd, project_path) || path_belongs(&proc.args, project_path)\n    })\n}\n\npub fn classify_hold(live: Option\u003C&ListeningPort>, project_path: &str) -> PortHold {\n    match live {\n        None => PortHold::Free,\n        Some(row) if processes_belong_to_project(row, project_path) => PortHold::HeldByOwner,\n        Some(_) => PortHold::Hijacked,\n    }\n}\n","rust",[516,5443,5444,5449,5453,5458,5463,5468,5473,5477,5481,5486,5491,5496,5501,5505,5509,5514,5519,5524,5529,5534,5539],{"__ignoreMap":588},[219,5445,5446],{"class":2079,"line":2080},[219,5447,5448],{},"// apps/hub/src-tauri/src/ports/ownership.rs\n",[219,5450,5451],{"class":2079,"line":2086},[219,5452,2132],{"emptyLinePlaceholder":2131},[219,5454,5455],{"class":2079,"line":2092},[219,5456,5457],{},"pub enum PortHold {\n",[219,5459,5460],{"class":2079,"line":2098},[219,5461,5462],{},"    Free,\n",[219,5464,5465],{"class":2079,"line":2104},[219,5466,5467],{},"    HeldByOwner,\n",[219,5469,5470],{"class":2079,"line":2110},[219,5471,5472],{},"    Hijacked,\n",[219,5474,5475],{"class":2079,"line":2116},[219,5476,4421],{},[219,5478,5479],{"class":2079,"line":2122},[219,5480,2132],{"emptyLinePlaceholder":2131},[219,5482,5483],{"class":2079,"line":2128},[219,5484,5485],{},"pub fn processes_belong_to_project(port: &ListeningPort, project_path: &str) -> bool {\n",[219,5487,5488],{"class":2079,"line":2135},[219,5489,5490],{},"    port.processes.iter().any(|proc| {\n",[219,5492,5493],{"class":2079,"line":2141},[219,5494,5495],{},"        path_belongs(&proc.cwd, project_path) || path_belongs(&proc.args, project_path)\n",[219,5497,5498],{"class":2079,"line":2147},[219,5499,5500],{},"    })\n",[219,5502,5503],{"class":2079,"line":2153},[219,5504,4421],{},[219,5506,5507],{"class":2079,"line":2159},[219,5508,2132],{"emptyLinePlaceholder":2131},[219,5510,5511],{"class":2079,"line":2165},[219,5512,5513],{},"pub fn classify_hold(live: Option\u003C&ListeningPort>, project_path: &str) -> PortHold {\n",[219,5515,5516],{"class":2079,"line":2171},[219,5517,5518],{},"    match live {\n",[219,5520,5521],{"class":2079,"line":2177},[219,5522,5523],{},"        None => PortHold::Free,\n",[219,5525,5526],{"class":2079,"line":2183},[219,5527,5528],{},"        Some(row) if processes_belong_to_project(row, project_path) => PortHold::HeldByOwner,\n",[219,5530,5531],{"class":2079,"line":2189},[219,5532,5533],{},"        Some(_) => PortHold::Hijacked,\n",[219,5535,5536],{"class":2079,"line":2195},[219,5537,5538],{},"    }\n",[219,5540,5541],{"class":2079,"line":2201},[219,5542,4421],{},[119,5544,5546],{"className":5545},[122],[124,5547,5548,5551,5552,5555,5556,5559,5560,131,5563,5566,5567,5570,5571,5574,5575,5578,5579,5586],{},[516,5549,5550],{},"path_belongs"," normalises separators and accepts exact path, prefix (",[516,5553,5554],{},"project/…","), or args that embed the project root (common for ",[516,5557,5558],{},"node …/project/node_modules/…","). Infra services (",[516,5561,5562],{},"postgres",[516,5564,5565],{},"redis",", classic ",[516,5568,5569],{},"5432","/",[516,5572,5573],{},"6379",") are ",[128,5576,5577],{},"claimed in the UI"," but ",[128,5580,5581,5582,5585],{},"ignored for ",[516,5583,5584],{},"ports_live"," / Running"," — a shared DB must not make every enrolled app look up.",[119,5588,5590],{"className":5589},[122],[124,5591,5592],{},"Reconcile folds that into project status:",[580,5594,5596],{"className":5439,"code":5595,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/ports/mod.rs — reconcile_live_status (excerpt)\n\nlet live_rows = list_system_listening(std::slice::from_ref(project)).unwrap_or_default();\nlet mut owned_live = false;\nfor service in &project.manifest.services {\n    let Some(port) = service.port else { continue };\n    if is_infra_service(service) {\n        continue;\n    }\n    let row = live_rows.iter().find(|p| p.port == port);\n    if classify_hold(row, &project.path) == PortHold::HeldByOwner {\n        owned_live = true;\n        break;\n    }\n}\nproject.ports_live = owned_live;\n",[516,5597,5598,5603,5607,5612,5617,5622,5627,5632,5637,5641,5646,5651,5656,5661,5665,5669],{"__ignoreMap":588},[219,5599,5600],{"class":2079,"line":2080},[219,5601,5602],{},"// apps/hub/src-tauri/src/ports/mod.rs — reconcile_live_status (excerpt)\n",[219,5604,5605],{"class":2079,"line":2086},[219,5606,2132],{"emptyLinePlaceholder":2131},[219,5608,5609],{"class":2079,"line":2092},[219,5610,5611],{},"let live_rows = list_system_listening(std::slice::from_ref(project)).unwrap_or_default();\n",[219,5613,5614],{"class":2079,"line":2098},[219,5615,5616],{},"let mut owned_live = false;\n",[219,5618,5619],{"class":2079,"line":2104},[219,5620,5621],{},"for service in &project.manifest.services {\n",[219,5623,5624],{"class":2079,"line":2110},[219,5625,5626],{},"    let Some(port) = service.port else { continue };\n",[219,5628,5629],{"class":2079,"line":2116},[219,5630,5631],{},"    if is_infra_service(service) {\n",[219,5633,5634],{"class":2079,"line":2122},[219,5635,5636],{},"        continue;\n",[219,5638,5639],{"class":2079,"line":2128},[219,5640,5538],{},[219,5642,5643],{"class":2079,"line":2135},[219,5644,5645],{},"    let row = live_rows.iter().find(|p| p.port == port);\n",[219,5647,5648],{"class":2079,"line":2141},[219,5649,5650],{},"    if classify_hold(row, &project.path) == PortHold::HeldByOwner {\n",[219,5652,5653],{"class":2079,"line":2147},[219,5654,5655],{},"        owned_live = true;\n",[219,5657,5658],{"class":2079,"line":2153},[219,5659,5660],{},"        break;\n",[219,5662,5663],{"class":2079,"line":2159},[219,5664,5538],{},[219,5666,5667],{"class":2079,"line":2165},[219,5668,4421],{},[219,5670,5671],{"class":2079,"line":2171},[219,5672,5673],{},"project.ports_live = owned_live;\n",[119,5675,5677,5683],{"className":5676},[182,183,184],[186,5678,5680],{"id":5679},"_2-start-must-reclaim-not-politely-fail",[128,5681,5682],{},"2. Start must reclaim, not politely fail",[124,5684,5685],{},[195,5686,5687],{"href":197},[128,5688,200],{},[119,5690,5692],{"className":5691},[2068],[124,5693,5694],{},[5369,5695],{"alt":5696,"src":5697},"Project workspace — Start follows hub.yaml, then reclaim","/blog/mikeshub/03-project-detail.png",[119,5699,5701],{"className":5700},[122],[124,5702,5703],{},[168,5704,5705,5706,5709,5710,5713,5714,5717,5718,5721,5722,5724,5725,139],{},"Multi-service vertical (",[516,5707,5708],{},"insurance-vertical","): UI ",[516,5711,5712],{},":5810",", API ",[516,5715,5716],{},":3810",", Postgres ",[516,5719,5720],{},":5433",", worker without a listen port. The sticky note is the contract: reload ",[516,5723,5310],{}," → stop wrong holders → ",[516,5726,5727],{},"scripts.start",[119,5729,5731],{"className":5730},[122],[124,5732,5733,5734,5737,5738,5741,5742,5744],{},"On Start, if a reserved ",[128,5735,5736],{},"app"," port is ",[516,5739,5740],{},"Hijacked",", the hub TERMs those PIDs, invalidates the listen cache, waits briefly for the OS to release sockets, then runs ",[516,5743,5727],{},". Skipping infra avoids murdering a shared Postgres because your UI port was free.",[580,5746,5748],{"className":5439,"code":5747,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/ports/mod.rs — reclaim_mismatched_ports (core loop)\n\nfor service in &project.manifest.services {\n    let Some(port) = service.port else { continue };\n    if is_infra_service(service) {\n        continue;\n    }\n    let Some(row) = all.iter().find(|p| p.port == port) else {\n        continue;\n    };\n    if classify_hold(Some(row), &project.path) != PortHold::Hijacked {\n        continue;\n    }\n    for proc in &row.processes {\n        if !pids.contains(&proc.pid) {\n            pids.push(proc.pid);\n        }\n    }\n    notes.push(format!(\n        \"Stopped wrong holder on :{} ({}) — reserved for {} / {}\",\n        port,\n        holder_summary(row),\n        project.manifest.name,\n        service.name\n    ));\n}\n\nlistening::invalidate_listen_cache();\nlet killed = listening::kill_pids(&pids, false)?;\nstd::thread::sleep(Duration::from_millis(500));\n",[516,5749,5750,5755,5759,5763,5767,5771,5775,5779,5784,5788,5793,5798,5802,5806,5811,5816,5821,5826,5830,5835,5840,5845,5850,5855,5860,5865,5869,5873,5878,5883],{"__ignoreMap":588},[219,5751,5752],{"class":2079,"line":2080},[219,5753,5754],{},"// apps/hub/src-tauri/src/ports/mod.rs — reclaim_mismatched_ports (core loop)\n",[219,5756,5757],{"class":2079,"line":2086},[219,5758,2132],{"emptyLinePlaceholder":2131},[219,5760,5761],{"class":2079,"line":2092},[219,5762,5621],{},[219,5764,5765],{"class":2079,"line":2098},[219,5766,5626],{},[219,5768,5769],{"class":2079,"line":2104},[219,5770,5631],{},[219,5772,5773],{"class":2079,"line":2110},[219,5774,5636],{},[219,5776,5777],{"class":2079,"line":2116},[219,5778,5538],{},[219,5780,5781],{"class":2079,"line":2122},[219,5782,5783],{},"    let Some(row) = all.iter().find(|p| p.port == port) else {\n",[219,5785,5786],{"class":2079,"line":2128},[219,5787,5636],{},[219,5789,5790],{"class":2079,"line":2135},[219,5791,5792],{},"    };\n",[219,5794,5795],{"class":2079,"line":2141},[219,5796,5797],{},"    if classify_hold(Some(row), &project.path) != PortHold::Hijacked {\n",[219,5799,5800],{"class":2079,"line":2147},[219,5801,5636],{},[219,5803,5804],{"class":2079,"line":2153},[219,5805,5538],{},[219,5807,5808],{"class":2079,"line":2159},[219,5809,5810],{},"    for proc in &row.processes {\n",[219,5812,5813],{"class":2079,"line":2165},[219,5814,5815],{},"        if !pids.contains(&proc.pid) {\n",[219,5817,5818],{"class":2079,"line":2171},[219,5819,5820],{},"            pids.push(proc.pid);\n",[219,5822,5823],{"class":2079,"line":2177},[219,5824,5825],{},"        }\n",[219,5827,5828],{"class":2079,"line":2183},[219,5829,5538],{},[219,5831,5832],{"class":2079,"line":2189},[219,5833,5834],{},"    notes.push(format!(\n",[219,5836,5837],{"class":2079,"line":2195},[219,5838,5839],{},"        \"Stopped wrong holder on :{} ({}) — reserved for {} / {}\",\n",[219,5841,5842],{"class":2079,"line":2201},[219,5843,5844],{},"        port,\n",[219,5846,5847],{"class":2079,"line":2207},[219,5848,5849],{},"        holder_summary(row),\n",[219,5851,5852],{"class":2079,"line":2213},[219,5853,5854],{},"        project.manifest.name,\n",[219,5856,5857],{"class":2079,"line":2219},[219,5858,5859],{},"        service.name\n",[219,5861,5862],{"class":2079,"line":2225},[219,5863,5864],{},"    ));\n",[219,5866,5867],{"class":2079,"line":2230},[219,5868,4421],{},[219,5870,5871],{"class":2079,"line":2236},[219,5872,2132],{"emptyLinePlaceholder":2131},[219,5874,5875],{"class":2079,"line":2242},[219,5876,5877],{},"listening::invalidate_listen_cache();\n",[219,5879,5880],{"class":2079,"line":2247},[219,5881,5882],{},"let killed = listening::kill_pids(&pids, false)?;\n",[219,5884,5885],{"class":2079,"line":2253},[219,5886,5887],{},"std::thread::sleep(Duration::from_millis(500));\n",[119,5889,5891,5897],{"className":5890},[182,183,184],[186,5892,5894],{"id":5893},"_3-performance-one-listen-scan-many-consumers",[128,5895,5896],{},"3. Performance: one listen scan, many consumers",[124,5898,5899],{},[195,5900,5901],{"href":197},[128,5902,200],{},[119,5904,5906],{"className":5905},[122],[124,5907,5908,5909,1525,5912,5570,5914,5917],{},"Early Ports UI felt sticky because every tick did ",[128,5910,5911],{},"multiple",[516,5913,5329],{},[516,5915,5916],{},"ps"," walks (per-project reconcile + dual tables + aggressive React loading thrash). The fix is boring systems work:",[325,5919,5920,5926,5934,5942],{},[328,5921,5922,5925],{},[128,5923,5924],{},"Global listen cache"," (TTL ~4s), invalidated on kill / refresh",[328,5927,5928,5933],{},[128,5929,5930],{},[516,5931,5932],{},"ports_snapshot",": one scan → decorate declared matches → derive service runtimes",[328,5935,5936,5941],{},[128,5937,5938],{},[516,5939,5940],{},"projects_snapshot",": clone without re-reconciling every project",[328,5943,5944,5945],{},"UI: soft poll (no full-panel spinner), floor ≥5s, mount ",[128,5946,5947],{},"cards XOR table",[580,5949,5951],{"className":5439,"code":5950,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/commands/ports.rs\n\npub fn ports_snapshot(state: State\u003C'_, AppState>) -> HubResult\u003CPortsSnapshot> {\n    // One listen scan (cached briefly) drives both tables — avoid double lsof/ps.\n    let projects = state.projects_snapshot();\n    let listening = ports::list_system_listening(&projects)?;\n    let services = ports::list_service_runtimes_from(&projects, &listening);\n    let total_rss_bytes = listening.iter().map(|p| p.rss_bytes).sum();\n    Ok(PortsSnapshot {\n        services,\n        listening,\n        total_rss_bytes,\n        total_rss_human: listening::format_bytes(total_rss_bytes),\n    })\n}\n",[516,5952,5953,5958,5962,5967,5972,5977,5982,5987,5992,5997,6002,6007,6012,6017,6021],{"__ignoreMap":588},[219,5954,5955],{"class":2079,"line":2080},[219,5956,5957],{},"// apps/hub/src-tauri/src/commands/ports.rs\n",[219,5959,5960],{"class":2079,"line":2086},[219,5961,2132],{"emptyLinePlaceholder":2131},[219,5963,5964],{"class":2079,"line":2092},[219,5965,5966],{},"pub fn ports_snapshot(state: State\u003C'_, AppState>) -> HubResult\u003CPortsSnapshot> {\n",[219,5968,5969],{"class":2079,"line":2098},[219,5970,5971],{},"    // One listen scan (cached briefly) drives both tables — avoid double lsof/ps.\n",[219,5973,5974],{"class":2079,"line":2104},[219,5975,5976],{},"    let projects = state.projects_snapshot();\n",[219,5978,5979],{"class":2079,"line":2110},[219,5980,5981],{},"    let listening = ports::list_system_listening(&projects)?;\n",[219,5983,5984],{"class":2079,"line":2116},[219,5985,5986],{},"    let services = ports::list_service_runtimes_from(&projects, &listening);\n",[219,5988,5989],{"class":2079,"line":2122},[219,5990,5991],{},"    let total_rss_bytes = listening.iter().map(|p| p.rss_bytes).sum();\n",[219,5993,5994],{"class":2079,"line":2128},[219,5995,5996],{},"    Ok(PortsSnapshot {\n",[219,5998,5999],{"class":2079,"line":2135},[219,6000,6001],{},"        services,\n",[219,6003,6004],{"class":2079,"line":2141},[219,6005,6006],{},"        listening,\n",[219,6008,6009],{"class":2079,"line":2147},[219,6010,6011],{},"        total_rss_bytes,\n",[219,6013,6014],{"class":2079,"line":2153},[219,6015,6016],{},"        total_rss_human: listening::format_bytes(total_rss_bytes),\n",[219,6018,6019],{"class":2079,"line":2159},[219,6020,5500],{},[219,6022,6023],{"class":2079,"line":2165},[219,6024,4421],{},[119,6026,6028],{"className":6027},[122],[124,6029,6030,6031,6034,6035,3390,6037,6040],{},"The scan path itself is still expensive by nature: ",[516,6032,6033],{},"lsof -nP -iTCP -sTCP:LISTEN",", then batch ",[516,6036,5916],{},[516,6038,6039],{},"lsof -a -d cwd -p …"," for RSS/cwd/parent. Caching is what makes polling acceptable.",[580,6042,6044],{"className":5439,"code":6043,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/ports/listening.rs — cache gate\n\nfn cached_or_scan() -> HubResult\u003CVec\u003CListeningPort>> {\n    {\n        let guard = LISTEN_CACHE.lock();\n        if let Some(cache) = guard.as_ref() {\n            if cache.at.elapsed() \u003C LISTEN_CACHE_TTL {\n                return Ok(cache.ports.clone());\n            }\n        }\n    }\n    let ports = scan_listening_ports()?;\n    *LISTEN_CACHE.lock() = Some(ListenCache {\n        at: Instant::now(),\n        ports: ports.clone(),\n    });\n    Ok(ports)\n}\n",[516,6045,6046,6051,6055,6060,6065,6070,6075,6080,6085,6090,6094,6098,6103,6108,6113,6118,6123,6128],{"__ignoreMap":588},[219,6047,6048],{"class":2079,"line":2080},[219,6049,6050],{},"// apps/hub/src-tauri/src/ports/listening.rs — cache gate\n",[219,6052,6053],{"class":2079,"line":2086},[219,6054,2132],{"emptyLinePlaceholder":2131},[219,6056,6057],{"class":2079,"line":2092},[219,6058,6059],{},"fn cached_or_scan() -> HubResult\u003CVec\u003CListeningPort>> {\n",[219,6061,6062],{"class":2079,"line":2098},[219,6063,6064],{},"    {\n",[219,6066,6067],{"class":2079,"line":2104},[219,6068,6069],{},"        let guard = LISTEN_CACHE.lock();\n",[219,6071,6072],{"class":2079,"line":2110},[219,6073,6074],{},"        if let Some(cache) = guard.as_ref() {\n",[219,6076,6077],{"class":2079,"line":2116},[219,6078,6079],{},"            if cache.at.elapsed() \u003C LISTEN_CACHE_TTL {\n",[219,6081,6082],{"class":2079,"line":2122},[219,6083,6084],{},"                return Ok(cache.ports.clone());\n",[219,6086,6087],{"class":2079,"line":2128},[219,6088,6089],{},"            }\n",[219,6091,6092],{"class":2079,"line":2135},[219,6093,5825],{},[219,6095,6096],{"class":2079,"line":2141},[219,6097,5538],{},[219,6099,6100],{"class":2079,"line":2147},[219,6101,6102],{},"    let ports = scan_listening_ports()?;\n",[219,6104,6105],{"class":2079,"line":2153},[219,6106,6107],{},"    *LISTEN_CACHE.lock() = Some(ListenCache {\n",[219,6109,6110],{"class":2079,"line":2159},[219,6111,6112],{},"        at: Instant::now(),\n",[219,6114,6115],{"class":2079,"line":2165},[219,6116,6117],{},"        ports: ports.clone(),\n",[219,6119,6120],{"class":2079,"line":2171},[219,6121,6122],{},"    });\n",[219,6124,6125],{"class":2079,"line":2177},[219,6126,6127],{},"    Ok(ports)\n",[219,6129,6130],{"class":2079,"line":2183},[219,6131,4421],{},[119,6133,6135,6141],{"className":6134},[182,183,184],[186,6136,6138],{"id":6137},"_4-dbeaver-process-lifecycle-vs-connection-semantics",[128,6139,6140],{},"4. DBeaver: process lifecycle vs connection semantics",[124,6142,6143],{},[195,6144,6145],{"href":197},[128,6146,200],{},[119,6148,6150],{"className":6149},[2068],[124,6151,6152],{},[5369,6153],{"alt":6154,"src":6155},"Workspace with Database schema → DBeaver","/blog/mikeshub/01-project-workspace.png",[119,6157,6159],{"className":6158},[122],[124,6160,6161],{},[168,6162,6163,6164,6167,6168,6171],{},"Project desk for ",[516,6165,6166],{},"krishna360",": links include ",[128,6169,6170],{},"Database schema"," (ER + open DBeaver). Connection details resolve from the project’s local env files (never committed); cloud dashboard URLs stay out of screenshots.",[119,6173,6175],{"className":6174},[122],[124,6176,6177],{},"Three failure modes taught the API:",[458,6179,6180,6189,6207],{},[328,6181,6182,6188],{},[128,6183,6184,6187],{},[516,6185,6186],{},".status()"," on the DBeaver binary"," — GUI never exits → Tauri invoke hangs forever.",[328,6190,6191,6196,6197,549,6200,1525,6203,6206],{},[128,6192,6193],{},[516,6194,6195],{},"openConsole=true"," — DBeaver’s instance server opens an SQL ",[168,6198,6199],{},"editor tab",[128,6201,6202],{},"skips",[516,6204,6205],{},"connectToDataSource"," (navigator connect).",[328,6208,6209,6212,6213,6216],{},[128,6210,6211],{},"Shared personal workspace"," — demos polluted with every other connection; the hub writes a ",[128,6214,6215],{},"project-only"," datasource file instead of reusing your personal graph.",[119,6218,6220],{"className":6219},[122],[124,6221,6222,6223,6226,6227,6229,6230,6232],{},"The path that works: write an isolated Eclipse workspace under Application Support, quit only prior MikesHub-workspace PIDs, spawn with ",[516,6224,6225],{},"-newInstance -data \u003Cws> -closeTabs -con '…|openConsole=false|connect=true|…'"," — credentials come from the project’s local env at runtime and are ",[128,6228,601],{}," embedded in ",[516,6231,5310],{}," or blog assets.",[580,6234,6236],{"className":5439,"code":6235,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/db/mod.rs — open_dbeaver (shape)\n\nlet workspace = mikeshub_dbeaver_workspace()?;\nwrite_project_only_datasource(/* id, host, user, jdbc — sole connection */)?;\n\nquit_mikeshub_dbeaver(&ws); // do not quit the user’s main DBeaver\n\nCommand::new(&bin)\n    .args([\n        \"-newInstance\",\n        \"-data\", &ws,\n        \"-closeTabs\",\n        \"-con\", &con, // openConsole=false · connect=true — no secrets in this snippet\n        \"-bringToFront\",\n    ])\n    .spawn()?; // never .status() on the GUI process\n",[516,6237,6238,6243,6247,6252,6257,6261,6266,6270,6275,6280,6285,6290,6295,6303,6308,6313],{"__ignoreMap":588},[219,6239,6240],{"class":2079,"line":2080},[219,6241,6242],{},"// apps/hub/src-tauri/src/db/mod.rs — open_dbeaver (shape)\n",[219,6244,6245],{"class":2079,"line":2086},[219,6246,2132],{"emptyLinePlaceholder":2131},[219,6248,6249],{"class":2079,"line":2092},[219,6250,6251],{},"let workspace = mikeshub_dbeaver_workspace()?;\n",[219,6253,6254],{"class":2079,"line":2098},[219,6255,6256],{},"write_project_only_datasource(/* id, host, user, jdbc — sole connection */)?;\n",[219,6258,6259],{"class":2079,"line":2104},[219,6260,2132],{"emptyLinePlaceholder":2131},[219,6262,6263],{"class":2079,"line":2110},[219,6264,6265],{},"quit_mikeshub_dbeaver(&ws); // do not quit the user’s main DBeaver\n",[219,6267,6268],{"class":2079,"line":2116},[219,6269,2132],{"emptyLinePlaceholder":2131},[219,6271,6272],{"class":2079,"line":2122},[219,6273,6274],{},"Command::new(&bin)\n",[219,6276,6277],{"class":2079,"line":2128},[219,6278,6279],{},"    .args([\n",[219,6281,6282],{"class":2079,"line":2135},[219,6283,6284],{},"        \"-newInstance\",\n",[219,6286,6287],{"class":2079,"line":2141},[219,6288,6289],{},"        \"-data\", &ws,\n",[219,6291,6292],{"class":2079,"line":2147},[219,6293,6294],{},"        \"-closeTabs\",\n",[219,6296,6297,6300],{"class":2079,"line":2153},[219,6298,6299],{},"        \"-con\", &con,",[219,6301,6302],{}," // openConsole=false · connect=true — no secrets in this snippet\n",[219,6304,6305],{"class":2079,"line":2159},[219,6306,6307],{},"        \"-bringToFront\",\n",[219,6309,6310],{"class":2079,"line":2165},[219,6311,6312],{},"    ])\n",[219,6314,6315],{"class":2079,"line":2171},[219,6316,6317],{},"    .spawn()?; // never .status() on the GUI process\n",[119,6319,6321,6327],{"className":6320},[182,183,184],[186,6322,6324],{"id":6323},"_5-enroll-update-without-clobbering-hand-tuned-yaml",[128,6325,6326],{},"5. Enroll update without clobbering hand-tuned YAML",[124,6328,6329],{},[195,6330,6331],{"href":197},[128,6332,200],{},[119,6334,6336],{"className":6335},[122],[124,6337,6338,6340,6341,6344,6345,6347,6348,6351,6352,5570,6355,5570,6358,6361,6362,6364],{},[516,6339,5310],{}," is the contract you commit. Auto-detect is useful once; afterwards ",[128,6342,6343],{},"Update"," must merge: keep custom ports/scripts/links, append only ",[168,6346,1777],{}," services — matched by name ",[128,6349,6350],{},"or"," role heuristics (",[516,6353,6354],{},"api",[516,6356,6357],{},"web",[516,6359,6360],{},"db",") ",[128,6363,6350],{}," same port.",[580,6366,6368],{"className":5439,"code":6367,"language":5441,"meta":588,"style":588},"// apps/hub/src-tauri/src/enroll.rs — merge_with_existing (service merge)\n\nfor svc in detected.services {\n    let exists = merged.iter().any(|m| {\n        let a = m.name.to_lowercase();\n        let b = svc.name.to_lowercase();\n        a == b\n            || (is_api_role(&a) && is_api_role(&b))\n            || (is_web_role(&a) && is_web_role(&b))\n            || (is_db_role(&a) && is_db_role(&b))\n            || m.port == svc.port\n    });\n    if !exists {\n        merged.push(svc);\n    }\n}\ndetected.services = dedupe_services(merged);\n",[516,6369,6370,6375,6379,6384,6389,6394,6399,6404,6409,6414,6419,6424,6428,6433,6438,6442,6446],{"__ignoreMap":588},[219,6371,6372],{"class":2079,"line":2080},[219,6373,6374],{},"// apps/hub/src-tauri/src/enroll.rs — merge_with_existing (service merge)\n",[219,6376,6377],{"class":2079,"line":2086},[219,6378,2132],{"emptyLinePlaceholder":2131},[219,6380,6381],{"class":2079,"line":2092},[219,6382,6383],{},"for svc in detected.services {\n",[219,6385,6386],{"class":2079,"line":2098},[219,6387,6388],{},"    let exists = merged.iter().any(|m| {\n",[219,6390,6391],{"class":2079,"line":2104},[219,6392,6393],{},"        let a = m.name.to_lowercase();\n",[219,6395,6396],{"class":2079,"line":2110},[219,6397,6398],{},"        let b = svc.name.to_lowercase();\n",[219,6400,6401],{"class":2079,"line":2116},[219,6402,6403],{},"        a == b\n",[219,6405,6406],{"class":2079,"line":2122},[219,6407,6408],{},"            || (is_api_role(&a) && is_api_role(&b))\n",[219,6410,6411],{"class":2079,"line":2128},[219,6412,6413],{},"            || (is_web_role(&a) && is_web_role(&b))\n",[219,6415,6416],{"class":2079,"line":2135},[219,6417,6418],{},"            || (is_db_role(&a) && is_db_role(&b))\n",[219,6420,6421],{"class":2079,"line":2141},[219,6422,6423],{},"            || m.port == svc.port\n",[219,6425,6426],{"class":2079,"line":2147},[219,6427,6122],{},[219,6429,6430],{"class":2079,"line":2153},[219,6431,6432],{},"    if !exists {\n",[219,6434,6435],{"class":2079,"line":2159},[219,6436,6437],{},"        merged.push(svc);\n",[219,6439,6440],{"class":2079,"line":2165},[219,6441,5538],{},[219,6443,6444],{"class":2079,"line":2171},[219,6445,4421],{},[219,6447,6448],{"class":2079,"line":2177},[219,6449,6450],{},"detected.services = dedupe_services(merged);\n",[119,6452,6454],{"className":6453},[122],[124,6455,6456,6457,6460,6461,6463,6464,6467],{},"That is why AUDIT4 can declare Nuxt ",[516,6458,6459],{},":4444"," plus mcp-ai-act ",[516,6462,5390],{}," (API ",[128,6465,6466],{},"and"," static UI on the same port) without Enroll “refresh” wiping the hand-written Start that runs both trees.",[119,6469,6471,6477],{"className":6470},[182,183,184],[186,6472,6474],{"id":6473},"_6-awp-spec-kit-who-owns-what",[128,6475,6476],{},"6. AWP + Spec Kit: who owns what",[124,6478,6479],{},[195,6480,6481],{"href":197},[128,6482,200],{},[580,6484,6486],{"className":2072,"code":6485,"language":2074,"meta":588,"style":588},"flowchart TB\n  subgraph Contract[\"Spec Kit — feature authority\"]\n    S[spec.md]\n    P[plan.md]\n    T[tasks.md]\n  end\n  subgraph Pace[\"AWP — agent pacing\"]\n    U[awp update]\n    C[awp commit]\n    N[awp next]\n    U --> C --> N\n  end\n  subgraph Human[\"Human gates\"]\n    H[clarify scope · accept diffs · no silent initiative]\n  end\n  Contract --> Pace\n  Pace --> Human\n  Human -->|merge| Git[(hub.yaml + Rust/TS)]\n",[516,6487,6488,6492,6497,6502,6507,6512,6516,6521,6526,6531,6536,6541,6545,6550,6555,6559,6564,6569],{"__ignoreMap":588},[219,6489,6490],{"class":2079,"line":2080},[219,6491,3818],{},[219,6493,6494],{"class":2079,"line":2086},[219,6495,6496],{},"  subgraph Contract[\"Spec Kit — feature authority\"]\n",[219,6498,6499],{"class":2079,"line":2092},[219,6500,6501],{},"    S[spec.md]\n",[219,6503,6504],{"class":2079,"line":2098},[219,6505,6506],{},"    P[plan.md]\n",[219,6508,6509],{"class":2079,"line":2104},[219,6510,6511],{},"    T[tasks.md]\n",[219,6513,6514],{"class":2079,"line":2110},[219,6515,3143],{},[219,6517,6518],{"class":2079,"line":2116},[219,6519,6520],{},"  subgraph Pace[\"AWP — agent pacing\"]\n",[219,6522,6523],{"class":2079,"line":2122},[219,6524,6525],{},"    U[awp update]\n",[219,6527,6528],{"class":2079,"line":2128},[219,6529,6530],{},"    C[awp commit]\n",[219,6532,6533],{"class":2079,"line":2135},[219,6534,6535],{},"    N[awp next]\n",[219,6537,6538],{"class":2079,"line":2141},[219,6539,6540],{},"    U --> C --> N\n",[219,6542,6543],{"class":2079,"line":2147},[219,6544,3143],{},[219,6546,6547],{"class":2079,"line":2153},[219,6548,6549],{},"  subgraph Human[\"Human gates\"]\n",[219,6551,6552],{"class":2079,"line":2159},[219,6553,6554],{},"    H[clarify scope · accept diffs · no silent initiative]\n",[219,6556,6557],{"class":2079,"line":2165},[219,6558,3143],{},[219,6560,6561],{"class":2079,"line":2171},[219,6562,6563],{},"  Contract --> Pace\n",[219,6565,6566],{"class":2079,"line":2177},[219,6567,6568],{},"  Pace --> Human\n",[219,6570,6571],{"class":2079,"line":2183},[219,6572,6573],{},"  Human -->|merge| Git[(hub.yaml + Rust/TS)]\n",[119,6575,6577],{"className":6576},[122],[124,6578,6579,6581,6582,6584,6585,6581,6587,6589,6590,6593,6594,6597,6598,6601],{},[128,6580,5344],{}," answered ",[168,6583,2954],{}," MikesHub is (wake demos, ports view, links, Start Spec). ",[128,6586,4715],{},[168,6588,2962],{}," the agent may proceed: read ",[516,6591,6592],{},"AWP.md"," on any ",[516,6595,6596],{},"awp*"," command; never skip ",[516,6599,6600],{},"update → commit → next"," without permission; ask when “next to the end” is ambiguous; never put “AI” in commit messages; park surprises in Unplanned Tasks.",[119,6603,6605],{"className":6604},[122],[124,6606,6607,6608,6610],{},"Useful agent wins under that envelope: ownership/reclaim design, listen-cache + snapshot, DBeaver CLI archaeology, monorepo local-env resolution (nested app folders). Useful human vetoes: no live Vite iframe inside the hub; never wait on DBeaver’s process; never dump the personal DBeaver graph into a demo; never commit credentials into ",[516,6609,5310],{}," or screenshots.",[119,6612,6614,6620],{"className":6613},[182,183,184],[186,6615,6617],{"id":6616},"closing",[128,6618,6619],{},"Closing",[124,6621,6622],{},[195,6623,6624],{"href":197},[128,6625,200],{},[119,6627,6629],{"className":6628},[122],[124,6630,6631,6632,6635,6636,549,6639,6642],{},"If you only need a prettier ",[516,6633,6634],{},"npm run dev",", skip MikesHub. If you run many stacks and have been bitten by ",[128,6637,6638],{},"shared ports",[128,6640,6641],{},"half-started"," multi-repo demos, the leverage is the ownership model + reclaim + a single listen snapshot — with Spec Kit for the product spine and AWP so the agent does not outrun the contract.",[2824,6644,2826],{},{"title":588,"searchDepth":2086,"depth":2086,"links":6646},[6647,6648,6649,6650,6651,6652,6653],{"id":5397,"depth":2086,"text":5400},{"id":5679,"depth":2086,"text":5682},{"id":5893,"depth":2086,"text":5896},{"id":6137,"depth":2086,"text":6140},{"id":6323,"depth":2086,"text":6326},{"id":6473,"depth":2086,"text":6476},{"id":6616,"depth":2086,"text":6619},"2026-10-16","How a local demo desk classifies hijacked ports via cwd, snapshots lsof once, opens DBeaver in an isolated workspace — built under Spec Kit + AWP, not vibes.",{"src":5372},{},{"title":19,"description":6655},"F_b9RUINYGAaW3xCXeUYBie62IjP55LvVFAO0of_Ia4",1794268626236]