Skip to content

P1: Audit bounded provider output, artifact durability and observer isolation using ODW reference patterns #63

Closed

Description

@James3014

Owner scope amendment — macOS only (2026-09-11)

依 Owner 最新裁決,本工作線相關功能設計、實作、交付與驗收 只處理 macOS。本裁決取代下文較早的跨平台/三平台要求。

  • Windows、Linux 支援、移植、修復與平台驗證不在本次工作範圍;不再以三平台全綠作為本工作線的 acceptance criterion。
  • 驗收保留 macOS 上必要的 source tests、獨立 package/install、真實呼叫入口、operation/副作用/讀回及適用的恢復與終態證據;ownership、lease、CAS、安全與獨立審查要求保持有效。
  • 下方歷史測試、PR、平台結果與問題紀錄保留作為歷史證據,不代表目前仍有跨平台交付承諾。後續設計及驗收計畫以此 macOS-only 範圍為準。
  • 本次更新僅修正 Issue 與規劃範圍;實作、部署與重啟仍依 Owner 的暫停指令保持暫停。
  • 此文字更新不會自行修改 GitHub CI 設定或 branch protection;既有檢查設定如與新範圍不符,須另行明確調整,不得假稱已通過或繞過保護。

目標與歸屬

#15 的定向子項。Owner 於 2026-09-09 要求研究 travisliu/open-dynamic-workflow 的 memory-issues 分支,重新規劃 DevSpace。此項只處理 provider output / process / artifact / observer 的可靠性,不建立新的 workflow engine、scheduler、權限或重試權威。

狀態:AUDIT_FIRST / NOT_A_CONFIRMED_DEVSPACE_DEFECT。 本次只讀取參考專案原始碼;沒有執行其測試,也沒有重現 DevSpace 的記憶體洩漏。不得以參考專案有某項修正,推論 DevSpace 必然存在同一缺陷。若既有实现已有等價保護,補上實際路徑證據即可,不重寫。

固定參考來源

研究分支固定在 164b313a75f1e05b0e294a2085b6e44721959762,不是浮動 main:

  • output-coordinator.ts:required artifact write / incremental parser 與 best-effort output observer 分離;UTF-8 decoder、跨 chunk redaction、有界 preview、EOF/finalize、abort cleanup。
  • process-runner.ts:stdout/stderr 分流 async pumps;await consumer 提供 backpressure;hard byte limit;process exit 與 pumps settled 分開;pipe-drain timeout 保留獨立原因。
  • event-bus.ts:output observer 有界 queue / suppression counters / bounded flush。
  • attempt-classifier.ts:timeout/cancel 不可重試,但部分 parse/schema/provider error 可被列為重試候選;此分類不能直接作為 DevSpace 再執行授權。

DevSpace 起點

最新遠端 main 觀測為 e9942d2a598866e8f8c091304b1700065791091c。#60 head 489ad06ca009d8c3d407008e7c5308cde97c74ad、#61 head 97fbefc041b7b60876d1dbbe45ae7c10617a61f0 仍 OPEN,均非已部署版本。

先在選定的最新候選/整合 revision 稽核 src/local-agent-opencode.ts、src/local-agent-acp.ts、src/local-agent-runtime.ts、src/local-agent-daemon*、src/process-sessions.ts 與實際 artifact/status consumers;exact symbols/paths 以讀回為準。OpenCode SDK、ACP 與 CLI subprocess 不是相同 transport,不可整包替換成 ODW process runner。

分段執行

O1 — 先做資料流與保留量盤點

逐段列出 provider → parser → durable result/artifact → status/reconcile → host presentation,標示記憶體保留、queue 上限、stdout/stderr 上限、JSONL 單行上限、final result 上限、EOF/exit 判定、取消與 flush 規則。分開 essential evidence 與可丟棄的 progress preview。

O2 — 先補反證,再做最小修正

在真實 production symbol 的測試介面注入以下情境;不得只寫一個與產品無關的 mock helper:

  1. 大量 chunk / 長時間串流、單一超長無換行訊息、UTF-8 跨 chunk。
  2. secret 跨 chunk 邊界;持久化及回傳結果都不得洩漏 credential,且不得把原始 env/token 放進測試報告。
  3. 慢/永不回覆/丟錯的 UI observer;它不能阻塞必要結果保存、其他工作或 reconciliation。
  4. required artifact sink/parser 失敗、磁碟容量錯誤;不得因 child exit=0 仍宣告成功,也不得把缺失證據默默截短成完整結果。
  5. stdout/stderr 同時輸出、late chunk、child 已退出但後代仍持有 pipe、取消中仍有非同步 callback。
  6. 前一 turn 或部分文字不能當本次 final;沿用 fix: bind dispatch to fresh catalogs and verified provider results #60 current-turn binding,不重新引入 stale-result fallback。
  7. timeout/502/observer failure/parse failure 發生於可能的外部副作用之後:保留 exact attempt 與 OUTCOME_UNKNOWN/reconcile-only,不重派模型、不換付費 route。

O3 — 等價與回歸驗證

freeze exact Candidate 後由主控獨立驗證;Luna 只實作經上述證據支持的最小缺口。保留既有 cancellation/process ownership、scope、receipt、#31 cutover 與 #62 lease 行為。有限 stress 的 RSS/heap/queue/latency 閾值須先寫入 fixture contract,再執行;不可事後挑一個剛好會過的閾值。記錄 total bytes、retained preview bytes、max pending events、suppressed preview bytes、process-exit-to-output-settled、abort-to-settled 等可取得指標;不要虛構 provider token telemetry。

驗收與優先級

不採用的做法

不引入 ODW 執行 dependency;不照抄 dangerously-full-access;不以顯示正常取代 result/evidence 完整;不以 schema error 為模型重送授權;不把取消本機 polling 當成遠端已停止;不改 Nexus-new Admission/Planner/治理。實作前先核對 #62 的六檔暫停工作及四檔 transport 候選,避免覆蓋未提交修改。

Activity

  1. James3014 commented on Sep 11, 2026

    @James3014
    OwnerAuthor

    CLOSURE LEDGER — 2026-09-11

    Issue #63 audit umbrella is now decomposed and can close without hiding residual work.

    Completed bounded repair:

    • Finding 1 — split-chunk UTF-8 corruption in Agy subprocess output and ProcessSession pipe output.
    • PR fix: preserve UTF-8 across provider output chunks #82 merged as canonical main commit d84d66cc4490caa08ec2626890c5392f68f3e070.
    • Exact PR-head macOS Smoke passed Typecheck, Test, Build, and Doctor.
    • Windows is explicitly outside current Owner scope; its hosted failure is historical/non-gating and no Windows repair is authorized.

    Residual findings transferred one-to-one:

    Each follow-up is macOS-only and requires fresh-main falsification before mutation. Closing #63 means the audit/decomposition owner is complete; it does not claim #85–#90 are fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions