Skip to content

harden #111 provenance 欄位:honest-gate 抽 helper+test / CLI --run-kind 驗證 / validator 容忍 run_kind:null #120

Description

@kiki830621

Problem

#111 verify(PR #119,6-AI ensemble)判 PASS、merge-safe,但 4 lens + Devil's Advocate 收斂出一組非阻擋的 robustness 缺口,全部圍繞新加的 run_kind / decode_deterministic provenance 欄位。DA 明確建議:ship #111、把以下項目追蹤為 follow-up(gate 邏輯本身已被 3 個 reviewer + DA 證明正確,缺的是防未來 regression 的護欄)。

Type

feature

Expected

三項 hardening(可一個 PR 收):

  1. 抽出並單元測試 honest gate(regression lens Turn bestASR into a Claude plugin marketplace with an agent-facing plugin (sibling concern from #3) #4,最實質):decode_deterministic 的「never lie」不變式目前 inline 在 CommandCore.swift:593 的 benchmark loop 裡、無法在不跑真 backend 的情況下測到。抽成 pure helper(如 decodeDeterministicProvenance(backend:flag:) -> Bool?),單元測 4 個 backend case(whisperkit+true→true、whisperkit+false→false、mlx-audio+true→nil、其他+任意→nil)。這條不變式定義measurement schema 增 run_kind / decode-determinism provenance 欄位(follow-up from #109 verify) #111,值得有專屬測試防未來新增「消費 flag 但不在 whitelist」的 backend 時靜默說謊。

  2. CLI --run-kind boundary 驗證(requirements + security + logic + regression + DA 五方收斂):目前 @Option var runKind: String? 收任意字串、verbatim 進 local store,只有 bench CI 的 enum gate 擋——--run-kind typo 會產生一筆 submit 時才被拒的 row(fail-loud 在錯的一端)。在 CLI 邊界加 enum 驗證(BestASRError.usage,比照既有 fail-fast 風格)。

  3. bench validator 容忍 run_kind: null(DA-1):validator 拒 run_kind: null(null ∉ enum)但收 decode_deterministic: nullmeasurement schema 增 run_kind / decode-determinism provenance 欄位(follow-up from #109 verify) #111 的 run_kind backward-compat 完全靠 Swift encoder 省略 nil key(零容忍)——對任何未來 encoder 變更或手寫 row 都脆。cheap fix:validator 把 run_kind: null 視同 absent(放行)。屬 bestASR-bench repo。

Impact

三項皆非阻擋、皆為既有正確實作的護欄。與 #118(determinism 表示法抉擇)相關但不同:#118 決定「怎麼表示」,本 issue 是「把現有表示的護欄補齊」。若 #118 選 enum,第 1、2 項可一併處理。

Source: surfaced during /idd-verify #111 (PR #119) — regression lens #4 + requirements/security/logic O2 + Devil's Advocate DA-1,convergent non-blocking findings。DA 裁決「ship #111,track as follow-up」。

Current Status

  • Phase: closed
  • Complexity: Plan
  • Last update: 2026-08-02

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions