AI-Core Jev Software Architecture

Release — ปล่อย workflow ทั้งชุดพร้อมหลักฐานและทางย้อนกลับRelease the Whole Workflow with Evidence and a Rollback

รวมสถาปัตยกรรม แยกการผ่าน runtime จากอนุมัติ release และวางแผนย้ายระบบโดยวัดผลเป็นขั้นBring the architecture together, distinguish runtime acceptance from release approval, and plan a measured migration.

By Anirach Mingkhwan Software Engineering with AI-Core 2026 • Post #15 2 min read
Release — ปล่อย workflow ทั้งชุดพร้อมหลักฐานและทางย้อนกลับ
ในบทความนี้
  1. 1. ปัญหาทางวิศวกรรม
  2. 2. ขอบเขตที่ต้องออกแบบ
  3. 3. อ่าน implementation
  4. 4. เปรียบเทียบผลที่ได้
  5. 5. รัน ทำให้พัง และอธิบาย
  6. 6. แหล่งอ้างอิงและขอบเขต
In this post
  1. 1. The engineering problem
  2. 2. The boundary to design
  3. 3. Read the implementation
  4. 4. Compare the outcomes
  5. 5. Run, break, and explain
  6. 6. Sources and limits

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. ขอบเขตที่ต้องออกแบบ

ตอน 15: response ผ่านหนึ่งครั้งก็ถือว่าปล่อยระบบได้ → release ต้องมีหลักฐานแยกและมีทางย้อนกลับ
ภาพที่ 1 ขอบเขตหน้าที่และเส้นทางหยุด เปิดภาพเพื่อดูขนาดเต็ม

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 และการส่งต่อคนเข้าไป

ทางเดินครบ: input, policy, Jev, semantic input, context, candidate, output, behavior, quality และมนุษย์ตรวจ งานไม่ผ่านต้องหยุดหรือแก้ภายในงบ
ภาพที่ 2 workflow ครบชุด โมเดลเสนอ host ควบคุม และแยกการอนุมัติ release

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

  1. Google SRE, Monitoring Distributed SystemsOperational monitoring and actionable signals.
  2. 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

Part 15: One accepted response is taken as permission to release. The controlled path is Versioned manifest to Held-out evidence to Shadow + signoff to Observe / rollback. Release requires separate evidence; rollback stays available.
Figure 1. Runtime trace + release record + rollback plan. Open the diagram for full resolution.

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.

Complete pipeline: input, policy, Jev response validation, semantic input, context, candidate, output language, behavior, quality, human review. All non-pass paths stop or use bounded revision.
Figure 2. The complete workflow. Models propose; host code mediates. Release approval is separate.

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 evidence

Migrate 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

ApproachObservable outcome
Before this controlOne accepted response is taken as permission to release.
After this controlRelease 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 -v

Your 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.

  1. Google SRE, Monitoring Distributed SystemsOperational monitoring and actionable signals.
  2. GitHub, Secure use referenceProtected credentials and untrusted-code handling.
จากซีรีส์ Software Engineering with AI-CoreFrom Software Engineering with AI-Core