Skip to content

Instantly share code, notes, and snippets.

@esz135888
Created May 23, 2026 19:33
Show Gist options
  • Select an option

  • Save esz135888/e206a8af5f5234d0448eac17c4cddf9f to your computer and use it in GitHub Desktop.

Select an option

Save esz135888/e206a8af5f5234d0448eac17c4cddf9f to your computer and use it in GitHub Desktop.
PLS job c313ffcb AI prediction evidence trial runner

Acceptance Tests

Artifact kind: e2e_verification.

D7 Trial Run 驗收

測試 方法 通過條件
Prediction seed 完整 檢查 50 筆 prediction_claim 100% 有 owner、due、expected evidence、impact metric
Evidence sync 跑 6 種 adapter 每種來源至少有 1 筆 normalized event 或明確 source_gap
Match labels 跑 matcher 50 筆都有 hit/miss/unknown
Unknown threshold 計算 unknown / 50 < 25%
Reviewer sample 抽 5 筆人工 sample sample rate >= 10%,且有 accept/override note
Miss routing 檢查 repeated miss reason 每個 repeated miss reason 有 owner/due/correction task
Audit 抽查 evidence_refs 每筆非 unknown match 都有 source_ref + payload_hash
Duplicate prevention 模擬重複 production build 若 D7 未過,PLS 回 source_gap 或 policy,不派 generic build

E2E Verification Script

  1. 匯入 50 筆 prediction claims。
  2. 同步 signals、action items、GitHub、worker completions、deployment、human review notes。
  3. 產生 normalized evidence ledger。
  4. 執行 matcher。
  5. reviewer sample 5 筆。
  6. 產生 calibration summary。
  7. 若 unknown >= 25%,建立 source_gap。
  8. 若 unknown < 25%,建立 correction_loop action items。

本輪已驗證

  • primary HTML artifact 已包含 D1/D7/D14/D30、E2E、價值/錢路徑、human capability、solution stack、adoption LINE 草稿。
  • learning-memory.json 需通過 JSON parser。
  • Gist 需回 HTTP 200 且包含全部檔案。
  • PLS upload-files 需回 uploaded count。

Owner / Due / Acceptance

  • Owner:Louis。
  • Reviewers:zihrou、iron。
  • D1 due:2026-05-27。
  • D7 due:2026-05-31。
  • 完成條件:D7 50 筆 trial run、unknown <25%、5 筆 reviewer sample、repeated miss reason 轉 correction action item、decision-record 存檔。

Artifact URL Or PR

Durable primary artifact:

https://gist.github.com/esz135888/e206a8af5f5234d0448eac17c4cddf9f

Verification:

  • Local JSON validation passed for learning-memory.json.
  • Required artifact anchors exist: market_context, production_readiness, e2e_verification, people_sync, learning_memory.
  • Gist must return HTTP 200 after redirect before PLS completion.

Data Model / API / 權限稽核

Artifact kind: production_readiness.

DB Model

prediction_claim

欄位 型別 必填 說明
id uuid yes prediction id
review_id uuid yes 來源 review
project_id uuid yes PLS project
claim_text text yes 可驗證預測
owner_person_id uuid/text yes owner
due_at timestamptz yes 預期命中時間
expected_evidence jsonb yes 預期證據來源與 match hints
impact_metric text yes project / money / risk / conversion / labor
confidence numeric yes 0-1

evidence_event

欄位 型別 必填 說明
id uuid yes evidence id
source_type enum yes signal, action_item, github, worker_completion, deployment, human_review_note
source_ref text yes URL/id
event_at timestamptz yes 發生時間
actor_id text no 人或 worker
project_id uuid no 關聯 project
normalized_payload jsonb yes 正規化內容
payload_hash text yes 稽核 hash

prediction_match

欄位 型別 必填 說明
id uuid yes match id
prediction_claim_id uuid yes prediction
calibration_run_id uuid yes 本次 trial run
label enum yes hit, miss, unknown
confidence numeric yes label confidence
evidence_refs jsonb no evidence_event ids + source_ref
miss_reason enum no direction_gap, resource_gap, authorization_gap, source_gap, execution_drift, timing_gap
matcher_version text yes matcher version

reviewer_sample

欄位 型別 必填 說明
id uuid yes sample id
prediction_match_id uuid yes sampled match
reviewer_person_id uuid/text yes reviewer
decision enum yes accept, override
override_label enum no hit, miss, unknown
note text yes 原因

source_gap

欄位 型別 必填 說明
id uuid yes gap id
source_type enum yes 缺口來源
needed_for_prediction_id uuid yes 影響哪個 prediction
owner_person_id uuid/text yes adapter owner
due_at timestamptz yes 修復期限
acceptance text yes API/sync 驗收

calibration_run

欄位 型別 必填 說明
id uuid yes run id
sample_size integer yes D7 = 50
unknown_rate numeric yes unknown / total
reviewer_sample_rate numeric yes reviewed / total
top_miss_reason text no 最大卡點
next_gate enum yes d1_policy, source_gap, correction_loop, dashboard

API / Sync Spec

POST /api/ai-prediction/claims/import
POST /api/ai-prediction/evidence/sync
POST /api/ai-prediction/calibration-runs
POST /api/ai-prediction/matches/run
POST /api/ai-prediction/reviewer-samples
POST /api/ai-prediction/source-gaps
GET  /api/ai-prediction/calibration-runs/:id/summary

權限

  • Louis:可建立/關閉 calibration run、接受 label policy、看全域 scorecard。
  • zihrou:可 reviewer sample、調整 miss taxonomy、建立 correction action item。
  • iron:可管理 source adapter、標記 source gap、回報 D7 trial run。
  • worker:只能 append evidence_event 與 match result,不可覆蓋 reviewer decision。

稽核邊界

  • evidence_event append-only。
  • reviewer_sample append-only。
  • GitHub/deployment 類 ref 必須可開啟或有命令驗證結果。
  • LINE 外層只同步短摘要,真成果要回 durable artifact URL。
  • 若 prediction 缺 owner/due/expected evidence,不准進 matcher。

Decision Record

決策

本輪採用「Evidence Trial Runner」作為 production artifact,不再重複產出 AI 預測驗證總體架構。

背景

PLS 連續收到相同主題:「新增 AI 預測驗證模組,透過 signals、action items 等多來源證據,自動核對上次 review 的預測是否命中」。前一輪已產出 calibration/preflight gate。下一個真正推進點是把 D7 trial run 的 evidence adapter、資料欄位、驗收和採用訊號做成可執行規格。

選項

A. 再產一份完整 verification dashboard

優點:看起來完整。缺點:重複前序成果,仍不能跑第一批資料。

B. 只做 market research

優點:能補外部觀點。缺點:不符合 build-first,也不能讓 Louis/iron/zihrou 直接採用。

C. 做 Evidence Trial Runner

優點:把下一步收斂成 D1 policy 與 D7 50 筆試跑;能阻止重複派工;能把 source gap 變成具體工單。

推薦

採用 C。

採用狀態

建議採用。需要 Louis 拍板 label policy,zihrou 確認 miss taxonomy,iron 確認 6 種 evidence adapter 的現況。

落地路徑

  1. Louis 回覆 label policy 是否同意。
  2. zihrou 回覆 miss taxonomy 是否要改。
  3. iron 回覆可同步來源與 source gap。
  4. PLS 建立 50 筆 prediction seed。
  5. D7 跑 trial run。
  6. unknown <25% 才進 dashboard/productization;否則先補 source adapter。

若不採用,請回饋

  • 哪個 evidence source 不應被採信?
  • hit/miss/unknown 是否不足?
  • D7 unknown 門檻是否要調整?
  • 是否已有 50 筆 seed 可直接跑?
{
"job_id": "c313ffcb-5f86-48d2-a19c-84cecf5e1f3f",
"memory_type": "learning_memory",
"project": "AI 自建專案:公司AI化 的最大化推進",
"topic": "AI prediction verification evidence trial runner",
"market_context": [
"2026 AI observability practice is converging on structured traces, spans, evaluations, and evidence provenance rather than plain text logs.",
"OpenTelemetry GenAI semantic conventions are a useful reference for model/tool trace attributes, but PLS still needs business outcome labels and reviewer overrides.",
"Tools such as Evidently, Phoenix, and LangSmith validate the direction: observability plus evaluation is the production pattern."
],
"next_worker_instruction": "Do not create another generic AI prediction verification pack. First check whether Louis accepted label policy, whether 50 prediction seeds exist, and whether D7 unknown rate is available. If not, dispatch policy_acceptance, seed_creation, or source_adapter_gap. If D7 unknown <25%, proceed to correction_loop/dashboard productization.",
"owners": {
"primary": "Louis",
"reviewers": ["zihrou", "iron"]
},
"acceptance": [
"6 evidence adapters white-listed",
"50 prediction claims imported",
"unknown rate below 25%",
"reviewer sample at least 10%",
"repeated miss reason routed to correction action item",
"decision-record.md attached"
]
}
<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AI 預測驗證 Evidence Trial Runner</title>
<style>
:root {
--bg: #f7f4ee;
--ink: #1f2320;
--muted: #666b63;
--line: #d7d0c5;
--panel: #fffef9;
--green: #17715f;
--blue: #245d8f;
--red: #a94e43;
--gold: #bb7a16;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--ink);
font-family: "PingFang TC", "Noto Sans TC", ui-sans-serif, system-ui, sans-serif;
line-height: 1.55;
}
header {
padding: 40px 6vw 28px;
background: #fffaf0;
border-bottom: 1px solid var(--line);
}
.kicker {
color: var(--blue);
font-size: 12px;
font-weight: 800;
letter-spacing: .06em;
text-transform: uppercase;
}
h1 {
max-width: 1040px;
margin: 10px 0;
font-size: clamp(34px, 5vw, 68px);
line-height: 1.04;
letter-spacing: 0;
}
.lede {
max-width: 920px;
color: var(--muted);
font-size: 19px;
}
main {
padding: 28px 6vw 60px;
display: grid;
gap: 18px;
}
section {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 8px;
padding: 22px;
box-shadow: 0 12px 34px rgba(40, 34, 24, .08);
}
h2 { margin: 0 0 14px; font-size: 24px; }
h3 { margin: 0 0 8px; font-size: 17px; }
.grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
}
.two {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.card {
border: 1px solid var(--line);
border-radius: 8px;
padding: 15px;
background: #fffdf8;
min-height: 120px;
}
.tag {
display: inline-flex;
align-items: center;
border: 1px solid var(--line);
border-radius: 99px;
padding: 2px 9px;
margin-bottom: 9px;
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
th, td {
padding: 10px 8px;
border-bottom: 1px solid var(--line);
text-align: left;
vertical-align: top;
}
th {
color: var(--blue);
font-size: 12px;
text-transform: uppercase;
letter-spacing: .04em;
}
ul, ol { margin: 0; padding-left: 20px; }
li { margin: 6px 0; }
code {
padding: 1px 5px;
border: 1px solid var(--line);
border-radius: 5px;
background: #f1eadf;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: .92em;
}
.pass { color: var(--green); font-weight: 800; }
.warn { color: var(--gold); font-weight: 800; }
.stop { color: var(--red); font-weight: 800; }
@media (max-width: 920px) {
header, main { padding-left: 18px; padding-right: 18px; }
.grid, .two { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<header>
<div class="kicker">primary_artifact / production_readiness / e2e_verification</div>
<h1>AI 預測驗證 Evidence Trial Runner</h1>
<p class="lede">本輪把「多來源證據核對預測命中」從概念推到可執行的 D7 試跑:定義可採信證據、同步欄位、權限稽核、50 筆批次驗收、LINE 採納訊號,讓下一個 worker 不再重做說明,而是直接跑第一輪資料。</p>
</header>
<main>
<section>
<h2>D1 / D7 / D14 / D30 發展路徑</h2>
<div class="grid">
<div class="card"><span class="tag">D1</span><h3>證據白名單</h3>Louis 拍板 6 種證據來源與命中規則;zihrou 確認 miss taxonomy;iron 確認可同步欄位。</div>
<div class="card"><span class="tag">D7</span><h3>50 筆 Trial Run</h3>抽 50 筆 review prediction,跑出 hit / miss / unknown,unknown 必須低於 25%。</div>
<div class="card"><span class="tag">D14</span><h3>修正閉環</h3>對連續 miss reason 建 correction action item,並把 source gap 變成 adapter 工單。</div>
<div class="card"><span class="tag">D30</span><h3>週會指標化</h3>把 prediction hit rate、unknown rate、top miss reason 放進公司 AI 化週會 scorecard。</div>
</div>
</section>
<section>
<h2>目的到目的 E2E</h2>
<div class="two">
<div class="card">
<h3>原始目的到產出物</h3>
<ol>
<li>上次 review 產生 prediction claim。</li>
<li>Evidence adapters 拉 signals、action items、GitHub、worker completions、deployment、human notes。</li>
<li>Normalizer 轉成同一張 evidence ledger。</li>
<li>Matcher 產生 label、confidence、source_ref、miss_reason。</li>
<li>Reviewer sample 修正標籤,形成 calibration summary。</li>
</ol>
</div>
<div class="card">
<h3>人採用到指標改善</h3>
<ul>
<li>Louis 用 calibration summary 決定 AI review 是否可信。</li>
<li>zihrou 用 miss reason 判斷卡點是方向、資源、授權或執行。</li>
<li>iron 用 source gap 決定下一個 adapter 或 API 同步工單。</li>
<li>改善指標:少重複派工、少錯誤信心、縮短 review 到 correction 的時間。</li>
</ul>
</div>
</div>
</section>
<section>
<h2>Evidence Adapter 白名單</h2>
<table>
<thead><tr><th>來源</th><th>命中證據</th><th>必要欄位</th><th>稽核</th></tr></thead>
<tbody>
<tr><td>signals</td><td>新訊號與 prediction 主題、owner、日期相符</td><td><code>signal_type</code>, <code>summary</code>, <code>project_id</code>, <code>created_at</code></td><td>保留 raw payload hash</td></tr>
<tr><td>action items</td><td>任務完成、延期或狀態變更能驗證 prediction</td><td><code>title</code>, <code>status</code>, <code>due_date</code>, <code>assignee_id</code></td><td>append-only status snapshot</td></tr>
<tr><td>GitHub</td><td>commit / PR / workflow run 支撐技術進度</td><td><code>sha</code>, <code>author</code>, <code>message</code>, <code>url</code></td><td>URL 必須可驗證</td></tr>
<tr><td>worker completions</td><td>PLS job 完成、失敗或 artifact 上傳</td><td><code>job_id</code>, <code>summary</code>, <code>artifacts</code>, <code>completed_at</code></td><td>不得只採 summary,需 artifact ref</td></tr>
<tr><td>deployment</td><td>production URL 或 deploy log 支撐上線預測</td><td><code>environment</code>, <code>url</code>, <code>status</code>, <code>run_id</code></td><td>驗證 HTTP 或平台回傳</td></tr>
<tr><td>human review notes</td><td>Louis / zihrou / iron 明確採納、否決、修正</td><td><code>person_id</code>, <code>decision</code>, <code>note</code>, <code>created_at</code></td><td>reviewer override append-only</td></tr>
</tbody>
</table>
</section>
<section>
<h2>D7 Trial Run 操作流程</h2>
<div class="two">
<div class="card">
<h3>批次規則</h3>
<ul>
<li>抽樣 50 筆:P0/P1 優先、近 30 天、至少 3 位 owner。</li>
<li>每筆 prediction 必須有 owner、due、expected evidence、impact metric。</li>
<li>label 只能是 <code>hit</code>、<code>miss</code>、<code>unknown</code>。</li>
<li>unknown 超過 25% 時不得進 dashboard productization。</li>
</ul>
</div>
<div class="card">
<h3>Go / No-Go</h3>
<ul>
<li><span class="pass">Go:</span> unknown &lt; 25%,reviewer sample 完成,top miss reason 可路由。</li>
<li><span class="warn">Hold:</span> unknown 25-40%,先補 source adapter。</li>
<li><span class="stop">Stop:</span> prediction 缺 owner/due/expected evidence,回到 D1 policy。</li>
</ul>
</div>
</div>
</section>
<section>
<h2>採用路徑與 LINE 草稿</h2>
<div class="card">
<p><strong>推送對象:</strong>Louis(owner)、zihrou(supervisor)、iron(owner)。</p>
<p><strong>LINE 草稿:</strong>「這輪不是再做一份 AI 預測驗證說明,而是把 D7 試跑規則做出來:6 種 evidence adapter 白名單、50 筆抽樣規則、unknown &lt;25% 驗收、miss reason 對應修正工單。請 Louis 今天拍板 label policy;zihrou 確認 miss taxonomy;iron 確認哪幾個來源目前可同步,5/31 前跑第一批 50 筆。」</p>
<p><strong>期待回覆訊號:</strong>「同意 label policy」、「缺哪個 source adapter」、「50 筆 seed 清單已建立」、「unknown rate」。</p>
</div>
</section>
</main>
</body>
</html>

AI 預測驗證 Evidence Trial Runner - Production Brief

Artifact kind: primary_artifact, people_sync.

場景

PLS 已連續收到「新增 AI 預測驗證模組」訊號。前一輪已補上 calibration / preflight gate,本輪不再重做架構說明,而是交付 D7 能直接試跑的 evidence adapter 與 50 筆 trial run 規格。

D1 / D7 / D14 / D30

時程 交付 Owner 驗收
D1 證據白名單與 label policy 拍板 Louis hit / miss / unknown、miss taxonomy、6 種來源可採信
D7 50 筆 prediction trial run iron unknown rate < 25%,10% reviewer sample 完成
D14 miss reason correction loop zihrou + iron 連續 miss reason 都有 owner/due/action item
D30 進入公司 AI 化週會 scorecard Louis hit rate、unknown rate、top miss reason、money/risk impact 每週更新

目的到目的 E2E

原始目的:自動核對上次 review 的 AI prediction 是否命中。

E2E 鏈路:

  1. AI review 產出 prediction claim,包含 owner、due、expected evidence、confidence、impact metric。
  2. Evidence adapters 同步 signals、action items、GitHub、worker completions、deployment、human review notes。
  3. Normalizer 轉成 evidence ledger,保留 source_ref、actor、timestamp、payload_hash。
  4. Matcher 產生 label、confidence、evidence_refs、miss_reason。
  5. Reviewer sample 校正標籤。
  6. Correction loop 針對 repeated miss reason 建 action item。
  7. Weekly scorecard 用校準結果改善專案、營收、風險與人力配置決策。

價值 / 錢路徑

  • 營收:把可信 prediction 用在高機率成交、交付可行、可上線的 AI 專案排序。
  • 成本:避免同一個「AI 預測驗證」被反覆派工,未過 D1/D7 gate 時先補資料或拍板。
  • 風險:降低 AI review 誤判導致的錯誤資源配置、錯誤承諾、錯誤停併。
  • 轉換:LINE 同步不是摘要,而是要求 owner 回覆可機器讀取的 adoption signal。
  • 人力釋放:reviewer 看抽樣與例外,不再人工翻找所有訊號。

提升人的能力

  • Louis:從「感覺 AI 有沒有準」變成看 hit rate、unknown rate、top miss reason。
  • zihrou:可以把卡點分類成方向、資源、授權、證據或執行問題。
  • iron:可以把 source gap 直接轉成 adapter/API 工單。
  • 其他 owner:學會寫可驗證 prediction,而不是模糊願望。

Solution Stack

本輪決策
脈絡框架 Prediction claim 必須有 owner、due、expected evidence、impact metric。
作業流程 D1 policy -> D7 50-case trial -> D14 correction -> D30 scorecard。
資料 / DB prediction_claimevidence_eventprediction_matchreviewer_samplesource_gapcalibration_run
可操作工具 prediction-evidence-trial-runner.html 可直接作為試跑規格與採納頁。
驗收指標 unknown < 25%、reviewer sample >= 10%、每個 repeated miss reason 有 correction task。
採用升級 LINE 草稿要求 Louis/zihrou/iron 回覆具體 adoption signal。

People Sync

LINE 草稿:

「這輪不是再做一份 AI 預測驗證說明,而是把 D7 試跑規則做出來:6 種 evidence adapter 白名單、50 筆抽樣規則、unknown <25% 驗收、miss reason 對應修正工單。請 Louis 今天拍板 label policy;zihrou 確認 miss taxonomy;iron 確認哪幾個來源目前可同步,5/31 前跑第一批 50 筆。」

期待回覆訊號:

  • Louis:同意 / 修改 label policy。
  • zihrou:同意 / 修改 miss taxonomy。
  • iron:可同步來源清單、缺口來源清單、D7 trial run 結果。

下一輪升級

下一輪應該拿 50 筆真實 prediction seed 跑 trial。若 unknown rate 超過 25%,不要做 dashboard,先開 source adapter 工單;若低於 25%,進 D14 correction loop。

Market Context

Artifact kind: market_context.

Checked on 2026-05-24 Asia/Taipei.

Sources

Applied Learning

Current AI/agent observability practice has moved from plain logs to traces, spans, evaluations, metrics, and source-linked evidence. For PLS, that means prediction verification must store structured prediction claims, normalized evidence events, match labels, reviewer overrides, and correction tasks. Generic summaries are not enough because they cannot prove hit/miss, route source gaps, or improve future decision quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment