ในบทความนี้
In this post
1. ปัญหาทางวิศวกรรม
เป้าหมายบทนี้
รวมสถาปัตยกรรม แยกการผ่าน runtime จากอนุมัติ release และวางแผนย้ายระบบโดยวัดผลเป็นขั้น
เราเริ่มจาก source string และจบด้วยร่างที่มีหลักฐานประกอบ สถาปัตยกรรมมี input check ที่แน่นอน policy ที่อิงตัวตน คำตัดสิน Jev แบบมีชนิด skill ที่ผ่านตรวจ context จำกัดขอบเขต output validation เชิงโครงสร้าง behavior test อิสระ quality gate แยก และ recovery ที่มีเพดาน accepted_draft สุดท้ายยังไม่มีผลภายนอก เป็นขอบเขตโดยตั้งใจของ workbench เพื่อการสอน ระบบเขียนโค้ด production ต้องเพิ่ม execution และ effect mediation ที่ตรวจแยกก่อนรับอำนาจมากขึ้น
runtime gate ถามว่า candidate หนึ่งชิ้นเดินต่อภายใต้ release ปัจจุบันได้หรือไม่ ส่วน release gate ถามว่า workflow รุ่นหนึ่งพร้อมรับ traffic หรือยัง release_gate ใน companion ระบุชัดว่าเป็น checklist ตัวอย่าง ต้องมี held-out evidence, manifest match, rollback readiness, human signoff ยังไม่ได้ยืนยันตัวตนผู้อนุมัติหรือพิสูจน์ CI artifact หากหลักฐานขาดจะ review แม้ร่าง runtime ผ่าน ระบบจริงต้องตรวจหลักฐานที่ลงนามหรือยืนยันแหล่งได้ มี protected approval และ release record ที่แก้ย้อนหลังไม่ได้
2. ขอบเขตที่ต้องออกแบบ
manifest ระบุ policy, skill, routing questions, quality questions, decision model, context และ budget พร้อมบอก fixture mode ระบบจริงต้องตรึง application commit, generator model และ prompt, dependency, retrieval snapshot, evaluator configuration และ hash ของ evaluation dataset เพิ่มด้วย เก็บ trace ด้วยชื่อด่านและ reason code โดยลดข้อความอ่อนไหว ตรวจ accepted error, review backlog, coverage, latency และต้นทุนทั้งงาน แนว monitoring ของ Google SRE เป็นฐานปฏิบัติการ [1] คอร์สเพิ่มสัญญาณคุณภาพ AI และการส่งต่อคนเข้าไป
3. อ่าน implementation
ส่วนโค้ดจาก companion เพื่ออ่านประกอบ ใช้คำสั่งในหัวข้อ 5 เพื่อรันตัวอย่างที่ครบ dependency
def release_gate(report):
required = {"held_out", "manifest_match", "rollback_ready", "human_signoff"}
if not isinstance(report, dict) or not required.issubset(report):
return Gate("review", "release_evidence_missing")
if not all(report[k] is True for k in required):
return Gate("review", "release_not_ready")
# Toy checklist only: real evidence must be verified by an independent CI/release authority.
return Gate("pass", "tutorial_release_checklist")
ประกอบ pipeline ครบชุด
from workbench.runtime import run, request, FixtureProvider
from workbench.core import release_gate
result = run(request(), FixtureProvider())
assert result["state"] == "accepted_draft"
assert result["external_effects"] == 0
print(result["trace"])
print(release_gate({}).state) # review: missing release evidenceย้ายทีละขั้น เริ่มรันขนาน workflow เดิมโดยปิดผลภายนอกและเทียบผลที่มี label จากนั้นให้ maintainer ใช้ร่างโดยยังคงทาง review เดิม เพิ่มอำนาจเมื่อหลักฐาน held-out และปฏิบัติการรองรับ มี kill switch และ fallback แบบ deterministic หรือมนุษย์ที่รู้วิธีใช้ ระบุเจ้าของ skill catalog, policy, evaluation และ review queue ความรับผิดชอบใหม่ของวิศวกรคือระบบที่เปิดดูการตัดสิน สิทธิ์ และผลลัพธ์ได้ โมเดลเป็น dependency หนึ่งตัว ส่วนงานสถาปัตยกรรมทำให้ระบบนั้นใช้ได้จริง
4. เปรียบเทียบผลที่ได้
| เส้นทาง | ผลที่สังเกตได้ |
|---|---|
| ก่อนเพิ่มด่านนี้ | response ผ่านหนึ่งครั้งก็ถือว่าปล่อยระบบได้ |
| หลังเพิ่มด่านนี้ | release ต้องมีหลักฐานแยกและมีทางย้อนกลับ |
ผลต่อไปนี้มาจาก fixture ที่กำหนดคำตอบไว้เพื่อตรวจสถาปัตยกรรม ไม่ใช่ผลวัดความแม่น ความเร็ว หรือต้นทุนของ Jev จริง
{
"runtime": "accepted_draft",
"manifest": "1cf6cb85fa575b38a8966615bde05f6f4622d1eaffdd49fa40f77010e1fd334c",
"external_effects": 0,
"production_release": "review"
}
5. รัน ทำให้พัง และอธิบาย
Part 15 code · Implementation · Tests: test_release_separate_from_runtime · Exercise
git clone https://github.com/Anirach/ai-core-engineering-workbench.git
cd ai-core-engineering-workbench
git checkout 18cdfcd4156d3d02acb8badf3b3a0a823113e0ed
python3 -m workbench.lesson 15
python3 -m unittest tests.test_boundaries.BoundaryTests.test_release_separate_from_runtime -vลองทำด้วยตัวเอง
เขียนแผน shadow release ระบุเจ้าของ เงื่อนไขหยุด และรุ่นย้อนกลับ แล้วแจกแจง artifact ที่เปลี่ยนพฤติกรรมซึ่งต้องตรึง
สิ่งที่ต้องส่ง: input ที่ลอง สถานะและเหตุผลที่ได้ และคำอธิบายว่าด่านใดเป็นผู้รับผิดชอบ ห้ามแก้ expected result เพียงเพื่อให้ test ผ่าน
6. แหล่งอ้างอิงและขอบเขต
เอกสารต้นทางและข้อจำกัด
ตรวจเอกสาร 2 พฤศจิกายน 2026 ตัวอย่างและ threshold เป็นการออกแบบเพื่อการสอน การอ้าง [1], [2] ตรงกับลำดับข้างล่าง ยังไม่ได้วัด live API
- Google SRE, Monitoring Distributed SystemsOperational monitoring and actionable signals.
- GitHub, Secure use referenceProtected credentials and untrusted-code handling.
1. The engineering problem
Learning outcome
Bring the architecture together, distinguish runtime acceptance from release approval, and plan a measured migration.
We began with a source string and end with an evidence-carrying draft. The architecture now has exact input checks, authenticated policy, typed Jev decisions, reviewed skills, bounded context, structural output validation, independent behavior tests, a separate quality gate and finite recovery. Its final accepted_draft still causes zero external effects. That boundary is a feature of the teaching workbench. A production coding service must add independently reviewed execution and effect mediation before gaining more authority.
A runtime gate answers whether one candidate may proceed under an existing release. A release gate answers whether a version of the workflow is approved to serve traffic. The companion's release_gate is explicitly a toy checklist: held-out evidence, manifest match, rollback readiness and human signoff must all be present. It does not authenticate a release authority or verify a CI artifact. Missing evidence returns review even when a runtime draft passes. In production, require signed or otherwise authenticated evidence, protected approvals and an immutable release record.
2. The boundary to design
The manifest identifies policy, skill, routing questions, quality questions, decision model, context and budgets. The fixture mode is identified too. A production manifest must additionally pin the application commit, generator model and prompt, runtime dependencies, retrieval snapshot, evaluator configuration and evaluation dataset hashes. Preserve traces with stage and reason codes while minimizing sensitive text. Monitor accepted errors, review backlog, coverage, latency and full task cost. Google SRE's monitoring guidance supplies the operational foundation [1]; this course adds AI-specific quality and escalation signals.
3. Read the implementation
Implementation excerpt from the companion. Run the complete lesson below with its imports and fixtures.
def release_gate(report):
required = {"held_out", "manifest_match", "rollback_ready", "human_signoff"}
if not isinstance(report, dict) or not required.issubset(report):
return Gate("review", "release_evidence_missing")
if not all(report[k] is True for k in required):
return Gate("review", "release_not_ready")
# Toy checklist only: real evidence must be verified by an independent CI/release authority.
return Gate("pass", "tutorial_release_checklist")
Compose the complete workflow
from workbench.runtime import run, request, FixtureProvider
from workbench.core import release_gate
result = run(request(), FixtureProvider())
assert result["state"] == "accepted_draft"
assert result["external_effects"] == 0
print(result["trace"])
print(release_gate({}).state) # review: missing release evidenceMigrate in stages. First run beside the old workflow with effects disabled and compare labeled outcomes. Next allow maintainers to consume drafts while keeping the existing review path. Increase authority only after the held-out and operational evidence justify it. Keep a kill switch and a known deterministic or human fallback. Assign owners for the skill catalog, policy, evaluation and review queue. Your new engineering responsibility is a system whose decisions, permissions and outcomes can be inspected. The model is one dependency inside that system; the architecture is the work that makes it usable.
4. Compare the outcomes
| Approach | Observable outcome |
|---|---|
| Before this control | One accepted response is taken as permission to release. |
| After this control | Release requires separate evidence; rollback stays available. |
The following output comes from scripted fixtures that verify architecture behavior. It is not a measurement of live Jev accuracy, latency, or cost.
{
"runtime": "accepted_draft",
"manifest": "1cf6cb85fa575b38a8966615bde05f6f4622d1eaffdd49fa40f77010e1fd334c",
"external_effects": 0,
"production_release": "review"
}
5. Run, break, and explain
Part 15 code · Implementation · Tests: test_release_separate_from_runtime · Exercise
git clone https://github.com/Anirach/ai-core-engineering-workbench.git
cd ai-core-engineering-workbench
git checkout 18cdfcd4156d3d02acb8badf3b3a0a823113e0ed
python3 -m workbench.lesson 15
python3 -m unittest tests.test_boundaries.BoundaryTests.test_release_separate_from_runtime -vYour turn
Write a shadow-release plan with owners, stop conditions and a rollback target. Identify every behavior-changing artifact your release must pin.
Keep three artifacts: the input you tried, the resulting state and reason, and an explanation of which boundary owns that result. Do not change an expected result merely to make a test pass.
6. Sources and limits
Primary sources and evidence limits
Sources checked 2 November 2026. Examples and thresholds are teaching designs. Inline [1], [2] follow the order below. Live API performance has not been measured.
- Google SRE, Monitoring Distributed SystemsOperational monitoring and actionable signals.
- GitHub, Secure use referenceProtected credentials and untrusted-code handling.