Skip to content

Instantly share code, notes, and snippets.

@esz135888
Last active May 23, 2026 21:13
Show Gist options
  • Select an option

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

Select an option

Save esz135888/226baad0f0f6baa68401a99d0ff4c9cd to your computer and use it in GitHub Desktop.
PLS job 3fa9fb41 AI prediction capability repair dispatch

Acceptance Tests

Test 1: Stop Static Loop

Given the project already has D7-D30, dashboard spec, and repo handoff, when PLS creates the next job, then it must not be another generic project_runner production pack.

Pass:

  • next job worker kind is repo_change or github_pr.
  • job metadata includes implementation spec ref.
  • generic project_runner loop is paused or blocked until repo task completes.

Test 2: Repo Attached

Given repo_change job is dispatched, when worker reads context, then target_repo_url or local repo path must exist.

Pass:

  • worker can run git status.
  • branch can be created.
  • PR can be opened after tests.

Test 3: Implementation Scope

Given backend repo exists, when worker implements, then it must cover scorecard migration, card API, approval endpoint, LINE summary, and dispatch-next.

Pass:

  • migration exists.
  • APIs return expected payloads.
  • UI renders ship/repair/block.
  • LINE summary is short.
  • dispatch-next is deterministic.

Test 4: No Fake Success

Given repo is missing, when worker completes, then it must not report GitHub PR or deployment.

Pass:

  • blocker is explicit.
  • artifact is a handoff/repair pack.
  • next required signal is repo attachment.

Test 5: People Sync

Given this repair pack is sent, when PLS pushes people sync, then it asks only Louis/PLS to attach the repo.

Pass:

  • no request to zihrou/iron until PR/staging exists.
  • Louis receives owner/due/acceptance.
  • expected reply is repo URL/path or owner assignment.

Test 6: Completion Evidence

Given this pack completes, then durable artifact, uploaded files, readiness model, E2E verification, people sync, learning memory, and decision record must exist.

Pass:

  • public artifact URL returns HTTP 200.
  • files uploaded to PLS.
  • learning memory JSON validates.
  • artifacts JSON includes required kinds.

Artifact URL or PR

Durable primary artifact:

https://gist.github.com/esz135888/226baad0f0f6baa68401a99d0ff4c9cd

Gist id:

226baad0f0f6baa68401a99d0ff4c9cd

PR status:

No GitHub PR was created. This job is a capability repair dispatch pack for PLS because the next valid step requires backend repo attachment and repo_change/github_pr worker dispatch.

Verification:

  • Public Gist URL responds with HTTP 200 after redirects.
  • File list includes capability repair console, production brief, data model, acceptance tests, decision record, learning memory, market sources, and this artifact record.
<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PLS Capability Repair Dispatch Console</title>
<style>
:root{--ink:#17212b;--muted:#627080;--line:#d8dee7;--bg:#f6f8fb;--panel:#fff;--blue:#2457d6;--green:#14805a;--amber:#a35f00;--red:#b42318;--soft:#eef2f7}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.5}
header{background:#fff;border-bottom:1px solid var(--line);padding:22px clamp(18px,4vw,48px)}main{padding:22px clamp(18px,4vw,48px) 48px;display:grid;gap:16px}
h1{margin:0;font-size:clamp(24px,3vw,36px);letter-spacing:0}h2{margin:0 0 12px;font-size:18px}h3{margin:0 0 8px;font-size:15px}p{margin:0 0 10px}
.sub{color:var(--muted);max-width:1120px;margin-top:8px}.tag{display:inline-flex;align-items:center;height:24px;padding:0 8px;border:1px solid var(--line);border-radius:999px;background:#fbfcfe;color:var(--muted);font-size:12px;margin-right:6px}
.grid{display:grid;gap:16px}.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:16px}.metric{min-height:112px;display:flex;flex-direction:column;justify-content:space-between}.label{font-size:13px;color:var(--muted)}.value{font-size:30px;font-weight:760}.ok{color:var(--green)}.warn{color:var(--amber)}.stop{color:var(--red)}
table{width:100%;border-collapse:collapse;font-size:13px}th,td{border-bottom:1px solid var(--line);padding:10px 8px;text-align:left;vertical-align:top}th{background:#fbfcfe;color:var(--muted)}code{background:var(--soft);border-radius:4px;padding:2px 5px;font-size:12px}
ul{padding-left:18px;margin:0}li{margin:6px 0}.state{border-left:4px solid var(--blue);padding-left:12px}.state.warn{border-color:var(--amber)}.state.stop{border-color:var(--red)}
@media(max-width:980px){.cols4,.cols3,.cols2{grid-template-columns:1fr}}
</style>
</head>
<body>
<header>
<h1>Capability Repair Dispatch Console</h1>
<p class="sub">此專案已完成 D7-D30、dashboard spec、repo-change handoff。現在真正卡點不是再寫文件,而是 PLS dispatch capability:必須把下一輪任務從 project_runner 改派成 repo_change/github_pr,並附上 backend repo。</p>
<p><span class="tag">Owner: Louis</span><span class="tag">Capability owner: PLS</span><span class="tag">Due: 2026-05-25</span><span class="tag">Stop static loops</span></p>
</header>
<main>
<section class="grid cols4">
<div class="panel metric"><span class="label">Current Loop</span><span class="value stop">wrong</span><span class="label">project_runner repeats static artifact tasks</span></div>
<div class="panel metric"><span class="label">Needed Kind</span><span class="value ok">repo</span><span class="label">repo_change or github_pr</span></div>
<div class="panel metric"><span class="label">Missing Input</span><span class="value warn">1</span><span class="label">PLS backend repository URL/path</span></div>
<div class="panel metric"><span class="label">Next SLA</span><span class="value ok">24h</span><span class="label">attach repo and dispatch implementation</span></div>
</section>
<section class="panel">
<h2>30 天路徑</h2>
<div class="grid cols4">
<div class="state"><h3>D1</h3><p>PLS 停止再派 project_runner static pack,補上 backend repo URL/path。</p></div>
<div class="state"><h3>D7</h3><p>repo_change worker 開 branch,實作 migration/API/UI/LINE/dispatch-next。</p></div>
<div class="state"><h3>D14</h3><p>GitHub PR 通過測試與 review,scorecard card 可在 staging render。</p></div>
<div class="state"><h3>D30</h3><p>週節奏上線:Louis approve gate,PLS 自動派 repair/publish/rerun。</p></div>
</div>
</section>
<section class="grid cols2">
<div class="panel">
<h2>Purpose-to-Purpose E2E</h2>
<ul>
<li>原始目的:驗證 AI review prediction 是否命中。</li>
<li>已產出:D7/D14/D30、dashboard spec、repo-change handoff。</li>
<li>現在要做:修 PLS dispatch/capability,讓 repo_change worker 接手。</li>
<li>人採用:Louis 只需提供/確認 repo;PLS 派工程 worker;reviewers 用後台 card。</li>
<li>指標改善:停止 artifact loop,進入 PR、部署、週報採用。</li>
</ul>
</div>
<div class="panel">
<h2>Value / Money Path</h2>
<ul>
<li>省成本:阻止 project_runner 每 10 分鐘重做相同規劃包。</li>
<li>降風險:避免 PLS 誤以為 project 已進 implementation,其實缺 repo。</li>
<li>釋放人力:下一輪 worker 可直接開 PR,不再人工轉譯需求。</li>
<li>營收/轉換:dashboard 進後台後,AI prediction verification 才能被管理層每週採用。</li>
</ul>
</div>
</section>
<section class="panel">
<h2>Queue Repair Contract</h2>
<table>
<tr><th>Problem</th><th>Required Repair</th><th>Acceptance</th></tr>
<tr><td>Wrong worker kind</td><td>create next job with <code>worker_kinds=["repo_change","github_pr"]</code></td><td>claim output shows repo_change/github_pr, not project_runner</td></tr>
<tr><td>Missing repo</td><td>attach backend repo URL/path to job metadata</td><td>worker can run <code>git status</code> inside repo</td></tr>
<tr><td>Static loop</td><td>mark current project_runner chain as blocked for implementation</td><td>no more generic production pack job until repo task completes</td></tr>
<tr><td>Implementation target</td><td>link previous handoff Gist as spec</td><td>PR description references migration/API/UI/LINE/dispatch-next contract</td></tr>
</table>
</section>
<section class="grid cols3">
<div class="panel"><h2>Data / API</h2><p>Add dispatch metadata fields: <code>target_repo_url</code>, <code>target_branch</code>, <code>implementation_spec_ref</code>, <code>required_worker_kind</code>, <code>blocked_until_repo_attached</code>.</p></div>
<div class="panel"><h2>Permissions / Audit</h2><p>Only PLS/Louis can attach repo and authorize repo_change. Worker must not invent repo URLs or claim PR success without GitHub output.</p></div>
<div class="panel"><h2>People Sync</h2><p>LINE asks one thing: Louis/PLS confirm backend repo. Everyone else waits until PR/staging exists.</p></div>
</section>
<section class="panel">
<h2>LINE 草稿</h2>
<p>AI 預測驗證已完成 dashboard implementation spec,但目前 worker 沒有 PLS backend repo,不能開 PR。請 Louis/PLS 補 backend repo URL/path,下一輪改派 repo_change/github_pr worker。驗收:有 branch/PR、migration/API/UI/LINE/dispatch-next 測試通過。</p>
</section>
</main>
</body>
</html>

Capability Repair Data Model

Dispatch Metadata Required

implementation_dispatch_request

Field Type Required Notes
id uuid yes dispatch request id
project_id uuid yes PLS project
source_artifact_ref text yes repo-change handoff Gist
target_repo_url text yes PLS backend repo URL/path
target_branch text yes suggested implementation branch
required_worker_kind text yes repo_change or github_pr
blocked_until_repo_attached boolean yes true until repo exists
owner_user_id uuid yes Louis
due_at timestamptz yes 2026-05-25 for queue repair

implementation_acceptance_contract

Field Type Required Notes
id uuid yes contract id
dispatch_request_id uuid yes parent
required_changes jsonb yes migration/API/UI/LINE/dispatch-next
required_tests jsonb yes owner approval, short LINE, deterministic dispatch
forbidden_claims jsonb yes no fake PR/deploy
completion_artifact_kind text yes github_pr preferred

Required APIs / Worker Flow

API / Flow Purpose
claim must return repo_change or github_pr worker kind prevents project_runner loop
context <job_id> must include target_repo_url lets worker clone/open repo
worker must verify git status in repo no fake PR
complete must include github_pr or verified blocker implementation evidence

Permissions / Audit

  • Only Louis/PLS can attach backend repo.
  • project_runner can produce this dispatch repair pack but must not claim repo implementation.
  • repo_change/github_pr worker must verify branch, diff, tests, and PR URL before complete.
  • Every dispatch repair stores source artifact, target repo, worker kind, owner, due, and acceptance.

Decision Record: Stop Project Runner Loop and Dispatch Repo Change

Date: 2026-05-24
Status: Recommended
Owner: Louis
Capability owner: PLS

Problem

The AI prediction verification project has enough production artifacts. The current bottleneck is not strategy; it is dispatch capability. PLS keeps assigning project_runner tasks even after the next valid step became repo_change/github_pr with a backend repo.

Options Considered

Option A: Produce another dashboard/spec artifact

Rejected. It repeats existing work and does not move toward implementation.

Option B: Claim PR success without repo

Rejected. The workspace is not a Git repository and fake GitHub success is prohibited.

Option C: Produce capability repair dispatch pack

Recommended. It tells PLS exactly how to repair the queue: attach backend repo, change worker kind, and dispatch implementation.

Recommendation

Adopt Option C. Pause generic project_runner production-delivery loops for this project until a repo_change/github_pr job with backend repo is dispatched.

Landing Path

  1. Louis/PLS attach backend repo URL/path.
  2. PLS creates repo_change/github_pr job.
  3. Worker implements scorecard migration/API/UI/LINE/dispatch-next.
  4. Worker opens PR and verifies tests.
  5. PLS resumes weekly scorecard adoption cadence.

Feedback Needed If Rejected

  • Backend repo cannot be attached.
  • Implementation should happen in another service.
  • PLS does not want repo_change workers for this project.
  • The project should pause.
{
"job_id": "3fa9fb41-4b40-4d6c-acd6-8c31084990ac",
"project_topic": "AI prediction verification module for signals and action-item evidence",
"current_artifact": "Capability Repair Dispatch Pack",
"previous_artifacts": [
"Repo Change Handoff Pack",
"PLS Weekly Scorecard Dashboard Implementation Pack",
"D30 Weekly Scorecard Adoption Gate",
"D14 Correction Router",
"D7 Calibration Run Control Tower"
],
"owner": "Louis",
"due": "2026-05-25",
"blocked_reason": "Next valid step requires backend repo and repo_change/github_pr worker, but current job is project_runner without repo.",
"next_worker_rule": {
"if_backend_repo_attached": "Dispatch repo_change/github_pr with implementation spec ref.",
"if_backend_repo_missing": "Do not create another static project_runner pack; ask Louis/PLS for repo URL/path.",
"if_repo_change_claimed": "Implement migration/API/UI/LINE/dispatch-next and open PR.",
"if_pr_opened": "Verify tests and return github_pr artifact.",
"if_no_repo": "Mark blocker; do not claim deployment or PR."
},
"acceptance_gate": {
"required_worker_kind_next": ["repo_change", "github_pr"],
"target_repo_url_required": true,
"no_fake_pr": true,
"project_runner_loop_should_pause": true
},
"do_not_repeat": [
"Do not create another D7/D14/D30/dashboard spec pack.",
"Do not claim GitHub success without repo and PR URL.",
"Do not involve zihrou/iron until backend PR or staging card exists."
]
}

PLS Capability Repair Dispatch Pack

場景

AI 預測驗證已完成 D7 calibration、D14 correction router、D30 adoption gate、PLS dashboard implementation spec、repo-change handoff。上一輪已明確指出 workspace 不是 Git repo,不能開 PR。本輪若再做一般 production pack 會形成靜態 artifact loop。因此本輪產出 PLS capability repair dispatch pack:要求下一輪改派 repo_change/github_pr,並附上 PLS backend repo。

Owner: Louis
Capability owner: PLS
Due: 2026-05-25
Primary artifact: capability-repair-dispatch-console.html

30 天發展路徑

時點 成果 驗收
D1 停止 project_runner static loop,補 backend repo。 下個 job metadata 有 repo URL/path。
D7 repo_change worker 開 branch 實作。 migration/API/UI/LINE/dispatch-next 初版完成。
D14 GitHub PR + staging card。 測試通過,PR 可 review。
D30 weekly scorecard cadence 上線。 Louis approve gate,PLS 自動派 repair/publish/rerun。

目的到目的 E2E

原始目的:驗證上次 review 的 AI prediction 是否命中。
目前目的:修正 PLS dispatch/capability,讓已完成的 spec 真的進 repo implementation。

E2E:

  1. D7-D30 artifacts 形成完整 evidence/spec chain。
  2. PLS 補 target_repo_urlrequired_worker_kind=repo_change/github_pr
  3. repo worker 開 branch/PR。
  4. 實作 PLS scorecard card、approval、LINE summary、dispatch-next。
  5. PR/staging 成功後才進 weekly cadence。

價值 / 錢路徑

  • 省成本:停止每輪重做 static pack,避免 AI worker 時間浪費。
  • 降風險:不假裝 PR、不假裝部署,避免 PLS 成果卡誤導。
  • 提高轉換:把 Louis 的決策點從「看 artifact」移到「看 PR/staging」。
  • 釋放人力:repo_change worker 有明確 spec,工程接手成本最低。

提升人的能力

  • Louis:知道現在唯一需要拍板的是 backend repo/implementation owner。
  • PLS:學會從 project_runner 成果轉派 repo_change,而不是無限重派規劃。
  • repo worker:拿到可直接實作的 migration/API/UI/LINE/dispatch contract。

Solution Stack

內容
脈絡框架 artifact chain complete -> capability gap -> repo dispatch repair -> PR/staging。
作業流程 attach repo -> dispatch repo_change -> implement -> PR -> staging -> weekly cadence。
資料 / DB dispatch metadata: target_repo_urltarget_branchimplementation_spec_refrequired_worker_kind
可操作工具 capability repair console、queue repair contract、acceptance tests、decision record、learning memory。
驗收指標 next job is repo_change/github_pr, repo exists, PR/staging verified, no fake URL.
採用升級 下一輪必須進 repo implementation;沒有 repo 就不要再派 project_runner。

市場脈絡

成熟 AI evaluation/observability 不會停在報告,而是進入 production workflow。此專案已完成 workflow design,現在最重要的市場級 production 動作是 capability routing:把規劃 worker 轉成工程 worker,連到實際 repo。

Market Context Sources

Checked on 2026-05-24 Asia/Taipei.

Sources

Takeaway

Mature AI evaluation systems connect evidence to production action. The project has the evaluation/action design; the market-grade next step is not another report, but implementation routing into a repository with PR evidence.

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