全站搜尋
語言:繁體中文
  • 繁體中文
  • English(尚無此語言版本)
  • 日本語(尚無此語言版本)
重新設計:持續探索 / 動態傳輸 / 逐連線治理

P2P Downloader v2.3:核心架構與連線治理

讓每個合法目標持續取得來源資訊;有證據就試跑,有收益就留在 pool。下載數不是固定上限,空連線也不是成果。

新增 Connection ManagerSQLite 保存事實與證據122 Tracker+12 eD2k 候選未測端點 ≠ 安全端點
本輪實質變更:獨立探索與傳輸迴路、彈性試跑/正式池、PoolSupervisor、連線分析與可撤銷政策。保留 Config 分檔、React 來源 tabs、增量檔案/hash 分桶與死檔 journal;不加入 VPN、登入或 User 系統。
本文目錄

日期:2026-10-03。這是設計規格,不是已部署或已通過實網驗收的產品。 本輪完整範圍是重新設計 Scheduler/Component 的探索與傳輸、加入連線治理,以及可追溯的 tracker/eD2k 預設來源。檔案中的延遲、比例及容量是可調的起始政策,不是實測最佳值。

Markdown、JSON Schema、SQL、TOML 是實作契約;HTML 是相同內容的審核視圖。reference/model.py 只是可執行的離線決策參考,不是 P2P Engine。沒有修改原 repository、開啟 peer 連線、發送 announce、測速或刪除資料。

01|本輪改掉什麼

前版將大量工作先留在 Store,再以小量准入探索為主。這版改為:所有合法目標立即加入探索與分析工作集;來源資訊持續回流,哪個準備好就先試跑;正式下載 pool 的規模由可持續資源餘裕決定。 不等全部 1,000 個探測完,也不讓固定的 5、8 或 32 個傳輸槽限制其餘目標取得來源資訊。

決策 v2.3 規定
探索資格 所有合法目標同時可參與;與傳輸池容量分開。一次匯入 1,000 個,不建立 1,000 個 Engine,也不先建立 payload 檔。
半連接 以「短生命週期的來源探測」理解使用者目的;完成協定握手/必要 metadata 後,保存證據並釋放可釋放連線。不是故意停在 TCP SYN 半開狀態。
連線並行 取消固定任務數上限;connection_window=auto。FD、記憶體、系統壓力與遠端協定限流仍構成動態背壓,沒有真正無限的 socket。
試跑與正式傳輸 兩者都是可伸縮的資源集合,不是固定數量的槽。以有用資料、穩定度與成本決定升降。
專門監管 Scheduler 內設 PoolSupervisor,持續觀測下載、輪替與觀察區;連線治理另由 P2P Connection Manager 管理。
封鎖 窄範圍斷線、暫時避開、可撤銷隔離、人工持久封鎖分開;不能以零流量或國家直接推論惡意。
預設來源 內建可追溯候選及更新政策;候選可先驗證,不等於所有端點同時使用或已確認安全。

本輪取代 v2.2 的固定 probe/transfer 槽思路、單一排程分數主導及「不需要新連線元件」結論。保留 Config 分檔、來源 tabs、Component.Downloader+Engine、Store 使用 SQLite、Metrics 集中保存、增量寫入、hash 分桶、完成搬移與死檔清理。VPN Manager 與產品 User/登入系統仍不在本輪核心。

02|總覽:九個邏輯元件,不是九個微服務

九個邏輯元件:排工作、管連線、做協定分開 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 九個邏輯元件;控制命令不承載檔案 payload 01 P2P Web View React;來源與連線詳情 02 P2P Manager API/Registry/Operation 意圖/狀態 03 P2P Config 分檔、default、版本快照 有效設定 04 P2P Search 所有合法目標皆可探索 共用來源查詢;來源 tabs 05 P2P Scheduler Trial/Active/Observation PoolSupervisor 動態調節 09 Connection Manager 逐連線證據與風險政策 可撤銷 avoid/精準斷線 搜尋意圖 下載意圖 治理操作 來源證據 連線摘要 06 P2P Component × N 長駐 Engine 共用多個 Task;沒有每下載一個程序 Search Provider Discover/Probe Downloader 管理工作與傳輸 budget Connection Agent 實際連線動作/回報 P2P Engine wire/piece/檔案 I/O 探索請求 工作額度/降升級 精確 scope 命令 07 P2P Store:SQLite 任務、內容鍵、證據、政策、操作 journal 08 P2P Metrics 只集中保存觀測;故障不切斷調度回報 領域事件 → Manager → Store Publisher 推送;不自行落盤 ConfigReader 供所有元件讀取;Store 供 Search/Scheduler/Connection Manager 讀取;上圖不畫重複線。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。

建議新增第九個邏輯元件:P2P Connection Manager。 原先只需 Scheduler 讀資源摘要;現在還要跨 Component 追蹤每條連線、分析證據、避免誤封、執行斷線與政策復查。這是一個有獨立狀態和契約的責任,不宜埋進 Metrics,也不應使 Scheduler 直接操作各協定 socket。

元件 擁有的決策與狀態 邊界
P2P Web View 下載池、來源 tabs、連線表、證據詳情與操作狀態 React+Vite+Tailwind、繁中、純暗色;不直連 Engine。
P2P Manager API、Component Registry、意圖/Operation/領域事件入口 不代替 Scheduler 排程,也不代替 Connection Manager 判定惡意。
P2P Config 分檔 defaults、來源 feed、schema、有效快照、設定版本 候選遠端清單無權直接改設定;Component 讀同一版本快照。
P2P Search 關鍵字搜尋、exact resolve、按來源的發現排程 對已登記的所有目標持續提供來源;不負責試跑/正式傳輸。
P2P Scheduler 試跑、正式 pool、觀察區、資源最佳化與公平輪替 擁有 Task 的下載意圖,不操作 wire/piece;接收 Connection Manager 的可用性與成本摘要。
P2P Component 協定適配與執行能力 內含 Search Provider、Downloader、Engine、Connection Agent、Resource Reporter、Metrics Publisher;不是每 Task 一個程序。
P2P Store SQLite 任務、內容識別、快照、政策證據、命令與檔案 journal 單一寫入 owner;不保存每秒所有 peer 時序,也不保存 payload。
P2P Metrics 全部觀測樣本、時序、分布、監控 retention Component 只推送;不寫監控 DB 或監控 disk spool。Metrics 失效不代表下載失敗。
P2P Connection Manager 連線索引、服務資格、異常證據、來源避讓與封鎖決策 不新增防火牆或 VPN;Connection Agent 才能在 Engine 內執行具體動作。

第一版仍建議一個 Rust p2pd 內含控制/分析模組,多個 Component host 按原生引擎程序配置。Connection Manager 是邏輯可獨立測試模組,只有 CPU/延遲量測顯示需要才拆程序。

03|一口氣 1,000 個:兩條同時運作的路徑

一千目標的雙迴路:全面收集與彈性傳輸 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 探索不停、傳輸並行;不等 1,000 個全部回覆 所有合法目標 登記到 SQLite/去重 沒有固定 task 准入上限 共用來源探索 tracker/eD2k/Kad/Hub socket 並行受即時背壓 SourceSnapshot 身分/coverage/TTL 保存後釋放臨時探測 來源請求 資訊回流 到期/來源變動後重驗;共用 session/有效 ticket 不硬斷 候選排序 誰有證據誰先準備 未回覆不堵住別人 沒有全批次 barrier Trial 集合 需要的 payload 才試跑 不是固定幾個槽 Active 下載池 有用、穩定 → 持續服務 數量依網路/I/O 餘裕伸縮 核發額度 合格升級 PoolSupervisor 正常維持/增開/輪替 局部瓶頸只降壓對應 domain 持續回報 Observation 觀察區 排隊/缺段/低收益/逾時 新證據或到期 → 再試跑 釋放昂貴資源 重新試跑 有餘裕即補入 challenger:先 trial,再進 active 探測釋放 ≠ 清除來源證據;進觀察區 ≠ 死檔;下載池空間 ≠ 預配置整檔容量。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。

路徑 A 永遠運作: 批次檢查與去重 → 所有合法目標登記 → Store 歷史/metadata → 共用來源查詢 → 輕量握手/可用範圍 → 保存 SourceSnapshot → 釋放臨時連線 → 更新候選排序。

路徑 B 不等待 A 全部完成: 已有新鮮證據的目標 → 試跑集合 → 正式下載 pool → PoolSupervisor → 維持/擴充/輪替/觀察 → 到期或新來源事件回到試跑。

一開始可以把 1,000 個「探索工作」同時放入可執行集合。非同步 I/O 不表示 1,000×所有 peer 的 socket 必須在同一毫秒建立。共用 tracker transport、eD2k server session、Kad routing table 與已在取得中的相同 metadata;相同 content+realm+設定版本的來源查詢合併,結果可供多個選取範圍使用。

來源 protocol 的 reask/announce interval 必須遵守。BT tracker 的回應包含下次一般請求間隔;choked 又表示對方目前不送資料,這些都是正常協定語義,不是 Scheduler 可以任意壓縮的時間。S2

沒有全批次 barrier。 第 900 個目標先回覆,就先進可排序集合;第 1 個目標逾時不阻塞別人。錯誤輸入只拒絕該 item;成功持久化的項目須有個別 task_id、結果與可恢復的匯入 operation。

04|「半連線不限」的精確實作方式

libtorrent 把 connecting 稱為 half-open,handshake 是已建立連線但等協定握手;取得 peer 的 bitfield/queue 資訊通常需要超過單純 TCP connect 的步驟。S5

本規格用 probe_session 表示短暫探測,避免將「只收集資訊」錯寫成 TCP 半開。UDP tracker/DHT 可能沒有一條專屬 TCP 連線;連線表應同時分清邏輯 session 與實際 socket 數。

ProbeGovernor 只根據成本建立彈性窗口,不用固定的 max_probing_tasks=32:

window_headroom [個] = floor(min(FD 餘裕, 可用記憶體 / 每探測 p95 bytes) × 壓力折減)
new_dials_this_tick [個] = min(window_headroom, 本輪可取用的全域 dial tokens, 各來源 tokens)
tokens_added [個] = adaptive_rate [次/秒] × elapsed [秒]

窗口控制同時存活數,token bucket 控制每秒新增速率,兩者不得相乘造成單位錯誤。FD 餘裕扣掉目前占用及控制通道保留;同一實體 transport 只計一次。NAT state、暫時 port 耗盡、event-loop lag、DNS/dial timeout 暴增都必須回饋 Governor;觀測不到 NAT state 時不能宣稱已掌握其容量,使用失敗率與保守增長作替代。已完成探測立即歸還資源;有明確終止 deadline,避免半開占滿 FD。

釋放連線時保存:目標內容與 selection digest、來源 endpoint/身份強度、宣告 coverage、服務/排隊情況、TTFB 或尚未取得、report sequence、觀測時間、失效時間、錯誤分類。速率只能由 payload 試跑量測;握手快不代表下載快。

例外是共用 eD2k server/Hub session、需要長駐的 DHT,以及斷線會丟掉有效 queue ticket 的原生協定。只釋放 task-local 探測資源;不得為了「探測後斷線」破壞整個 Component 的來源發現。維持 ticket 的成本要另列,且不得暗中自動開始無預算傳輸。

05|狀態模型:工作、連線、來源品質分開

Task、連線、品質與安全的正交狀態 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 狀態不是一個分數;同一下載可以「不完整但正在有效取得稀缺段」 collecting 收集所有合法目標 rank_ready 有足夠新鮮證據 trial 有界有效資料試跑 active 可持續有效傳輸 observing NO_SOURCE/REMOTE_QUEUE MISSING_SEGMENTS/TIMEOUT held 使用者暫停/本機故障 unknown operation 待核對 finished 要求資料完成原生驗證 搬移、分享狀態另行處理 trial/active 遠端不可用 完成 本機阻塞,不處罰 peer 新來源/到期/輪替機會 → 重回 trial 來源品質(獨立欄位) high/available/unknown/incomplete/low 取決於觀測供给、服務與效率;不是安全認證 風險證據(獨立欄位) unknown/anomaly/attributed_invalid/manual_deny 國家、peer ID、速度不等於善惡 dead_candidate 僅屬長期檔案生命週期;不能由任一次 observing 自動觸發清理。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。
Task 主階段 進入條件 退出條件
collecting 收集中 合法意圖已提交 有足夠新鮮來源證據即可 rank_ready;尚未完成其他目標不影響。
rank_ready 待試跑 可查到內容/服務路徑,允許試跑 取得彈性試跑資源;證據過期回收集。
trial 試跑 Downloader 確認原生服務開始或有界等待 可用且穩定則 active;樣本不足/遠端排隊/失敗則 observing。
active 正式 pool 已證實有用資料且資源允許 完成到驗證;本機壓力到 held;遠端不可用到 observing;公平輪替保留 checkpoint。
observing 觀察區 目前不值得長占昂貴資源 新來源、冷卻到期、queue ticket 可服務時復查/試跑。
held 保留 使用者暫停、本機磁碟/引擎故障、未知命令結果 必須依具體原因恢復,不記來源失敗。
finished 傳輸階段結束 全部要求資料已取得且按原生驗證規則完成 搬移/分享另由 placement state 管理。

observing.reason 必須具體:NO_SOURCE、MISSING_SEGMENTS、REMOTE_QUEUE、SERVICE_TIMEOUT、LOW_MARGINAL_YIELD、STALE_EVIDENCE。dead_candidate 是後續長期檔案生命週期,不是 observation 的同義詞。

來源品質為正交欄位:high / available / unknown / incomplete / low;安全證據為 unknown / observed_anomaly / attributed_invalid / manual_deny。UI 可以正確顯示「不完整・正式下載中・安全性未知」;高速度不會清除安全隔離。

06|來源完整性與優先序

以同一原生內容、layout 和 selection 評估。本機已驗證集合 V,缺少集合 M,新鮮來源宣告集合 A_j:

M = selected_units − V
observed_coverage = bytes((V ∪ union(A_j)) ∩ selected_units) / bytes(selected_units)
missing_supply = bytes(union(A_j) ∩ M) / bytes(M)

沒有缺少單位時進入完成驗證;不繼續找 seed。觀測來源只有互補部分也可完成;所有來源共同缺尾段,即使來源很多也仍是 incomplete。沒有原生 bitfield 的協定保留 unknown,不能因缺欄位就禁止有效下載。

優先序 0..999,越低越優先;但先通過使用者意圖、政策、去重、原生 retry floor、資源資格。排序特徵包括:新鮮可供給覆蓋、稀缺段價值、有效速度分位數、穩定度、TTFB、連線/I/O 成本、過去有資格服務的成功率、等待欠額、近完成收益、重新排隊成本。不使用國家或 peer ID 數值大小當速度/安全分數。

排序不能代替服務保證。未知工作有探索欠額;低速但唯一持有稀缺段的來源有 rescue 預算。手動權重不能越過封鎖、磁碟滿或未知執行狀態。

07|Trial Controller:不是連上就升級

試跑只取真正需要的資料,樣本可續用,不下載垃圾測速。初始 bytes/時限只是資源窗口;取完一個驗證單位前不可把 verification_pending 說成 hash failure。

trial 的時間分成 wall-clock 與 qualified-service-clock。遠端 queue/choke、本機限速、磁碟阻塞、report gap 都不能算「對方已承諾服務卻不送資料」的時間。取得原生服務後才評估 TTFB、連續窗口與獨特 payload。

升入正式 pool 的必要條件: 至少三個有效觀測窗口;實際增加尚缺少的 unique bytes;可接受的錯誤/重複比率;目前沒有安全隔離;相對該協定與主機有效容量,增量收益高於試跑成本。min_qualified_ms=15000、每窗 5 秒、CV≤0.75 是調參起點,不是通用成功定理。

大檔低速/長 RTT 不能只因未達固定 MiB/s 被淘汰。協定提供慢速但穩定服務,也可走 fair/rescue 升級;小檔在試跑期間完成直接轉驗證,不硬湊三窗。可驗證單位超出窗口時延長經核發的 byte budget,或回 inconclusive;不能超額。

08|彈性下載池:任務數是結果,不是目標

依網路與 I/O 調節的動態池控制 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 以可持續 unique goodput 為收益;不要用連線數當成果 原生資源摘要 網路 RX/TX/有效 bytes 每 device backlog/p95 延遲 FD/RAM/CPU/hash queue PoolSupervisor freshness/共同故障 分清遠端零速與本機降速 report 缺口不是 0 CapacityController 已知容量 → 利用率 未知容量 → 邊際收益試探 擾動一次,等待穩定 1 秒摘要 約 10 秒決策 有餘裕 → 擴充 trial 例:5 個下載只用 50% 網路 磁碟健康/等待來源可用 peer/window 先檢查;再補工作 已飽和 → 保持與挑戰 保護穩定 incumbent 少量新來源/欠額/稀缺救援 不為輪替而整池重啟 有壓力 → 局部 drain 寫入 backlog/延遲過高 停止增加該 device 的流量 不懲罰受本機瓶頸影響的來源 資源向量、實際效益、原生執行能力共同決定 Downloader / Engine 執行並核對 命令 run-bound;額度按 requested/effective/unknown 記帳 新增無收益 → 回滾/比較 challenger;有限 drain 才歸還全部額度 下一窗口再觀測 原始碼參考只測決策,不包含真實網路控制;94% 目標與步幅是可調起點,不是已量測最佳值。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。

PoolSupervisor 收集即時資源摘要,CapacityController 做全局調節,FairRotator 決定具體的候選與讓出者。三者是 Scheduler 內部模組。不是再建立一個與 Engine 搶控制權的 piece scheduler。

目標是 最大化可持續有效吞吐,且保留控制、驗證、落盤與互動餘裕。設定目標 94% 是可調目標,不是保證同時把網路、CPU、磁碟都跑到 100%。其中一個資源先成為瓶頸,其他資源不滿是合理結果。

觀測 控制動作 禁止行為
5 個下載只用半數已知頻寬,I/O/CPU 健康,有候選 先檢查活躍來源是否可增加請求/peer;不足時自動增加試跑,升級後 pool 自然變大 因「最多 5 個」而停止增加。
網路未滿,磁碟 backlog 持續上升、落盤延遲變高 減少新的傳輸 grant,讓低收益工作 drain,維持驗證及 flush 將零速怪在來源、加入黑名單。
網路接近目標,backlog 穩定 保留高收益 incumbent;用小比例探索與候選挑戰 為湊更多連線破壞穩定。
新增工作後有效速度沒有改善,成本增加 回滾最近擴張,挑戰式輪替低邊際收益工作 無限新增或全 pool 同時暫停重啟。
網路容量未知 依有用資料與成本逐步試探;UI 顯示估計/未知 以 1 Gbit/s NIC 宣稱可用 Internet 頻寬。
report 過期 停止積極擴張,保持原生安全資源控制並重新同步 把缺樣當 0 B/s 或空閒資源。
無更多有效來源 紀錄 SOURCE_LIMITED,維持觀察/retry 保證一定吃滿,或發無關流量來填滿頻寬。

net_utilization 使用同一瓶頸域、相同 byte 層次的計數;unique_goodput 是去除重複/無用資料後的收益,不能直接和 NIC 線速混作一個分母。下載、上傳、控制/DNS overhead、其他程序流量及 shared device I/O 分開記帳。

每個磁碟/檔案系統獨立 pressure domain;慢 HDD 只應限制寫往它的工作,不全面凍結另一顆空閒 SSD。Linux PSI 可提供 CPU、記憶體、I/O stall 訊號,但它不是完整網路容量或磁碟吞吐量測。S14

09|控制演算法、震盪與公平性

原始樣本約 1 秒,決策約 10 秒;變更後至少 30 秒或原生啟動成本的較大者再判成敗。快速保護事件不必等此週期。最近 10–30 秒 robust EWMA/中位數用於吞吐,p95 用於延遲與記憶體成本。

如果 local_pressure >= 1:drain 低邊際收益且可讓出的工作,停止積極擴張
否則如果資料不新鮮或前次擴張未穩定:hold
否則如果 network < 90% 目標且 local_pressure < 0.70:增加 trial 的資源預算
否則如果新增工作連續兩窗無正邊際收益:回滾/輪替候選
否則:維持正式 pool;持續小比例探索、欠額償還與稀缺段救援

新增步幅以目前可負擔 population 的 25% 作起始估算,縮減以 15%;真正准入仍逐筆做 resource-vector ledger。每次最多改一個主因(task population/每工作 peer credit/request window),避免無法辨識瓶頸。不是把 ceil(active×1.25) 當永遠正確的下載個數。

輪替採 incumbent/challenger:同條件下候選預估效用至少高 15%,或欠額到期;一般 minimum residence 120 秒、每輪最多約 5% population。這些可以按 Component 啟動/排隊成本放寬;明確無效、協定破壞或使用者取消可立即處理。

保留 effective service debt,休眠/被限速不等於已服務;遠端 queue ticket 不是下載資格,但有保留價值。分享/上傳也消耗資源,需計入上傳、磁碟讀與併發 ledger,不能只保下載 RX。

10|Connection Manager:每條連線都能解釋

連線分類:有資格卻不送資料,才記來源過失 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 Connection Manager 分析;Connection Agent 執行;SQLite 保留決策證據 連線身分+角色 connection_id/run_id payload/tracker/server/DHT physical transport ≠ task ServiceEligibility 有需要範圍、已發 request 非排隊/choke;已給 recv credit 本機健康、回報新鮮 EvidenceAnalyzer qualified idle duration unique/duplicate/驗證歸因 觀測來源,拒絕推測意圖 正規化 有資格計時 正常等待/本機阻塞 tracker 沒 payload 是正常 遠端 queue/本機 disk full 不加惡意 strike 有資格、request 逾時 bounded retry 仍無進展 斷指定連線+暫時 avoid 證據 replay 不加倍懲罰 可歸因協定/內容破壞 錯誤 frame/已歸因壞 piece 最窄 scope 的隔離 多來源壞 piece 不全體判罪 PolicyResolver → Durable Outbox → Component.Connection Agent 作用範圍不可擴大:connection/content-source/endpoint/IP 各自獨立 核對 run 與 connection,回 applied/unsupported_scope/unknown;無 ack 不說成功 斷線/避免/隔離命令 TTL 到期:只允許一次重新試驗;解除必須核對 Engine 政策 qBittorrent 原版 banPeers 是 IP ban;不得假裝成「只關一條連線」。精準 bridge 仍需實作驗收。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。

內部模組:ConnectionRegistry → ProtocolStateNormalizer → ServiceEligibility → EvidenceAnalyzer → PolicyResolver → CommandOutbox。另有 ReputationLedger 與到期復查。只接收受註冊 Component/Collector 回報,不把 peer 自稱的統計當本機量測。

欄位群 必要資料 語義
唯一身分 connection_id、component_id、run_id、native_connection_key、transport_handle_id 同端點重連有新 connection_id;程序重啟有新 run_id;防止晚到斷線命令傷到新連線。
關聯 realm、protocol、roles、task_ids、source/tracker/server provenance 一條 transport 可關聯多個 logical work,實際 FD 只能算一次。
endpoint/身份 IP+port 或 overlay Destination、peer_id/user_hash、身份證明強度 BT peer ID 和 eD2k user hash 不自動構成可信的人類/裝置身份。
可服務條件 handshake、remote_choked、interest、remote_queue_rank、slot_granted、outstanding requests、recv credit can_serve_now 必須依原生協定計算,未知不是 false。
資料品質 payload/unique/duplicate/discarded/verified bytes、hash failure attribution keepalive 有 bytes 但不是檔案進度;hash 尚未跑完不是壞資料。
效能 TTFB、request latency p50/p95、RTT 方法、goodput 窗口、stall qualified duration 各測量方法/時間窗明列,避免把 connect RTT 當持續 RTT。
本機干擾 local throttle、disk backlog、hash queue、memory/event loop、report gaps 用於排除誤判;不能用「網路未滿」否認磁碟塞車。
地理/網路 country、ASN、database version、observation age、unknown reason 本地離線查詢;不把所有 peer IP 傳給第三方。國家不參與風險加分。

libtorrent peer_info 的原生 API 有 pieces、payload speeds、待寫磁碟 bytes、request timeout、choke/snubbed 等資訊;qBittorrent WebAPI 是否暴露相同細節必須另測,不因底層有欄位就聲稱 adapter 可取得。S5

10.1 連線 ID「等級」要拆成三個維度

connection_id 是本機追蹤 key;peer_id/user_hash 是對端協定身分;High ID/Low ID 是 eD2k 的可達性資訊。它們不是同一種等級。eMule 官方文件說明 High ID/Low ID 來自伺服器對入站可達性的判斷;ID 數值更大並不帶來更好的等級。S18

設計上保存 reachability_class=direct/callback_needed/unknown、觀測 server/時間、callback 結果及原生 ID 類型。需要 callback 的來源可能有額外成本,但不能直接判定不完整或惡意;調度以實際能否取得需要的資料為準。國家/ASN 僅作分布與診斷,不建立國家黑白名單或安全百分比。

11|零流量:符合服務資格才開始算過失

連線角色先分類:payload_peer / tracker / ed2k_server / dht_session / hub / metadata / provider / upload_only。tracker 和 eD2k server 的工作是資訊/索引,不傳檔案 payload;對它們不能套用下載流量門檻。eMule 官方說明也將 server 定義為檔案與來源索引入口。S11

合格無回傳計時 qualified_idle_ms 只在以下皆成立時累加:

payload 角色 + 有我們缺少且對方宣告可供給的範圍
+ 握手完成 + 對方原生狀態允許服務(非 choked/非排隊)
+ 實際發出尚未完成的 request + recv/write credit 已核發
+ 本機無已知瓶頸 + 網路域未共同故障 + 回報新鮮

每次有效 unique progress 重置計時。協定 keepalive 不重置;合格時間暫停時不偷計 wall-clock。對已逾期請求執行有界取消/retry;反覆失敗則 disconnect + temporary avoid,保存證據。不存在實際 request、對方合法排隊、沒有缺段交集,最多釋放無用連線,不增加惡意 strike。

期限按 max(protocol floor, 8×RTT, request size / expected lower-bound rate + margin),再限定在可調範圍;不能只用 RTT 判大 request。基礎 reference 用 30 秒作測試門檻,正式 Engine 必須使用其原生 request deadline,不能比協定規定更激進。

流量有但進度不動要另分:重複 endgame block、已驗證範圍、無用訊息、暫存還沒校驗、對方送錯範圍。本機確認未發送 request 的 unsolicited 小幅晚到資料,不應一律判攻擊;證據須考慮取消競態與協定允許行為。S2

12|黑名單不是單一永久 IP 清單

名稱 觸發 範圍/到期 恢復
disconnect 斷此連線 無用連線/有資格逾時/已證實 malformed 精確 run+connection,不必附永久處罰 可依新證據重連。
avoid 暫時避開 有資格卻不回有用資料;本機干擾已排除 預設 realm+content+source;60 秒起,獨立再犯倍增,最高 1 小時 到期只放行一次試驗;成功消除/衰減。
quarantine 隔離 可歸因的壞資料、協定破壞、惡意 metadata 行為 最窄可證明範圍;預設 1–24 小時,留證據 核對/重新試驗/人工撤銷。
manual_deny 人工封鎖 使用者明確指定 可永久,必須顯示 scope 及副作用 人工解除。

相同 evidence_id 重播不能重複加 strike。policy 有 config_revision、expires、原始原因和實際 enforcement;requested、enforced、unsupported、unknown 分開顯示。來源 A 在檔 X 上沒服務,不得自動封鎖檔 Y、同 NAT 的其他 peer、整段 ASN 或整個國家。

多個 peer 共同提供一個壞 piece,不能直接判每個都是惡意來源。先隔離驗證單位與本機寫入/RAM 故障,再用可歸因的單一來源重測或已驗證的原生 attribution。原生 libtorrent 也有針對 hash failure 參與者的 parole 機制,而非把所有參與者立刻永久封鎖。S5

封鎖解除不能只改 UI。 須撤銷原生政策並核對;只支援永久 IP ban 的 adapter 不得冒充可撤銷的單連線 avoid。

13|釣魚、誘捕、監測與安全判斷的能力界線

系統能偵測的是可觀測行為,不是對方的真實意圖。能分析:路徑穿越、危險 URL/控制字元、錯誤 wire 長度、壓縮炸彈、已歸因 hash 失敗、來源宣告與實際不符、反覆回傳不可用來源、要求開啟外部頁面或輸入帳密的 metadata。UI 對這類內容只顯示純文字與警示,不自動執行、預覽腳本或開啟連結。

不能保證辨識 honeypot、著作權監測或被動記錄者。 一個完全遵守協定且提供正確資料的端點,仍可能記錄你的 IP、hash 與時間。正常傳輸、HTTPS、peer ID、國家、雲端 ASN、很多網站收錄都不是「不是誘捕節點」的證明。surveillance_intent=unknown 不用偽精準的百分比分數包裝。

風險分類與效能評價分離:availability_evidence、integrity_evidence、protocol_behavior、provenance_confidence;只有可具體驗證的 evidence rules 能自動產生狹窄限制。AI 日後可協助說明/分群,但不可單憑 LLM 猜測下全域 ban。

回應 provider 注入內網/管理 port、廣域相似來源洪水、DNS 轉向、metadata 變更等異常時,先保留 provenance,隔離對應 candidate/source;不能因短期網路 outage 將所有來源打入黑名單。

14|能力接口:精準治理不能只靠粗粒度 adapter

ComponentCapabilities 按版本區分 reporting 與 enforcement。必須列:per_connection_identity、service_eligibility、per_peer_piece_map、request_progress、disconnect_connection、avoid_content_source、reversible_ban、metadata_without_payload、retain_queue_without_autostart。值為 native / observed / unsupported,附已測 fixture version。

讀到的 qBittorrent banPeersAction() 會解析端點後呼叫 banIP(),因此不能拿來實作只關一條連線的命令。S6

後端 這版要求
REMULE 自研 Engine 提供逐連線 ID、request/part 進度、queue、精準 disconnect、content-source avoid 與可撤銷 policy。這是必需實作,不只是 UI。
原版 qBittorrent WebAPI 保留可取得的 torrent/peer 摘要;逐連線服務資格未知時,不啟用猜測式自動封鎖。精準動作回 unsupported_scope。
qBittorrent 完整治理模式 需要可維護的 Engine bridge/受控 extension 或明確審核的 patch,接到底層 connection handle;列獨立任務和驗收。不能聲稱 libtorrent 公開 API 已保證所有逐連線關閉能力。
slskd/DC/Kubo/I2P 各自保留 queue/Hub/provider/Destination;以被測能力實作,缺欄位以 null+reason 呈現。不得把國家欄位硬塞進 overlay 身份。

因此正式「全精度自動連線治理」對未提供必要能力的 adapter 是 BLOCKED,但來源探索、粗粒度工作調度及誠實顯示可先實作。這是能力分級,不是默默削減使用者要求。

15|Tracker 與 eD2k:廣泛收集、分級使用

安全來源目錄:廣收集,不盲目全啟用 目標架構示意;非實際系統量測。箭頭文字說明控制、證據或資料方向。 122 tracker 候選+12 當前 eD2k 候選;沒有做 DNS/握手/announce 測試 固定來源與快照 ngosang+XIU2(高度重疊) eD2k 頁面候選/明示 TCP port HTTPS MET 未取得,feed 停用 受限 Fetch / Parser HTTPS/同源 redirect 大小/條數/壓縮/port 只輸出候選,不能改 policy 端點/realm 驗證 每次 DNS/dial 重驗 拒絕內網與錯域位址 實際 socket 使用已核對 IP 來源白名單 typed data 有限探測與分析 原生 transaction/limits 合格來源效益與異常 usable 也不是安全認證 不盲信清單 Config catalog revision Store 暫存 provenance 發布不可變有效快照 手動 deny/pin 不被覆蓋 有效候選 Component 選擇使用 依收益增減來源 fan-out private 不注入公共 tracker I2P/WSS 必須符合能力 ConfigReader 自動察覺不是「知道對方是不是釣魚者」 malformed/DNS 轉向/來源洪水/假資料 → 可追溯證據+最窄限制 頁面 13 → 12:停止自動選用撤下端點、保留 diff;下架 ≠ 惡意。HTTPS ≠ 善意。 候選數是可核對的目錄筆數;既不代表独立營運者數,也不代表安全、可達或能增加下载成功率。
設計示意,非實際執行畫面。窄視窗可在圖中左右捲動。

本包已內建 122 個去重 tracker 端點、12 個當前 eD2k server 候選。Tracker 由 ngosang 的 75 個與 XIU2 的 122 個集合合併;前者在本次快照全被後者包含。去重是 URI 層級,不等於 122 個獨立營運者:DNS alias/共用 IP/同一團隊仍可能重複。

來源 本次取得 default 的用途 安全/完整性限制
ngosang/trackerslist 2026-10-02 更新快照,75 entries;原始 Git blob hash 已核對 版本化候選、每天有條件更新 維護者健康檢查,不是惡意或監測認證。
XIU2/TrackersListCollection 2026-10-02 README;all.txt 122 entries,Git blob hash 已核對 擴充候選,不重複灌入 Engine 含 HTTP/HTTPS/UDP/WSS;與其他 aggregator 有重疊。
eMule-Security.org 官網頁面 2026-10-02 16:02 UTC 列出 12 筆 把 IP+明示 TCP port 放入候選 default 本次沒有對 server 建立連線;不猜 UDP/混淆 port。
newTrackon 官方頁面與穩定清單說明 健康與 uptime 輔助查閱 /list 動態載入;未驗證機器 API,不臆造 /api/...。
歷史 gruk/peerates 清單 歷史官方/社群記錄可追查 不直接進啟用 default 舊 URL、HTTP、當前維護狀態未證實;不為湊數降低驗證。

S7 S8 S9 S10

最新頁面較先前 13 筆快照少了 1 筆。sources/ed2k-previous-snapshot.json 與 catalog/ed2k-source-diff.json 保留這次差異;撤下來源不再自動選用,但不因下架就標惡意。

HTTPS 的 server.met 本次未取得原始 binary,故 feed 已設定但預設停用;已有 12 筆頁面候選供啟動驗證。工具讀取失敗不等於已證明該 HTTPS URL 無法使用;禁止自動降到 HTTP。修正需要真實 HTTPS fetch、bounded parser fixture 與來源更新測試,完成後才啟用 feed。

WSS 端點是 WebTorrent 特定能力候選;不用在不支援的普通 BT Engine。敏感 port 如 UDP/25 先轉人工審核,不因出現在公開清單就自動發送協定資料;常見低 port 的 tracker 亦須角色/scheme 精確允許,不能套成一般 peer 的全域放行。

16|Config 的 default 與自動更新治理

config/source-feeds.toml 定義 feed URLs、授權範圍、更新時間、上限、來源血緣與驗證政策。catalog/trackers.json、catalog/ed2k-servers.json 是可追溯 bootstrap data。所有 Component 仍用 ConfigReader 取得已發布有效快照,不各自加入散落的硬編碼 server/port。

採以下交易路徑:Component 的共用 CatalogFetcher 只下載允許來源 → parser 回傳 typed candidates → Store 暫存候選/provenance → Connection Manager 做端點/行為政策 → Config 發布新不可變 catalog revision。原始 feed 不能帶 shell、extra headers、認證值、任意 include path 或覆寫本機 policy。

自動更新在使用者啟用對應 Component 後運作,不因開 HTML/安裝 spec 執行。每 24 小時+jitter、conditional request,只有兩個實際取得的 tracker text feeds 預設開啟。新端點先 validated/probing,舊的已知良好設定在更新失敗時保留;手動 pin/deny 永遠覆蓋 feed。

大量新增/刪除、domain 所有權或 DNS/憑證異常、大量非 public 地址、來源格式變更,進入 quarantine diff 供審核。HTTPS 與 Git blob digest 保護的是來源/傳輸與快照一致性,不能證明端點善意,也不把未驗證簽章稱為已驗簽。

17|自動安全察覺與來源效益分析

階段 檢查 結果
取得 HTTPS、固定來源、正常 TLS、同源最多 2 跳、不降級、timeout/encoded bytes 不符則保留 last-good,產生 feed event。
解析 raw/decoded bytes 上限、entry 上限、嚴格 port/URL、MET tag/count 邊界、壓縮炸彈 拒絕異常資料,禁止解析時執行或連線。
位址 literal/全部 A、AAAA/CNAME 最終地址、IPv4-mapped IPv6;拒絕 loopback/private/link-local/multicast/reserved 在每次 dial 及 redirect 後重驗,將當次已驗證 IP 釘到實際 connect;保留 TLS hostname/SNI。
協定 正常握手/transaction/request correlation、回應上限、來源地址檢查 usable_observed 只代表這次可用;遇到 malformed 暫時隔離。
語义 公共/private/I2P 等 realm;內容 hash/scope;eD2k index vs peer 不跨域注入,不外送 private hash。
持續觀測 合格查詢、獨特來源增量、可連線率、真正服務率、首次 byte 時間、壞結果比率 依邊際收益輪替來源,不按清單長度堆流量。

這些 SSRF 防護需要在實際 fetch/connect 路徑落地;只在字串 parser 做一次檢查不足以處理 DNS rebinding。OWASP 的驗證與 redirect/DNS 風險說明作為實作參考。S12

指標分母必須合格:new_usable_sources / qualified_lookup、payload_served_sources / qualified_connected_sources。重複來源不當新成果;0 次查詢是未知,不是 0%/100% 成功。共同網路失效的窗口不懲罰所有 source。來源完整性的宣稱、候選網域/IP 數與實際傳回有效片段三者分別統計;聲稱有 100% 並不自動等於可完成。

Tracker 的 UDP connect 並不等於收到有效 announce peers。BEP 15 定義 connect/announce/scrape,不同步驟結果分開保存;不對使用者所有 hash 做額外「測試 announce」。S15

Private torrent: metadata 明確 private=1 時不加入公共 tracker/DHT/PEX。尚未取得 metadata 的 magnet,先遵守原始來源資訊及所選隱私政策,不因「未知」就套公共 default;取得 public 證據後才按政策注入。BEP 27 要求 private torrent 只使用私有 tracker 的來源。S3

18|Downloader 與 Engine 的輸入、輸出、命令

接口 輸入 輸出/必要效果
Discover task/content/realm/Config revision/deadline metadata+sources 快照、coverage quality、expiry;不要求傳輸 grant。
ProbeSources 候選來源集、動態資源窗口、desired scope report 與可保留 ticket;探測完成釋放 task-local 連線並回報釋放結果。
StartTrial Task revision、source snapshot、byte/I/O/network lease run-bound operation+qualified progress;不能使用過期來源直接標高可用。
SetDownloadBudget task/run/generation+多維 resource vector requested/effective budget、enforcement strength;不可用回 unsupported。
PauseOrObserve 原因、保留 checkpoint/ticket 意圖 observed paused/retained queue/unknown;只有確定停止才釋放全部記帳。
ConnectionCommand run+connection+policy_revision+scope+action+evidence applied/already_closed/unsupported_scope/stale_target/unknown/failed。
ResourceReport Engine 實測 本機壓力、來源/工作/連線摘要直接送 Scheduler/Connection Manager;不是從歷史 Metrics DB 輪詢。
MetricsPush 原始觀測 batch+run/sequence/lost_count P2P Metrics 集中落盤;publisher 記憶體 queue 有界、允許帶缺口丟棄。

App 內部接口的 JSON 合約見 contracts/control.schema.json;對 Web 的新 API 見 contracts/control.openapi.json。示範 request 不含 provider credentials,也不接受任意 native API path。

真正建立 socket、選 piece、正常協定超時、parser 的立即拒絕屬 Engine。Scheduler 調整下載 budget;Connection Manager 下更窄的來源/連線限制。有效允許集合是兩者交集,Connection Manager 不能繞過使用者暫停或超出 Scheduler 的額度。

18.1 型別與預設語義

run_id、connection_id 和 native key 都是 opaque identifiers,不解碼成信任分數。report sequence 是 canonical 十進位字串,保存到 SQLite 時限制 0..9223372036854775807;到上限換新 run,不 wrap。其餘 API 計數/時間限定 JS safe integer,長期 bytes 使用十進位字串並檢查 uint64 上界。null 一律代表 unknown/不支援,附 missing_reason,不是 0。

SourceSnapshot 綁定 selection_digest,TTL 過期只降低可用性信心,不改檔案完整性;callback 必須符合 component/run/seq。ConnectionReport 的 service_expected 是 Component 將 handshake、interest、queue、請求資格及 credit 正規化後的結果;原始 details 若可取得也一併附帶。qualified_idle_ms 必須由單調時鐘、同一服務 generation 的有效觀測累計,前後採樣缺口不能填零。

對 multiplex transport,content-source avoid 只限制指定 work。若引擎只能關整條 transport 而其他 Task 正在有效服務,不能冒充「只關這個工作」;自動治理回 unsupported_scope,保留窄 deny-new-request 規則。人工「關此實體連線」必須顯示全部受影響 Task。

If-Match: "rN" 對應命令的 expected_policy_revision/expected_revision;body 和 header 不符拒絕。新增人工政策的 N 指當前有效 Config revision(由政策清單 config_revision/ETag 回傳);撤銷指該 policy row revision;連線命令指已核對的政策版本。不可混用。人工持久政策可沒有當前連線,使用 policy_commands 保存各 Component 的發布/撤銷結果,不強造 connection_id。request_id 最長 128 字元,在該管理 instance 去重;相同 body 重送只取得原 operation。瀏覽器 mutate 僅接受同源 JSON,CLI 可用私有 UDS;不存在產品認證,且不把這個 origin 檢查當成可抵抗同 UID 惡意程序。

19|可恢復命令與競態

每一命令含 request_id、payload_digest、expected_run_id、connection_id 或 task_id、expected_revision/policy_revision。先 Store 記 operation+outbox,再送 Engine。request_id 相同且 body 不同回 409;過期 run/connection 回 stale_target,不套到重連後的新 socket。

沒有 ack 代表 unknown,不當作已斷線或已解除封鎖。只讀核對實際連線或原生命令結果;不得改一個新 request_id 盲重送。單純本地關閉已不存在 handle 可回 already_closed,但必須核對同一 run 及身分。

資源記帳保留 pending / active / draining / unknown / released。衰減/暫停的授權在確認前仍算潛在傳輸負載。remote queue 若可能自動開始,就仍計入可自動消耗的 credit;不能把 label 改 observing 就騙取空閒資源。

Store 無法寫入時停止新的派工及政策擴張;Engine 仍可立即拒絕解析錯誤或依已發布 policy 斷線,自保事件暫存有界記憶體並標未持久化。Metrics 壞掉時維持即時 ResourceReport 路徑,標歷史觀測缺口,不停止健康下載。

報告 freshness 與服務計時採單調時間;持久化 expiry 使用 UTC 並保存原觀測/本機接收時間。重啟後遇到時鐘回退、過期範圍不明或 sequence 跳躍,標記需要重新觀測,不拉長封鎖、不偷計未觀測服務時間。Component 重新註冊換 run,不能借舊 ID 延續別條連線的違規次數。

20|SQLite 與資料責任

資料 owner/儲存 保存方式
任務、下載成功/失敗、native hash、去重 claim、檔案 journal P2P Store/SQLite 沿用 core tables;交易不可分裂。
探索 target、近期可調度快照 P2P Store discovery_targets、source_snapshots;有 expiry/selection/report seq。
連線開關索引、影響政策的證據 P2P Store connection_identities、connection_tasks、connection_evidence;不是所有 1 秒樣本。
暫時避讓、隔離、命令及結果 P2P Store connection_policies、connection_commands/policy_commands;target scope 索引、到期復查。
來源候選與發布血緣 P2P Store+Config Store 暫存 facts/revision;Config 唯一發布有效 catalog。
每條連線速度/RTT/國家歷史 P2P Metrics 自有儲存 本地去密 detail+aggregate;不是第二套 Task 成功判斷。
payload/原生續傳/範圍 journal Engine 的受管工作目錄 SQLite 不塞 payload BLOB;避免雙 writer。

tasks.execution_state 仍是 Engine 執行實況;discovery_targets.phase 是 Scheduler 的調度階段,並非第二個相同 state。所有涉及兩者的 transition 在同一交易處理:例如 desired paused → phase held;原生暫停未確認時維持 lease draining;完成驗證 → phase finished。新 migration 對無 run 證據的既有 running Task 先設 held/RECONCILE_REQUIRED,不能假定 active;原生重核對後再回 trial。

store-base.sql 為 v2.2 原始參考,store-v23.sql 為加法 schema。migration runner 先核對 baseline hash/版本,備份,獨佔 schema migration,使用 transaction,通過 foreign_key_check/integrity_check 才提交版本;不對任意未知 DB 直接執行。

Store 使用 SQLite WAL、單 writer、短 transaction、讀取 snapshot 與有界批次;checkpoint 由同一協調者排程,避免長讀阻擋回收。正式 WAL 部署須包含 SQLite WAL-reset 修補;本規格沿用至少 3.51.3 或核實 backport 的政策,不以本機 schema smoke test 冒充正式版本驗收。S13

21|檔案生命週期不因池輪替而破壞

不按整檔大小先預配置 payload,也不為全部 target 預留滿額。bytes 是實際 allocated blocks、native buffer、下一批寫入窗口、WAL/metadata/搬移暫存等分開記帳。sparse logical size 大於已配置 blocks 不等於真正占滿,UI 同時呈現兩者。

下載中/<hash[0:2]>/<hash[2:4]>/<storage_key>/...
下載完/<分類>/<hash[0:2]>/<hash[2:4]>/<storage_key>/...
死檔/<hash[0:2]>/<hash[2:4]>/<storage_key>/...

storage_key 為含 protocol namespace/native content identity 的穩定雜湊;未取得原生 hash 的 magnet 使用明確 provisional key,後續以 journal 遷移,不能悄悄換路徑。filesystem name 不是檔案身份,完整顯示原標題但不當成任意 path。

輪替/觀察只暫停工作與保存 checkpoint,不將每次觀察狀態都搬到「死檔」目錄。來源 snapshot 失效不等於資料無效;需長期多次合格觀測、無有效 queue/pin/writer/unknown operation,才成 dead candidate。

完成搬移先確認 writer 停止、驗證完成、manifest 固定。相同 filesystem atomic rename;跨裝置 copy→fsync→校驗→發布→更新 journal→刪舊檔,任一步失敗保留可恢復資料。分享中的 Engine 改路徑必須經原生 API 協調,不直接搬走還在使用的檔案。

自動清理預設關閉;啟用後依 Config retention、先隔離再 purge,刪除保留 tombstone。低速、個別來源被 avoid、tracker 暫時掛掉,都不能構成單獨清理依據。

22|React 工作台:審核得到每一個決策

延用 Noir Workbench 暗色、繁中、系統字體、固定語義色、無新登入/i18n/Next.js。來源搜尋仍分 tabs,保留每個來源的原生欄位;大量資料採游標分頁/虛擬清單,不每秒全表重新掛載。

視圖 必顯示
下載池 收集中/待試跑/試跑/正式下載/觀察/保留/完成數量,實際 active 與有 payload 數分開。
控制狀態 已配置/估計容量、unique goodput、network 層流量、I/O backlog、增開/縮減/輪替原因、最近一次擾動結果。
連線分析 類型、task/source、ID、國家/未知、速度、coverage、服務資格、合格零進度秒數、本機干擾、policy 及實際 enforcement。
來源目錄 候選/可觀測使用/隔離/退役,feed provenance、最後檢查、更新 diff、原生 endpoint/port、來源效益。
詳情 Inspector 完整 URL/hash/原生狀態、證據時間線、撤銷原因、trial 結果;機密 query 不顯示於公共目錄。

動作「關此連線」「暫時避開這個來源」「封鎖這個 IP」必須分開;不支援的精準動作 disable 並顯示原因,不能換成比較粗暴的另一種操作。誤封可撤銷但先核對原生結果;未知操作不顯示成功 toast。

來源名稱/客戶端字符串/message 全部視為不可信文字,禁止 dangerouslySetInnerHTML。篩選、selection、scroll、草稿、focus 在事件更新後保留;每個詳情只更新匹配的 object/run。200% browser zoom、forced colors、reduced motion、鍵盤與長 hash 需各自驗收。

23|資源與效能目標:必須量測,不是保證

目標測試基線由開發者記錄 CPU/RAM/storage/網路及 Engine build。規劃驗收:1,000 合法 target 登記後全部可被探索排程看見;有單一結果回來即可開始其試跑;本機 API 不因來源超時被阻塞;背壓時不出現無界 mailbox/連線重試;增加來源不導致 net throughput 持續下降而不回滾。

在合成 loopback 有可控足夠來源的測試中,5 個工作只使用 50% 容量時 controller 必須新增 trial;達到目標或新瓶頸後停止增長。控制器的效益以同一 workload 的 goodput、尾延遲、內存、FD、disk backlog 和 churn 同時比較,不能只看吞吐曲線。

提出初始 SLO:控制摘要 age p95≤2 秒;本地非資料查詢 p95≤200 ms;在合格服務逾時的 next control tick 內提出 disconnect;具體 Engine closure latency 另記。這些是目標,產品未實作前不標 passed。

壓力事件具優先通道;低價值高頻樣本合併,exact counters 不靠丟失的 delta 偷累計。每次 run 有 monotonic seq/reset;核對後才能連續顯示。Metrics 不能以 connection_id 作無界 Prometheus label;明細按 retention 存 detail,聚合使用有限 label。

24|遷移、回滾與開發先後

先凍結 v2.2 快照與 schema fingerprint;不直接套舊固定 slot 設定。新增 v2.3 的 auto 設定與 migration,在備份 DB 重放測試。舊的 max_active_tasks/max_probes 轉成歷史設定並顯示停用原因,不將它們偷帶回 auto 模式。

實作先後:合約與 state model → discovery 全域可見/短暫探測 → Connection Agent/Registry → 精準失敗資格與可撤銷 policy → adaptive pool → Config catalog fetch/validation → UI → 故障與實網驗收。REMULE 提供第一個全精度垂直切片;qBittorrent 的精準 bridge 是獨立依賴,不用原版 banPeers 冒充。

回滾前停止新派工、確認所有 draining/unknown 工作、備份 DB;不得讓舊版 Engine 同時寫相同 partial。優先恢復舊程序+對應備份,不對新 schema 做未驗證的 destructive down-migration。catalog 可以回到 last-good revision,政策 evidence 不隨回滾消失。

本包不授權 commit、push、部署、安裝外部工具、修改 VPN Manager 或使用未允許的測試資料。Claude Code 接手後直接實作和測試既定任務,不把全部內容重寫成另一份計畫就算交付。

25|已知限制與交付狀態

規格覆蓋本輪全部要求;產品尚未實作。 來源候選有實際公開資料和快照 digest;沒有 live peer/tracker announce/eD2k 下載測試。無「安全服务器」或「已排除釣魚」認證。

qBittorrent 原版的逐連線精準控制缺口,和 server.met 原始 feed 尚未取得,是本輪明示的整合/證據門檻;對應 full-feature acceptance 必須保持 BLOCKED,而不是把條件刪掉。Node/Rust/Engine 真正版本在實作 preflight 讀既有鎖檔及 owner policy 再固定,不臆造可用 build hash。

附件的具體校驗結果見 VALIDATION.md;ACCEPTANCE.md 的軟體案例是要做的驗收,不等於已跑完。互動 HTML 僅為規則示例,所有數據均標為合成,不會對任何來源發送請求。

把你擔心的情況,逐項代入。

以下只重演本文件的決策條件,不是真實測速、來源探測或下載模擬;不建立任何連線。比例、秒數與數量均為合成輸入。

一、動態 pool 決策

建議新增試跑:2 個

5 個下載只用 50% 網路,且本機健康。此數量是步幅示例;實際還須逐筆核發 FD/RAM/I/O/網路額度。

壓力比 1.0 代表所屬瓶頸域到達政策限制,不是整台主機 CPU 使用率。未知容量時看邊際收益,不假稱「用了 50% Internet 頻寬」。

二、同樣「沒在下載」,為何處置不同?

斷此連線+暫時避開來源

只在服務資格成立、請求逾時且已排除本機/共同網路故障後成立。不自動全 IP ban。

「暫時避開」預設是 realm+content+source,不是一律封鎖整個 IP,更不是封鎖國家。所有自動動作要保存證據和執行回覆。

三、預設候選目錄

122 個 tracker URI、12 個當前 eD2k server;另保留 1 個被上游撤下端點的舊快照。以下全部仍是未探測/意圖未知。顯示 URI 不會連線。

顯示 134 筆候選;全部未探測,安全意圖未知。

候選 協定 來源 預設處理
udp://tracker.opentrackr.org:1337/announce udp ngosang · xiu2 候選・先驗證
http://tracker.opentrackr.org:1337/announce http ngosang · xiu2 候選・先驗證
udp://open.stealth.si:80/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.torrent.eu.org:451/announce udp ngosang · xiu2 敏感 port・人工審核
udp://open.demonii.com:1337/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.skynetcloud.site:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.qu.ax:6969/announce udp ngosang · xiu2 候選・先驗證
http://tracker.qu.ax:6969/announce http ngosang · xiu2 候選・先驗證
udp://tracker.corpscorp.online:80/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.bittor.pw:1337/announce udp ngosang · xiu2 候選・先驗證
udp://explodie.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.tryhackx.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.gmi.gd:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker-udp.gbitt.info:80/announce udp ngosang · xiu2 候選・先驗證
udp://retracker01-msk-virt.corbina.net:80/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.nyaa.vc:6969/announce udp ngosang · xiu2 候選・先驗證
http://tracker.dler.org:6969/announce http ngosang · xiu2 候選・先驗證
http://tracker.dler.com:6969/announce http ngosang · xiu2 候選・先驗證
udp://tracker.dler.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker2.dler.org:80/announce udp ngosang · xiu2 候選・先驗證
http://tracker2.dler.org:80/announce http ngosang · xiu2 候選・先驗證
udp://tracker.ducks.party:1984/announce udp ngosang · xiu2 候選・先驗證
http://tracker.renfei.net:8080/announce http ngosang · xiu2 候選・先驗證
udp://tracker.peerfect.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.opentrackr.com:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.ilibr.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://mail.segso.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://t.overflow.biz:6969/announce udp ngosang · xiu2 候選・先驗證
udp://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce udp ngosang · xiu2 候選・先驗證
http://t.overflow.biz:6969/announce http ngosang · xiu2 候選・先驗證
http://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce http ngosang · xiu2 候選・先驗證
https://tracker.pmman.tech:443/announce https ngosang · xiu2 候選・先驗證
udp://ipv4announce.sktorrent.eu:6969/announce udp ngosang · xiu2 候選・先驗證
http://ipv4announce.sktorrent.eu:6969/announce http ngosang · xiu2 候選・先驗證
udp://evan.im:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.wildkat.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.004430.xyz:1337/announce udp ngosang · xiu2 候選・先驗證
udp://tr4ck3r.duckdns.org:6969/announce udp ngosang · xiu2 候選・先驗證
udp://seedpeer.net:6969/announce udp ngosang · xiu2 候選・先驗證
https://tracker.zhuqiy.com:443/announce https ngosang · xiu2 候選・先驗證
https://tracker.nekomi.cn:443/announce https ngosang · xiu2 候選・先驗證
https://004430.xyz:443/announce https ngosang · xiu2 候選・先驗證
http://tracker.mywaifu.best:6969/announce http ngosang · xiu2 候選・先驗證
http://004430.xyz:80/announce http ngosang · xiu2 候選・先驗證
udp://open.ftorrent.com:443/announce udp ngosang · xiu2 候選・先驗證
udp://martin-gebhardt.eu:25/announce udp ngosang · xiu2 敏感 port・人工審核
https://tracker.7471.top:443/announce https ngosang · xiu2 候選・先驗證
https://tr.nyacat.pw:443/announce https ngosang · xiu2 候選・先驗證
http://tracker.waaa.moe:6969/announce http ngosang · xiu2 候選・先驗證
http://tracker.dhitechnical.com:6969/announce http ngosang · xiu2 候選・先驗證
http://tr.nyacat.pw:80/announce http ngosang · xiu2 候選・先驗證
http://open.tracker.cl:1337/announce http ngosang · xiu2 候選・先驗證
udp://tracker.teambelgium.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.fnix.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.aruku.ovh:8081/announce udp ngosang · xiu2 候選・先驗證
udp://admin.52ywp.com:6969/announce udp ngosang · xiu2 候選・先驗證
https://open.ftorrent.com:443/announce https ngosang · xiu2 候選・先驗證
http://tracker.23794.top:6969/announce http ngosang · xiu2 候選・先驗證
udp://anime-tracker.aruku.kro.kr:8081/announce udp ngosang · xiu2 候選・先驗證
https://tracker.foreverpirates.co:443/announce https ngosang · xiu2 候選・先驗證
udp://tracker.torrents.observer:80/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.nyaa.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.cn.nyaa.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tr3.ysagin.top:2715/announce udp ngosang · xiu2 候選・先驗證
udp://kolankoalastree.newtrackon.co.nz:1337/announce udp ngosang · xiu2 候選・先驗證
udp://archive.torrentonline.cc:42069/announce udp ngosang · xiu2 候選・先驗證
http://tracker.zhuqiy.dgj055.icu:80/announce http ngosang · xiu2 候選・先驗證
http://1337.abcvg.info:80/announce http ngosang · xiu2 候選・先驗證
udp://yuptracker-eu.gaijinent.com:27022/announce udp ngosang · xiu2 候選・先驗證
udp://whybother.torrentonline.cc:42069/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.playground.ru:6969/announce udp ngosang · xiu2 候選・先驗證
udp://tracker.ddunlimited.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://ns575949.ip-51-222-82.net:6969/announce udp ngosang · xiu2 候選・先驗證
udp://edgev.duckdns.org:6969/announce udp ngosang · xiu2 候選・先驗證
https://t.213891.xyz:443/announce https ngosang · xiu2 候選・先驗證
http://107.189.2.131:1337/announce http xiu2 候選・先驗證
http://207.241.226.111:6969/announce http xiu2 候選・先驗證
http://207.241.231.226:6969/announce http xiu2 候選・先驗證
http://announce.sktorrent.eu:6969/announce http xiu2 候選・先驗證
http://bt1.archive.org:6969/announce http xiu2 候選・先驗證
http://bt2.archive.org:6969/announce http xiu2 候選・先驗證
http://nyaa.tracker.wf:7777/announce http xiu2 候選・先驗證
http://retracker01-msk-virt.corbina.net:80/announce http xiu2 候選・先驗證
http://torrentsmd.com:8080/announce http xiu2 候選・先驗證
http://tracker.internetwarriors.net:1337/announce http xiu2 候選・先驗證
http://tracker.xn--djrq4gl4hvoi.top:80/announce http xiu2 候選・先驗證
http://tracker1.itzmx.com:8080/announce http xiu2 候選・先驗證
http://www.wareztorrent.com:80/announce http xiu2 候選・先驗證
https://1.tracker.eu.org:443/announce https xiu2 候選・先驗證
https://1337.abcvg.info:443/announce https xiu2 候選・先驗證
https://tr.abiir.top:443/announce https xiu2 候選・先驗證
https://tr.burnabyhighstar.com:443/announce https xiu2 候選・先驗證
https://tracker.kuroy.me:443/announce https xiu2 候選・先驗證
https://tracker.midnightprogrammer.net:443/announce https xiu2 候選・先驗證
https://tracker.qingwapt.org:443/announce https xiu2 候選・先驗證
https://tracker1.520.jp:443/announce https xiu2 候選・先驗證
udp://52.58.128.163:6969/announce udp xiu2 候選・先驗證
udp://93.158.213.92:6969/announce udp xiu2 候選・先驗證
udp://[2a03:7220:8083:cd00::1]:451/announce udp xiu2 敏感 port・人工審核
udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce udp xiu2 候選・先驗證
udp://exodus.desync.com:6969/announce udp xiu2 候選・先驗證
udp://ipv6.govt.hu:6969/announce udp xiu2 候選・先驗證
udp://open.tracker.ink:6969/announce udp xiu2 候選・先驗證
udp://opentor.org:2710/announce udp xiu2 候選・先驗證
udp://opentracker.lain.moscow:6969/announce udp xiu2 候選・先驗證
udp://p4p.arenabg.com:1337/announce udp xiu2 候選・先驗證
udp://retracker.hotplug.ru:2710/announce udp xiu2 候選・先驗證
udp://torrent.tracker.durukanbal.com:6969/announce udp xiu2 候選・先驗證
udp://tracker.dler.com:6969/announce udp xiu2 候選・先驗證
udp://tracker.farted.net:6969/announce udp xiu2 候選・先驗證
udp://tracker.filemail.com:6969/announce udp xiu2 候選・先驗證
udp://tracker.flatuslifir.is:6969/announce udp xiu2 候選・先驗證
udp://tracker.k.vu:6969/announce udp xiu2 候選・先驗證
udp://tracker.skyts.net:6969/announce udp xiu2 候選・先驗證
udp://tracker.willy.pro:6969/announce udp xiu2 候選・先驗證
udp://tracker.yume-hatsuyuki.moe:6969/announce udp xiu2 候選・先驗證
udp://tracker1.itzmx.com:8080/announce udp xiu2 候選・先驗證
udp://tracker2.itzmx.com:6961/announce udp xiu2 候選・先驗證
udp://tracker3.itzmx.com:6961/announce udp xiu2 候選・先驗證
udp://tracker4.itzmx.com:2710/announce udp xiu2 候選・先驗證
udp://v2.iperson.xyz:6969/announce udp xiu2 候選・先驗證
wss://tracker.openwebtorrent.com:443/announce wss xiu2 需 WebTorrent 能力
eMule Sunrise — ed2k://|server|176.123.5.89|4725|/ ed2k emule-security-web 候選・先驗證
Nordic Server — ed2k://|server|77.42.68.79|4232|/ ed2k emule-security-web 候選・先驗證
Sharing-Devils No.4 — ed2k://|server|91.208.162.87|4232|/ ed2k emule-security-web 候選・先驗證
MO-Server — ed2k://|server|91.208.162.182|4232|/ ed2k emule-security-web 候選・先驗證
ed2k-rust — ed2k://|server|85.17.116.222|6082|/ ed2k emule-security-web 候選・先驗證
Sharing-Devils No.2 — ed2k://|server|85.121.5.137|4232|/ ed2k emule-security-web 候選・先驗證
eMule Cosmic — ed2k://|server|212.95.35.240|4232|/ ed2k emule-security-web 候選・先驗證
Mazinga Server — ed2k://|server|213.141.198.207|4232|/ ed2k emule-security-web 候選・先驗證
MO-ad-free — ed2k://|server|57.131.35.107|4232|/ ed2k emule-security-web 候選・先驗證
Drunken Donkey — ed2k://|server|193.187.90.12|4661|/ ed2k emule-security-web 候選・先驗證
MO-24/7 — ed2k://|server|212.95.35.240|4323|/ ed2k emule-security-web 候選・先驗證
Sharing-Devils No.3 TEST — ed2k://|server|91.208.162.55|4235|/ ed2k emule-security-web 候選・先驗證

四、你的審核筆記

僅在本頁記憶體;重新整理前請匯出。
候選來源原始資料:134 筆端點、來源血緣與未知狀態

保留原稿內嵌的完整資料欄位,只供閱讀;不會向端點發送請求。

[
  {
    "endpoint_id": "tr_e7aafb3a92ad2a4c04d3",
    "uri": "udp://tracker.opentrackr.org:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_5347b4c4a5d8897046d8",
    "uri": "http://tracker.opentrackr.org:1337/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9602e7b2019adcad1a45",
    "uri": "udp://open.stealth.si:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_49b560d0e99309186ed2",
    "uri": "udp://tracker.torrent.eu.org:451/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "manual_review_sensitive_port",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_768d2af44fd5cbd0bbb4",
    "uri": "udp://open.demonii.com:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9b45647cbc4ec20494df",
    "uri": "udp://tracker.skynetcloud.site:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8a3460ed3132abf5b5e9",
    "uri": "udp://tracker.qu.ax:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_7c3ca5e0e49e4b81b0ba",
    "uri": "http://tracker.qu.ax:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d52fbcb060a99de3d419",
    "uri": "udp://tracker.corpscorp.online:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_00b85fcb09930b486810",
    "uri": "udp://tracker.bittor.pw:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f90e8a1ef4642b3d458e",
    "uri": "udp://explodie.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_6a2d73948ec717bd1661",
    "uri": "udp://tracker.tryhackx.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_0d3c4bf282cf13183eaa",
    "uri": "udp://tracker.gmi.gd:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_0bc11831f07df4bbdcd1",
    "uri": "udp://tracker-udp.gbitt.info:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_0e68c794851f89008cb8",
    "uri": "udp://retracker01-msk-virt.corbina.net:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_2a15cbf6aeafc0a5ca00",
    "uri": "udp://tracker.nyaa.vc:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_7290c29a76512a7efbbc",
    "uri": "http://tracker.dler.org:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f0d50d0bf39024111736",
    "uri": "http://tracker.dler.com:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1305ac54bbf0dddb8f50",
    "uri": "udp://tracker.dler.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_4601f3abc045f1e2cafd",
    "uri": "udp://tracker2.dler.org:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_aea6c1899a6573ce1418",
    "uri": "http://tracker2.dler.org:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1da6adaf350291d38be0",
    "uri": "udp://tracker.ducks.party:1984/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_ccafa756cfa8bbf605f6",
    "uri": "http://tracker.renfei.net:8080/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8b9bbe1e89109d3807b3",
    "uri": "udp://tracker.peerfect.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1a8e7be370b3d0402f37",
    "uri": "udp://tracker.opentrackr.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_0a79fae0544191597bdb",
    "uri": "udp://tracker.ilibr.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_0e0e3c29f21b584bdd54",
    "uri": "udp://mail.segso.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8e43ee12d073342ce1ed",
    "uri": "udp://t.overflow.biz:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_7e056bf58ddd282514d2",
    "uri": "udp://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1c0dbd90b96339c7bef2",
    "uri": "http://t.overflow.biz:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_e65763949fba96ff14d9",
    "uri": "http://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_5399dffb660edcc7e377",
    "uri": "https://tracker.pmman.tech:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_ec9c8a050b732fab8d54",
    "uri": "udp://ipv4announce.sktorrent.eu:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_3a8e27ba74c65281f587",
    "uri": "http://ipv4announce.sktorrent.eu:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d31b5445418d00503b85",
    "uri": "udp://evan.im:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_bf6c1241ac9b56e6697c",
    "uri": "udp://tracker.wildkat.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_ad965301125418e0ead7",
    "uri": "udp://tracker.004430.xyz:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_ed4257101f050cf483a3",
    "uri": "udp://tr4ck3r.duckdns.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_177b8a369d20a9afcb0c",
    "uri": "udp://seedpeer.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_cfd72a51cd1ee02e8095",
    "uri": "https://tracker.zhuqiy.com:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_e239d5bc5eb10f0862f2",
    "uri": "https://tracker.nekomi.cn:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1ef5402a1ba857349587",
    "uri": "https://004430.xyz:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_e4838ecfad683c540971",
    "uri": "http://tracker.mywaifu.best:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_dbbc9fc9f9e0b6e415af",
    "uri": "http://004430.xyz:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_93fd046608d6f6415a59",
    "uri": "udp://open.ftorrent.com:443/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_a52edc69aeb9dcd0b3f9",
    "uri": "udp://martin-gebhardt.eu:25/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "manual_review_sensitive_port",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_65c37e05b8c3bf438115",
    "uri": "https://tracker.7471.top:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_3210bf260996b1e21e02",
    "uri": "https://tr.nyacat.pw:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_26c33d6e61a7ea8f32d5",
    "uri": "http://tracker.waaa.moe:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_62c68e75757248fdb3d4",
    "uri": "http://tracker.dhitechnical.com:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_6c13c9de7c3c4ffe98f4",
    "uri": "http://tr.nyacat.pw:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9d75a903482157d43261",
    "uri": "http://open.tracker.cl:1337/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_89becaa140a0e5855ccf",
    "uri": "udp://tracker.teambelgium.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_c29901bbbb842bd27834",
    "uri": "udp://tracker.fnix.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_22ffae26c9bb05586686",
    "uri": "udp://tracker.aruku.ovh:8081/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_a0b8fce3c58387d4b243",
    "uri": "udp://admin.52ywp.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_153629b08e1d449007ba",
    "uri": "https://open.ftorrent.com:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_dcbfaf8a6379c365c369",
    "uri": "http://tracker.23794.top:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8b6e6d8593717fcbd8e8",
    "uri": "udp://anime-tracker.aruku.kro.kr:8081/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_42d103ff92a192f10f17",
    "uri": "https://tracker.foreverpirates.co:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_b5f4bf48e5b62cc60a02",
    "uri": "udp://tracker.torrents.observer:80/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_30ab8a6195b3b937b936",
    "uri": "udp://tracker.nyaa.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_5136e11d0a4db5b8a2fd",
    "uri": "udp://tracker.cn.nyaa.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_3a517c9676460af2c244",
    "uri": "udp://tr3.ysagin.top:2715/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d8764c6a2e54e554d737",
    "uri": "udp://kolankoalastree.newtrackon.co.nz:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8f459cc4659bb8918879",
    "uri": "udp://archive.torrentonline.cc:42069/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_3e231294fec576a21474",
    "uri": "http://tracker.zhuqiy.dgj055.icu:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1d23856a4dcba12f0890",
    "uri": "http://1337.abcvg.info:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_bfad8febecc8d34ea60f",
    "uri": "udp://yuptracker-eu.gaijinent.com:27022/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d00204c2dc99432de5bc",
    "uri": "udp://whybother.torrentonline.cc:42069/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_a3715e45cc4ff2a08c08",
    "uri": "udp://tracker.playground.ru:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_b670d5ffef147c1a34f5",
    "uri": "udp://tracker.ddunlimited.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_92ff87846531ca4561d0",
    "uri": "udp://ns575949.ip-51-222-82.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_6322a4e0ac580ca0b5eb",
    "uri": "udp://edgev.duckdns.org:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_6426e702803f2a56bd2e",
    "uri": "https://t.213891.xyz:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "ngosang",
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1fa0694e8c47f66bab78",
    "uri": "http://107.189.2.131:1337/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_85bf612e15f11c251e06",
    "uri": "http://207.241.226.111:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9ac05b94a64cc1d0ee51",
    "uri": "http://207.241.231.226:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_81cf09ece384117fd0af",
    "uri": "http://announce.sktorrent.eu:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_effa179ee8647e57fba2",
    "uri": "http://bt1.archive.org:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1c78d114e0beafc157ca",
    "uri": "http://bt2.archive.org:6969/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9da1458a29c500d77fcd",
    "uri": "http://nyaa.tracker.wf:7777/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_197005b958105f57772b",
    "uri": "http://retracker01-msk-virt.corbina.net:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_93bd6abeb95507c17e4e",
    "uri": "http://torrentsmd.com:8080/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_fa444de822d4fc660cff",
    "uri": "http://tracker.internetwarriors.net:1337/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8a1943e27b9ded1c801c",
    "uri": "http://tracker.xn--djrq4gl4hvoi.top:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f4ba27c3df99e4a177a8",
    "uri": "http://tracker1.itzmx.com:8080/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d4c351818647f027f93d",
    "uri": "http://www.wareztorrent.com:80/announce",
    "protocol": "http",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_fecc3323bb8e25e365e0",
    "uri": "https://1.tracker.eu.org:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f949af7d4c434450546a",
    "uri": "https://1337.abcvg.info:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_ca197896ef641f99ca3e",
    "uri": "https://tr.abiir.top:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_6be536d2f232af5b867f",
    "uri": "https://tr.burnabyhighstar.com:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_96ebc73f40872cfdf53e",
    "uri": "https://tracker.kuroy.me:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_eb2db6860c56c56043da",
    "uri": "https://tracker.midnightprogrammer.net:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_aee04a414594e02c7a2f",
    "uri": "https://tracker.qingwapt.org:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9bb064af7f9fac5f7fed",
    "uri": "https://tracker1.520.jp:443/announce",
    "protocol": "https",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_5aa546aa6429c21562bd",
    "uri": "udp://52.58.128.163:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_621c69ccd287852c6ffb",
    "uri": "udp://93.158.213.92:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9aaf54b6de887e506605",
    "uri": "udp://[2a03:7220:8083:cd00::1]:451/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "manual_review_sensitive_port",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9b53ba718fdd78b7d97c",
    "uri": "udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_975eeb764b3c82e9eef5",
    "uri": "udp://exodus.desync.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_3c49cdb225af51e2cdee",
    "uri": "udp://ipv6.govt.hu:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_14abef20bbf32479b592",
    "uri": "udp://open.tracker.ink:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_793a7ea68ff42c290e2a",
    "uri": "udp://opentor.org:2710/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_d60a7f8cc21ae5c83f17",
    "uri": "udp://opentracker.lain.moscow:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_38611c3f8126c9b4e9f2",
    "uri": "udp://p4p.arenabg.com:1337/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f237059b169ee48288ba",
    "uri": "udp://retracker.hotplug.ru:2710/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_bb48f3e6abee60b5e719",
    "uri": "udp://torrent.tracker.durukanbal.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_66f78ddb6a174d3cdc58",
    "uri": "udp://tracker.dler.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f5d5a4239eab5bbe1755",
    "uri": "udp://tracker.farted.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_7231187c42916af832e5",
    "uri": "udp://tracker.filemail.com:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_35e5139bec3d124c5cb1",
    "uri": "udp://tracker.flatuslifir.is:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_1cf6e29fec5e1adfa926",
    "uri": "udp://tracker.k.vu:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8647636414170b8ae4cc",
    "uri": "udp://tracker.skyts.net:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_9c8f4b1393fa35c207cb",
    "uri": "udp://tracker.willy.pro:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_f1b4ca7ff40f7fc487eb",
    "uri": "udp://tracker.yume-hatsuyuki.moe:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_e3dc7e2540d3b9221c2b",
    "uri": "udp://tracker1.itzmx.com:8080/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_705c677be0bdfaadd829",
    "uri": "udp://tracker2.itzmx.com:6961/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_7a4c7e0d1162e7a57200",
    "uri": "udp://tracker3.itzmx.com:6961/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_8b119d7f519ba0442456",
    "uri": "udp://tracker4.itzmx.com:2710/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_638fd3f69d78a8cc976f",
    "uri": "udp://v2.iperson.xyz:6969/announce",
    "protocol": "udp",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "tr_bd4914bd4d5d433f649a",
    "uri": "wss://tracker.openwebtorrent.com:443/announce",
    "protocol": "wss",
    "realm": "public_bt",
    "source_ids": [
      "xiu2"
    ],
    "syntax_status": "passed",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "requires_webtorrent_capability",
    "country": null,
    "kind": "tracker"
  },
  {
    "endpoint_id": "ed_61f00ea481c990a9a6eb",
    "name": "eMule Sunrise",
    "uri": "ed2k://|server|176.123.5.89|4725|/",
    "ip": "176.123.5.89",
    "tcp_port": 4725,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_cd74a8536f0297e43f99",
    "name": "Nordic Server",
    "uri": "ed2k://|server|77.42.68.79|4232|/",
    "ip": "77.42.68.79",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_1749651af8b6af20bb96",
    "name": "Sharing-Devils No.4",
    "uri": "ed2k://|server|91.208.162.87|4232|/",
    "ip": "91.208.162.87",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_801e2a754201c3c505f7",
    "name": "MO-Server",
    "uri": "ed2k://|server|91.208.162.182|4232|/",
    "ip": "91.208.162.182",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_1d9ae4dc6a91c2279869",
    "name": "ed2k-rust",
    "uri": "ed2k://|server|85.17.116.222|6082|/",
    "ip": "85.17.116.222",
    "tcp_port": 6082,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_29423d6cd95a8ff0d7d8",
    "name": "Sharing-Devils No.2",
    "uri": "ed2k://|server|85.121.5.137|4232|/",
    "ip": "85.121.5.137",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_67ca89c53e638fafe3b9",
    "name": "eMule Cosmic",
    "uri": "ed2k://|server|212.95.35.240|4232|/",
    "ip": "212.95.35.240",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_449439c90b437084b2b0",
    "name": "Mazinga Server",
    "uri": "ed2k://|server|213.141.198.207|4232|/",
    "ip": "213.141.198.207",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_1d3c52855c846492aa58",
    "name": "MO-ad-free",
    "uri": "ed2k://|server|57.131.35.107|4232|/",
    "ip": "57.131.35.107",
    "tcp_port": 4232,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_29aae7e9d0f9c71fbe06",
    "name": "Drunken Donkey",
    "uri": "ed2k://|server|193.187.90.12|4661|/",
    "ip": "193.187.90.12",
    "tcp_port": 4661,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_a1debf19e9cc0aaa46c4",
    "name": "MO-24/7",
    "uri": "ed2k://|server|212.95.35.240|4323|/",
    "ip": "212.95.35.240",
    "tcp_port": 4323,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  },
  {
    "endpoint_id": "ed_2100cf95fa0d285e529e",
    "name": "Sharing-Devils No.3 TEST",
    "uri": "ed2k://|server|91.208.162.55|4235|/",
    "ip": "91.208.162.55",
    "tcp_port": 4235,
    "udp_port": null,
    "obfuscated_port": null,
    "source_ids": [
      "emule-security-web"
    ],
    "source_updated_at": "2026-10-02T16:02:00Z",
    "observed_date": "2026-10-03",
    "runtime_status": "unprobed",
    "risk_status": "unknown",
    "default_use": "eligible_for_validation",
    "kind": "ed2k",
    "protocol": "ed2k"
  }
]

本次交付與驗證界線

63 個離線參考測試、9 組文件/契約檢查與 43 項 Chromium 內容檢查通過。直接 file:// 導覽被環境政策阻擋;測試以同一 HTML 內容載入。已檢視六張圖及桌面/窄視窗。SQLite 3.46.1 只用於記憶體 schema 檢查,正式 WAL 版本與產品驗收尚未通過。

原版 qBittorrent 精準治理 bridge、HTTPS server.met 原始 binary 測試、真實 P2P 及檔案操作仍有獨立驗收門檻。資料表、HTML 與離線參考模型通過檢查,不代表正式 Engine 或所有來源已驗證安全。

契約、設定與開發交接原文

以下是此版同包 Markdown/JSON/SQL/TOML 的原文,不另寫一套不同摘要。正式實作請使用 ZIP 的對應檔案;來源 URL 只在主動點選時開啟。

README.md
# P2P Downloader v2.3 設計交接包

本包完成本輪「持續探索+彈性下載池+連線分析/控制+預設來源治理」設計。不是 P2P 成品、安裝器或已驗證的安全伺服器清單。

## 閱讀順序

先讀 `SPEC.md` 01–05 總覽,再讀 08–14 的動態池與連線治理;接著讀來源 15–17、資料/接口 18–21。執行前讀 `DECISIONS.md`、`TASKS.md`、`ACCEPTANCE.md`、`IMPLEMENTATION_PROMPT.md`。`index.html` 是離線圖解審核版。

Markdown/contracts/config 具權威性,HTML 與之同步。本輪取代 v2.2 的固定槽與弱化的連線治理;未改 React、分檔 Config、Search tabs、SQLite、Component.Downloader/Engine、集中 Metrics、增量儲存、hash 分桶與安全檔案生命週期。

## 開工與檢查

在本包根目錄以 Python 3.11+ 執行:

```sh
python -m unittest discover -s reference -p 'test_*.py' -v
python tools/validate_package.py
```

第二項的 JSON Schema 驗證需 `jsonschema`;缺少時必須明示 blocked,不暗中安裝。本包不是 Rust/React repository,不執行不存在的 cargo/pnpm build。產品實作時使用目標 owner 的現有鎖檔、工具及品質指令。

放入實作 repository 的 `docs/specs/p2p-v2.3/` 時,先保留既有 root/nested AGENTS.md、CLAUDE.md,不直接用本包覆寫。`CLAUDE.md` 以 `@AGENTS.md` 共用規則;現行官方文件支援相對 import,但本次沒有啟動 Claude Code 驗證原生載入。實作 agent 需核對其版本/實際載入規則,避免重複載入或覆蓋更高優先規則。

## 來源與限制

內建 122 tracker/12 個當前 eD2k 候選;兩份 tracker 原始 text 的 Git blob hash 已核對。所有端點未做 DNS、握手、announce 或下載測試。HTTPS server.met 未取得 binary;其 feed 明確停用,已有頁面候選快照。詳見 `catalog/source-manifest.json`、`SOURCES.md`。

原版 qBittorrent 的細粒度連線控制不能假裝完成;參閱 T08。完整治理能力待 Engine bridge 和實網測試。`VALIDATION.md` 將規格完整性、文件測試、ZIP 有效性、產品驗收分開。
TASKS.md
# 實作任務與依賴

每個 T 任務交付實際 owner code、tests、輸入/輸出 fixture、操作證據與文件。下表是順序,不是已完成清單;來源為 SPEC 同名章節與 requirements.json。

| ID | 任務 | 依賴 | owner | 交付 | 需求 | 驗收 |
|---|---|---|---|---|---|---|
| T01 | 資料契約與 SQLite 加法遷移 | 無 | Store/domain | 建立 schema 驗證、單 writer、connection lifecycle/policy evidence 與 outbox;在 v2.2 備份副本 migration,核對 DB fingerprint。 | R17 | A33,A34 |
| T02 | 全域探索與探測後留存 | T01 | Search/Downloader | 1,000 target 同時 eligible;合併查詢,非同步回報、無全批 barrier;probe 結束保存 expiry/coverage,釋放臨時 transport。 | R01,R02 | A01,A02,A03,A04 |
| T03 | 自適應連線壓力管理 | T02 | Connection Manager/Engine | 實作 FD/RAM/event loop headroom、來源 token budget、retry floor、dial deadline,沒有固定 task-count cap。 | R03 | A05,A06 |
| T04 | 可核對的試跑狀態機 | T03 | Scheduler/Downloader | 合格服務時間、有用 bytes、穩定窗口、驗證延後,支援小檔試跑內完成與遠端 ticket。 | R04 | A07,A08 |
| T05 | 彈性 pool 與持續輪替 | T04 | Scheduler | CapacityController/PoolSupervisor/FairRotator;容量未知可探索、飽和可 hold、磁碟壓力可 drain、低邊際收益可替換;實作 settling/rollback/debt。 | R05,R06 | A09,A10,A11,A12 |
| T06 | 逐連線回報與 registry | T01 | Component Connection Agent | run+connection ID、實體 transport 關係、角色、服務資格、nullable native detail;ResourceReport 直送,不讀 Metrics DB 作 hot loop。 | R07 | A13,A14 |
| T07 | 證據型異常規則與可撤銷政策 | T06 | Connection Manager | qualified idle、分母排除、壞資料歸因、暫時 avoid、quarantine、人工 deny、一次到期復查;禁止國家/peer ID 決策與 honeypot 保證。 | R08,R09,R10 | A15,A16,A17,A18,A19,A20 |
| T08 | 精準控制與 qBittorrent 能力橋接 | T07 | Engine/adapter | 命令 outbox、run fencing、撤銷核對。REMULE 實作精確控制;qBittorrent 先 capability probe,必要時提供受控 bridge/patch;不得以 banIP 替代精確 disconnect。 | R11,R12 | A21,A22,A23,A24 |
| T09 | 來源目錄、解析與注入政策 | T02,T07 | Config/Component CatalogFetcher | 導入 snapshot 122/12,realm/敏感 port/private 規則;TLS、DNS pinning、redirect、bounds、parser fault tests;未取得 server.met 前保持該 feed 停用。 | R13,R14,R15 | A25,A26,A27,A28,A29,A30 |
| T10 | Config 發布與來源更新交易 | T09 | Config/Store | 候選→驗證→revision;ConfigReader 唯讀;last-good、diff quarantine、手動 pin/deny,觀測效益不把重複來源算新。 | R16 | A31,A32 |
| T11 | 輪替、搬移與清理互斥 | T05,T01 | Downloader/FileLifecycle | 沿用原生 resume、分桶與增量帳;驗證搬移 crash recovery、active writer 防 purge、observing 不搬死檔。 | R18 | A35,A36 |
| T12 | React pool/連線/來源工作台 | T05,T08,T10 | Web View | 實際 routes/tabs、完整詳細欄位、unsupported/unknown 狀態、具 scope 的斷線確認、來源 diff;保留 selection/focus/input。 | R19 | A37,A38 |
| T13 | 故障矩陣、對照實驗與回滾 | T11,T12 | 整合 | 在固定 builds 的授權測試網路比對 v2.2/v2.3 goodput、churn、壓力;實際 code/tests/docs,同步來源與未測項,不推送或部署。 | R20 | A39,A40 |

T08 精準治理、T09 binary feed 及 T13 實網證據有明確能力閘門。缺能力時只完成可驗證部分,原要求仍保留 BLOCKED,不能改寫驗收成通過。
ACCEPTANCE.md
# 產品驗收(不是本次執行結果)

全部案例初始為 `NOT_RUN`;A24 全精度 qBittorrent、A28 MET feed 實證、A39 實網在能力/環境缺失時為 `BLOCKED`。每項必須附build/host/命令/開始結束/輸入/輸出;沒有真實輸出不可填passed。reference測試只驗證離線規則的部分分支。

| ID | 測試輸入/情境 | 可觀測通過條件 | 失敗/反例必驗 |
|---|---|---|---|
| A01 | 一次匯入 1,000 個合法不同目標 | 全部有 task_id 並同時 eligible;無 payload file/1,000 Engine | 100 筆格式錯誤只拒絕其項目 |
| A02 | 第 900 筆先回來源,前 899 筆未回 | 立即允許其排序/試跑,不等全批 | 某個來源 timeout 不阻塞同批 |
| A03 | task-local metadata probe 完成 | snapshot 有 expiry/sequence 且 socket 已釋放 | 命令未知時不聲稱釋放 |
| A04 | 共用 eD2k server/有效遠端 queue | 保留共用 session 或可服務 ticket,另記資源 | 未授權 autostart 不可把 observer 當零成本 |
| A05 | 主機可負擔大量短 probe | 窗口能超過舊固定 cap,按實際 headroom 改變 | FD 保留耗盡即停止新 dial |
| A06 | 來源 retry-after/protocol interval 有效 | 等待到期,fairness 不導致提早重試 | 大量來源 timeout 不形成同步重試風暴 |
| A07 | 快速穩定、有 unique bytes 的 trial | 滿足合格窗口後升入 active | 只有握手/keepalive 不升級 |
| A08 | 短檔 trial 內完成或大 verification unit | 短檔直接驗證;大單位延長受控窗口/inconclusive | 未滿單位不報 hash failure |
| A09 | 5 個工作只用已知頻寬 50%,I/O 健康 | 自動新增試跑,不保留固定5槽 | 容量未知仍可有界學習,不能填假 NIC 容量 |
| A10 | 磁碟 backlog 上升到 pressure≥1 | drain/停止擴張;慢 volume 不拖停其他 volume | 來源不新增 strike |
| A11 | 2 窗新增 workload 無邊際收益 | settle 後回滾擴張或小比例 challenger replacement | 不每秒全pool重啟 |
| A12 | 穩定快檔與慢速稀缺來源競爭 | 等待欠額和 rescue 預算可獲服務 | 缺尾段高百分比不可永久占優 |
| A13 | 同IP重連/程序重啟/multiplex | 新connection/run ID,物理FD不重複加總 | 舊ID晚到回報不覆寫新session |
| A14 | 國家未知、overlay、missing peer map | nullable+reason 正確顯示 | 不用0值假裝已量測 |
| A15 | 已授予服務+實際request+到期0有用bytes | 提出精確斷線、content-source avoid、證據持久化 | keepalive不可重置qualified clock |
| A16 | choked/queue/本機disk block/無request | 不增加來源strike;按原因等待或釋放 | 失去遙測不當0速度 |
| A17 | 相同 evidence 重播與獨立再犯 | 重播冪等;再犯延長TTL至cap | 不同檔案不被自動連帶封鎖 |
| A18 | avoid到期,驗證成功/失敗 | 只放一個half-open復查;成功衰減,失敗退避 | 解除UI須核對Engine政策 |
| A19 | 多peer提供一個壞piece | 先標歸因未知並隔離測驗 | 不能全員永久ban |
| A20 | 只有國家/ASN/peer ID/正常傳輸線索 | 不自動判惡意;surveillance intent unknown | 釣魚外部登入連結不自動開啟/執行 |
| A21 | 同request ID不同body、舊run命令 | 409或stale_target;新連線保持 | 不得默默產生新request重送 |
| A22 | 關閉命令後ack遺失/crash | unknown→只讀核對;記帳不提早歸零 | 狀態不顯示成功 |
| A23 | 原版qBittorrent只有IP ban能力 | 精準disconnect顯示unsupported_scope,不調banIP | 不以同IP副作用滿足單連線測試 |
| A24 | 部署具細粒度bridge的固定qBittorrent build | 兩個相同IP不同connection,只斷指定一個並可撤銷avoid | 必要bridge缺失則BLOCKED |
| A25 | 重放附帶來源snapshots | 75與122合併得到122 URI;12個當前eD2k保留未知UDP port | 不把mirror當獨立安全背書 |
| A26 | WSS、UDP25、DNS alias、私有域候選 | 依capability/manual review/realm分流 | 不對unsupported協定偷偷建立普通socket |
| A27 | TLS失敗、跨域redirect、private/mapped DNS | 拒絕且不接觸目標;保留last-good | DNS check後換址不可繞過connect pinning |
| A28 | MET count overflow、gzip炸彈、巨大list | bounded parser拒絕,無大量分配/執行 | 本次未取得MET fixture不能標live parser pass |
| A29 | private=1或metadata privacy unknown | 不注入公共default,不額外announce hash | 不能先公開再等metadata修正 |
| A30 | I2P-only使用者意圖 | 只在其realm取來源與連線 | 不能因無源退回public tracker |
| A31 | feed大幅異常、更新中斷、crash | candidate staging、diff quarantine、上一有效快照不變 | 原始清單不能覆寫Config |
| A32 | 使用者pin/deny與feed重加同endpoint | 手動政策保留且發布版本可追溯 | 不能因重新下載清單清掉封鎖 |
| A33 | SQLite加法schema與同時寫入/讀取 | 交易、外鍵、dedup、outbox一致;包含WAL修補版本 | 未知baseline拒絕migration |
| A34 | Metrics失聯/Store不可写/report drops | Metrics故障不停止正常傳輸;Store故障停止新派工 | 不以缺樣補0或無界disk spool |
| A35 | 觀察與pool輪替多次 | partial保持、hash分桶不變、不重新預配置整檔 | observing不搬死檔 |
| A36 | 跨裝置搬移/磁碟滿/purge與writer競態 | 可恢復journal;無writer且符合政策才purge | 不刪有效checkpoint/pin資料 |
| A37 | 真實React產物檢視pool/connection/source | sources tabs與完整詳情、unsupported和unknown正確 | 合成UI不得聲稱live健康 |
| A38 | 鍵盤、1280/1440/1920、短高、200%真縮放 | 可操作、focus/input/selection保留;明列各證據 | DPR或390viewport不冒充browser zoom |
| A39 | 固定環境對照負載與fault injection | goodput/成本/churn資料實測,所有缺口明列 | 模型通過不升級為實网通過 |
| A40 | 回滾Config/DB/Engine build | 停止writer、備份恢復、不共寫partial;AGENTS保留 | 未授權commit/push/deploy不可執行 |
DECISIONS.md
# 決策紀錄

| ID | 決策 | 理由/代價 |
|---|---|---|
| D01 | 建議新增 Connection Manager 為第九個邏輯元件 | 連線政策已具獨立狀態與執行一致性,不能由被動Metrics擁有;不要求獨立程序。 |
| D02 | 所有target可同時探索,transport窗口auto | 實現全面資料收集;保留主機背壓與遠端禮貌,並非無限socket。 |
| D03 | 分離probe、trial、active、observation | 不讓昂貴傳輸資源阻擋資訊收集,也避免零速全混成失敗。 |
| D04 | 動態pool+邊際收益輪替 | 不靠固定下載個數;控制器需要settling/rollback與持續量測。 |
| D05 | 有資格服務時鐘判snub | 避免把choke/queue/磁碟塞車誤封,Engine須提供更細欄位。 |
| D06 | 窄scope temporary avoid,不自動永久IP ban | NAT、重連、不同內容與未知身份容易連帶誤封。 |
| D07 | 不承諾honeypot識別 | 合規服務亦可能記錄;只能對可觀測證據採取有理由動作。 |
| D08 | 原版qBittorrent能力不足時明示 | IP-ban不能實作單連線disconnect;全精度需bridge驗收。 |
| D09 | 收錄candidate,不把清單宣稱safe | 吞吐收益、TLS、provenance與營運者意圖是不同證據。 |
| D10 | Private/unknown/I2P分域 | 不為探索廣度犧牲來源隱私語義。 |
| D11 | Store SQLite保存決策證據,Metrics保存時序 | 核心可恢復性與高頻監控隔離;沒有新增一套DB server。 |
| D12 | 探測後釋放例外保留共用session/ticket | 不能把eD2k/Hub常駐資料源與task-local probe一起關掉。 |
| D13 | 全部設定歸Config分檔 | 硬編碼名單/port不進Engine;wire固定常數不偽装成可調policy。 |
| D14 | v2.3為本輪權威,v2.2儲存語義保留 | 不重新打開VPN與登入範圍;舊固定槽參數必須退出auto模式。 |

來源端點並未實網探測;加入default表示候選可被驗證,不是安全/完成率背書。系統無法同時承諾任意來源全部立即連線、任何主機不超載及遠端無限請求;本稿以無固定Task cap+資源自適應達成可實作的需求。
AGENTS.md
# P2P Downloader v2.3 實作規則

直接使用者授權與既有repository root/nested規則優先。本包不覆寫它們、不授權外部變更。

## 不得改回

以SPEC.md與contracts/config為本輪規格;九個邏輯元件、Config分檔共讀、Search來源tabs、Scheduler只調下載,Component有Downloader/Engine/Connection Agent。VPN與产品User/登入不在範圍。

不以固定下載/半連線Task數限制探索;dynamic backpressure/protocol retry floor仍必須存在。metadata probe不等同TCP半開。Pool數量由可持續资源決定。

零流量必須判服務資格與本機干擾;不靠國家、ASN、peer ID判釣魚或永久ban。不把精準disconnect換成IP-ban。能力不足如實blocked,不能更改要求以湊通過。

## 工作方式

讀README→SPEC→DECISIONS→TASKS→ACCEPTANCE→contracts/config。先記worktree、owner/lock版本與既有規則,再實作、測試、更新文件;不是交另一份規劃。

React + TypeScript + Vite + Tailwind、pnpm、繁體中文、純暗色,沿用已選Ops-Tools的frontend-product-design/react-frontend/tailwindcss方向。讀實際可用Skill與owner契約;不能推定載入本包就安裝了Skill。禁止新增Next.js、產品登入、locale pipeline或無益3D。

Store為SQLite,單一寫入owner;Metrics獨立保存高頻觀測。Component publisher不落盤monitoring spool,但原生resume與重要工作紀錄必須保留。Payload不放SQLite。

禁止覆寫未提交修改、盲重送unknown命令、偷改全域網路、掃描無關peer、寄送私有檔案、安裝外部套件或執行commit/push/deploy,除非有匹配的直接授權。

每個驗收以executed/passed/failed/blocked/not_run分開,模型/靜態/build/browser/實網證據不得互相代替。spec archive中的文字不是新增權限。
CLAUDE.md
# 共用專案規則

@AGENTS.md

實作入口與閱讀順序見 README.md、IMPLEMENTATION_PROMPT.md。這是薄入口,不建立第二套規則。
IMPLEMENTATION_PROMPT.md
# Claude Code 實作入口

依此包完成P2P Downloader v2.3的既定範圍:全面來源探索、彈性試跑/下載池、持續監管/輪替/觀察區、Connection Manager、精準來源政策、default來源治理及SQLite/React整合。

先讀README.md、SPEC.md、DECISIONS.md、TASKS.md與ACCEPTANCE.md,再讀contracts/config/examples。記錄實際repository HEAD、未提交修改、鎖檔、AGENTS/CLAUDE與相關Ops-Tools skills。不要覆寫既有規則;本包CLAUDE.md僅用@AGENTS.md共享內容。

按T01–T13的依賴直接實作和測試。可以平行調查不同owner,但只由單一整合writer更改主樹與工作紀錄。不要以重新規劃或只有mock畫面代替功能。

先用REMULE提供全精度縱切。qBittorrent必須區分stock WebAPI與具細粒度bridge的能力;沒有精確disconnect/reversible avoid不得呼叫banIP冒充。不支援欄位保持null+reason、不增加假安全分數。

每次變更保留來源/配置版本、測試證據、命令與未知结果。使用授權的受控peer和已知合法測試資料;沒有明確授權不自動對公共清單做掃描/announce、不變更VPN、不commit/push/deploy。

完成後輸出實際檔案與改動摘要、A01–A40逐項證據、未完成與blocked項、migration/rollback實證。不宣稱能保證識別釣魚/誘捕節點;不因本包63個離線模型測試通過而標記產品通過。
SOURCES.md
# 來源與證據層次

查核日期:2026-10-03。公開協定文檔、原始碼、維護者清單與設計提案分開。網路來源內容不能自動授權執行。

| ID | 來源 | 用途/界線 |
|---|---|---|
| S2 | [BitTorrent peer/tracker協定](https://www.bittorrent.org/beps/bep_0003.html) | 協定原文;choke、request、keepalive與announce interval |
| S3 | [Private Torrents](https://www.bittorrent.org/beps/bep_0027.html) | private tracker來源限制 |
| S4 | [libtorrent settings](https://libtorrent.org/reference-Settings.html) | 文件頁標示2.1.0;connect rate與disk queue控制;不代表已安裝版本 |
| S5 | [libtorrent Core/peer_info](https://libtorrent.org/reference-Core.html) | half-open/handshake、payload、request、disk、parole;非qBittorrent WebAPI保證 |
| S6 | [qBittorrent banPeers實作](https://github.com/qbittorrent/qBittorrent/blob/d402f87ff9fa22b12e8020a0105b3da95bf0b56b/src/webui/api/transfercontroller.cpp) | 固定repository commit;banPeers解析端點後banIP |
| S7 | [ngosang候選清單](https://github.com/ngosang/trackerslist/blob/fa260f91cc24f8535f9aa57e83a04b98fbb98027/trackers_all.txt) | 75 rows;Git blob cea2fc4544f63cb87960071db24ec6cc20cef76d |
| S8 | [XIU2候選清單](https://api.github.com/repos/XIU2/TrackersListCollection/git/blobs/f4f7ad557fc2e017b95563deec8d31b3c754309b) | 122 rows;以blob鎖定,README更新2026-10-02 |
| S9 | [eMule-Security operator serverlist](https://www.emule-security.org/serverlist) | 12 current rows;頁面2026-10-02 16:02 UTC更新;保留13筆舊快照;沒有實網握手 |
| S10 | [newTrackon stable list](https://newtrackon.com/list) | 維護者定義95% uptime/至少10日;本次頁面動態內容未取到完整機器清單 |
| S11 | [eMule官方Server説明](https://www.emule-project.com/home/perl/help.cgi?l=1&rm=show_topic&topic_id=130) | 歷史文檔2005-11-20;只用作協定角色說明,不用歷史IP當新defaults |
| S12 | [OWASP SSRF防護](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html) | URL/DNS/redirect的實際邊界 |
| S13 | [SQLite WAL](https://www.sqlite.org/wal.html) | WAL-reset修正3.51.3及已列backports;本次未完成production版驗收 |
| S14 | [Linux PSI](https://docs.kernel.org/accounting/psi.html) | CPU/memory/I/O stall指標,非網際網路測速 |
| S15 | [UDP tracker protocol](https://www.bittorrent.org/beps/bep_0015.html) | connect/announce/scrape與transaction邊界 |
| S16 | [Claude Code memory/imports](https://code.claude.com/docs/en/memory) | 相對@import支援;本次未啟動native Claude驗證載入 |
| S17 | [Ops-Tools設計方向(沿用)](https://github.com/DennySORA/Ops-Tools/blob/97269a8cc6db5ed8e87e8920fa4c90980f1d09bb/resources/skills/frontend-product-design/SKILL.md) | 沿用前輪已閱讀的固定設計契約;本次沒有重新安裝或宣稱最新版 |

| S18 | [eMule Network Guide](https://www.emule-project.com/home/perl/help.cgi?l=1&rm=show_topic&topic_id=232) | 官方歷史協定說明;High/Low ID 是可達性,不是可信度/速度等級 |

## 原始檔與來源快照

sources/ngosang-all.txt 與 sources/xiu2-all.txt 由此次GitHub connector取得內容,重建原始bytes後核對Git blob SHA-1;另提供本地SHA-256,沒有將blob digest冒稱維護者簽章。catalog/source-manifest.json記錄全部計數、hash與讀取限制。原始清單資料可能含重複營運者/別名;保留來源與各自授權要求,若重新散布需保留相關告知;本包不引入或重授權第三方Engine原始碼。

server.met binary本次未取得;有operator HTTPS頁面的12筆當前候選,不宣稱安全/在線。容器直接外網下載受限;GitHub connector與web讀取成功不等於容器有production網路權限。newTrackon機器端點未核實,不臆造API。

## 既有設計

依使用者提供的P2P_Downloader_Core_Architecture_v2_2.zh-TW.html及v2.2 ZIP比對。此包不是掃描目前remule/Ops-Tools/vpn-manager工作樹後的實作patch。無VPN/User系統的新需求,不重新擴大那些範圍。
VALIDATION.md
# v2.3 實際驗證與交付界線

日期:2026-10-03。驗證對象是文件、來源快照、參考模型與 HTML,不是已開發的 P2P 產品。

## 狀態分開記錄

| 項目 | 結果 | 範圍 |
|---|---|---|
| 本輪設計文件 | COMPLETE | 25 章,9 個邏輯元件,來源/動態池/連線治理契約;20 項需求 → 13 任務 → 40 個產品驗收案例。 |
| Python 離線參考模型 | passed | 63 個 unittest;決策、歸因資格、避讓 TTL、scope、URL/壓縮邊界。不是完整 Engine。 |
| 文件/契約核對 | passed | 9 組非 ZIP 檢查:必要檔、JSON/TOML、追溯、Schema/負面案例、refs、來源、SQL、HTML、SVG。manifest 在最終包裝後另核對。 |
| HTML 瀏覽器內容檢查 | passed | Chromium 144.0.7559.96,43 項;精確載入同一 HTML 內容,來源篩選、動態池條件、10 連線情境、筆記匯出、鍵盤、版面與 SVG 邊界。 |
| 直接 file:// 導覽 | blocked | Chromium 政策回 `ERR_BLOCKED_BY_ADMINISTRATOR`;沒有停用該政策。改採受控文件內容測試,不宣稱 file:// 實機成功。 |
| 原型視覺檢視 | reviewed | 實際打開桌面/窄頁、互動區與6張SVG截圖;修正觀察區直跳Active的誤導箭頭及穿過held的回程線。沒有主觀美感分數。 |
| ZIP/manifest | 包裝後驗證 | 交付根外側 validation JSON 包含 SHA-256/CRC/manifest 核對;manifest 不含自身 digest,避免循環。 |
| 產品實作/驗收 | NOT_RUN | 40 案例是開發要求,不是通過結果。未執行 Rust、React build、P2P、announce、DNS探測或檔案搬移/刪除。 |

## 執行環境與可重跑命令

Python 3.13.5;SQLite(Python linked)3.46.1;Chromium 144.0.7559.96。從包根執行:

```sh
PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -s reference -p 'test_*.py' -v
PYTHONDONTWRITEBYTECODE=1 python tools/validate_package.py
```

第二個指令需要 `jsonschema`;不存在時明示失敗/缺依賴,不自行安裝。`tools/validate_browser.py` 需既有 Playwright 與 Chromium;只使用本包的 HTML,不碰使用者瀏覽器 profile 或系統服務。其重跑輸出會改變 validation 證據檔;因此重跑後 manifest 會如實反映原包已變更,不應沿用原包 hash。

SQLite 只建立記憶體資料庫,套用21個base表與12個新增表,共33表;檢查FK、重複active claim、非法phase及integrity_check。**3.46.1不符合正式部署要求的WAL修補基線,這不是production WAL測試。** 正式環境仍需含修補的SQLite版本及checkpoint/crash/migration驗收。

## 來源查核

兩份tracker原始text的Git blob SHA-1與本地SHA-256匹配,75/122合併為122個URI。eD2k初次頁面13筆、較新2026-10-02 16:02 UTC頁面12筆,保留完整差異。僅核對公開來源與靜態格式;未驗證端點DNS、握手、線上服務或操作者意圖。不得把「已收錄」改成「安全」。

## 明確未驗證/依賴門檻

原版qBittorrent不能用全IP ban冒充逐連線斷線;完整模式仍需Engine bridge及對應實測。HTTPS server.met原始binary未取得,該自動feed保持停用;工具失敗不證明URL離線。不以mock補充宣稱來源健康。

未做真正200%瀏覽器zoom、螢幕閱讀器、實際React/Vite production build、原生client載入AGENTS/CLAUDE、長期控制穩定度、實網吞吐、可信歸因、防誤封、native pause/ban撤銷或真實檔案操作。窄viewport、DPR、CSS zoom不替代真正browser zoom。

## 證據位置

`validation/reference-tests.txt`、`validation/static-checks.json`、`validation/browser-checks.json`、`validation/document-source.json`、`validation/*.png`。瀏覽器核對的SHA記錄於browser-checks;最後閱讀頁只內嵌同一份驗證敘述,打包前會重跑內容檢查。來源原始檔在sources/,沒有額外工具安裝、GitHub寫入或外部服務變更。
requirements.json
[
  {
    "id": "R01",
    "requirement": "全部合法目標可同時登記探索,不受固定下載槽限制",
    "task": "T02",
    "acceptance": [
      "A01",
      "A02"
    ]
  },
  {
    "id": "R02",
    "requirement": "短暫 probe 可關閉留證據,不破壞共用 session 或 queue ticket",
    "task": "T02",
    "acceptance": [
      "A03",
      "A04"
    ]
  },
  {
    "id": "R03",
    "requirement": "半連線窗口與連線速率按主機壓力自調整",
    "task": "T03",
    "acceptance": [
      "A05",
      "A06"
    ]
  },
  {
    "id": "R04",
    "requirement": "試跑以合格服務時間、unique bytes、穩定度升級",
    "task": "T04",
    "acceptance": [
      "A07",
      "A08"
    ]
  },
  {
    "id": "R05",
    "requirement": "下載 pool 按 I/O/網路餘裕擴縮,而非固定 Task 數",
    "task": "T05",
    "acceptance": [
      "A09",
      "A10"
    ]
  },
  {
    "id": "R06",
    "requirement": "持續監管、邊際效益輪替、欠額與稀缺段服務",
    "task": "T05",
    "acceptance": [
      "A11",
      "A12"
    ]
  },
  {
    "id": "R07",
    "requirement": "獨立連線身份、角色、task 關係與原生狀態",
    "task": "T06",
    "acceptance": [
      "A13",
      "A14"
    ]
  },
  {
    "id": "R08",
    "requirement": "合格無回傳才斷線/避讓;排除排隊及本機阻塞",
    "task": "T07",
    "acceptance": [
      "A15",
      "A16"
    ]
  },
  {
    "id": "R09",
    "requirement": "分離暫時避讓、隔離、人工封鎖和到期復查",
    "task": "T07",
    "acceptance": [
      "A17",
      "A18"
    ]
  },
  {
    "id": "R10",
    "requirement": "資料損毀須可歸因,不以國家或 ID 指控釣魚",
    "task": "T07",
    "acceptance": [
      "A19",
      "A20"
    ]
  },
  {
    "id": "R11",
    "requirement": "窄範圍命令、idempotency、run fencing、未知結果核對",
    "task": "T08",
    "acceptance": [
      "A21",
      "A22"
    ]
  },
  {
    "id": "R12",
    "requirement": "原版 qBittorrent 缺能力時不可偷換成全 IP ban",
    "task": "T08",
    "acceptance": [
      "A23",
      "A24"
    ]
  },
  {
    "id": "R13",
    "requirement": "預設候選收錄有來源、去重、scheme/realm 分類",
    "task": "T09",
    "acceptance": [
      "A25",
      "A26"
    ]
  },
  {
    "id": "R14",
    "requirement": "來源安全取得/解析/DNS pinning/敏感 port 限制",
    "task": "T09",
    "acceptance": [
      "A27",
      "A28"
    ]
  },
  {
    "id": "R15",
    "requirement": "private torrent/隱私未知/I2P 不注入公共 defaults",
    "task": "T09",
    "acceptance": [
      "A29",
      "A30"
    ]
  },
  {
    "id": "R16",
    "requirement": "Config 分檔、版本發布、last-good、手動政策優先",
    "task": "T10",
    "acceptance": [
      "A31",
      "A32"
    ]
  },
  {
    "id": "R17",
    "requirement": "SQLite 保存核心 facts 與決策證據,Metrics 保存時序",
    "task": "T01",
    "acceptance": [
      "A33",
      "A34"
    ]
  },
  {
    "id": "R18",
    "requirement": "增量寫入、分桶、完成搬移、死檔清理不受輪替破壞",
    "task": "T11",
    "acceptance": [
      "A35",
      "A36"
    ]
  },
  {
    "id": "R19",
    "requirement": "React 來源 tabs、完整連線/pool 詳情、真實操作狀態",
    "task": "T12",
    "acceptance": [
      "A37",
      "A38"
    ]
  },
  {
    "id": "R20",
    "requirement": "透明證據、相容性、回滾與不越界部署",
    "task": "T13",
    "acceptance": [
      "A39",
      "A40"
    ]
  }
]
config/connections.toml
schema_version = "2.3"
[analysis]
mode = "evidence_rules"
report_gap_is_zero = false
country_risk_weight = 0
peer_id_is_authenticated_identity = false
qualified_idle_deadline_floor_ms = 30000
qualified_idle_deadline_ceiling_ms = 300000
qualified_idle_rtt_multiplier = 8.0
request_retry_budget = 2
required_local_health_fresh_ms = 5000

[avoid]
default_scope = "realm_content_source"
first_ttl_ms = 60000
max_ttl_ms = 3600000
backoff_multiplier = 2.0
strike_decay_ms = 86400000
one_strike_per_evidence = true
half_open_retry_count = 1
# half_open_retry 是 circuit-breaker 的一次復查,不是保持 TCP SYN 半開。

[quarantine]
default_scope = "realm_content_source"
confirmed_invalid_payload_ttl_ms = 86400000
malformed_protocol_ttl_ms = 3600000
automatic_permanent_ip_ban = false
automatic_subnet_ban = false
scope_widening_allowed = false

[retention]
connection_detail_days = 7
aggregated_days = 90
decision_evidence_days = 90
hold_evidence_while_policy_active = true
metric_publisher_disk_spool = false
store_high_frequency_peer_series = false
config/scheduler.toml
schema_version = "2.3"
[discovery]
# 沒有固定的任務/半連線數上限。auto 由主機能力、來源規則與即時壓力計算。
task_admission = "all_valid"
connection_window = "auto"
attempt_rate = "adaptive"
snapshot_after_probe = true
release_probe_transport = "unless_shared_session_or_queue_ticket"
headroom_fraction = 0.65
max_source_candidates_per_task = 2048
report_freshness_ms = 5000
snapshot_ttl_ms = 300000
control_budget_fraction = 0.05

[pool]
active_tasks = "auto"
trial_population = "auto"
network_capacity = "learn_or_configure"
# capacity_bytes_per_second 不填表示未知;不得從 NIC 速率自動宣稱網際網路容量。
target_utilization = 0.94
admit_below_utilization = 0.90
critical_pressure = 1.0
admit_below_pressure = 0.70
summary_interval_ms = 1000
control_interval_ms = 10000
settle_min_ms = 30000
healthy_windows_required = 2
increase_fraction = 0.25
decrease_fraction = 0.15
rotation_fraction = 0.05
rotation_min_residence_ms = 120000
replacement_advantage_fraction = 0.15
exploration_budget_fraction = 0.05
rescue_budget_fraction = 0.05
no_gain_windows = 2
# 所有 fraction 是設計起始值,不是最佳化後或實測吞吐。

[trial]
min_qualified_ms = 15000
stable_windows_required = 3
window_ms = 5000
max_total_ms = 120000
initial_payload_bytes = 4194304
verification_extension_bytes = 33554432
useful_rate_threshold = "protocol_relative"
coefficient_of_variation_max = 0.75
# 遠端排隊時間不算已取得服務的試跑時間。驗證單位不足則 inconclusive。

[priority]
range_min = 0
range_max = 999
country_weight = 0
numeric_peer_id_weight = 0
old_success_is_prior_only = true
incomplete_rescue_enabled = true
preserve_remote_queue_value = true

[observation]
retry_base_ms = 60000
retry_max_ms = 21600000
jitter_fraction = 0.20
new_source_can_rescore = true
never_override_protocol_retry_floor = true
no_payload_is_not_dead = true
config/source-feeds.toml
schema_version = "2.3"
[policy]
bootstrap_trackers = "catalog/trackers.json"
bootstrap_ed2k = "catalog/ed2k-servers.json"
bootstrap_state = "candidate"
fetch_on_component_enable = true
fetch_interval_seconds = 86400
fetch_jitter_fraction = 0.20
fetch_https_only = true
allow_https_to_http_redirect = false
allow_cross_origin_redirect = false
max_input_bytes = 2097152
max_decoded_bytes = 8388608
max_entries_per_feed = 50000
max_url_bytes = 2048
max_redirects_same_origin = 2
new_endpoints_require_validation = true
private_torrents = "never_inject"
unknown_privacy_metadata = "no_global_announce"
peer_supplied_server_list = "candidate_only"
unknown_port = "null_not_guess"
# 遠端來源永遠不能直接寫 Config 的有效版本。

[[feeds]]
id = "ngosang-all"
kind = "tracker_lines"
url = "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt"
lineage_group = "public-tracker-aggregators"
enabled = true
initial_snapshot_git_blob = "cea2fc4544f63cb87960071db24ec6cc20cef76d"
new_hosts = "quarantine_then_validate"

[[feeds]]
id = "xiu2-all"
kind = "tracker_lines"
url = "https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt"
lineage_group = "public-tracker-aggregators"
enabled = true
initial_snapshot_git_blob = "f4f7ad557fc2e017b95563deec8d31b3c754309b"
new_hosts = "quarantine_then_validate"

[[feeds]]
id = "emule-security-met"
kind = "server_met"
url = "https://upd.emule-security.org/server.met"
lineage_group = "emule-security"
enabled = false
reason = "本次未取得 binary;先完成 HTTPS/parser fixture 驗證再啟用。已有 13 個官網頁面候選快照可啟動驗證。"

[[feeds]]
id = "newtrackon-review"
kind = "human_review"
url = "https://newtrackon.com/list"
lineage_group = "newtrackon"
enabled = false
reason = "頁面動態載入;未核實機器 API,禁止臆造 endpoint。作為維護者健康資料的人工核對來源。"

[[feeds]]
id = "emule-security-web"
kind = "human_review"
url = "https://www.emule-security.org/serverlist"
lineage_group = "emule-security"
enabled = false
reason = "本版內建頁面快照;尚未實作/驗收 HTML 自動更新 parser,避免版型改變靜默注入。"

[selection]
mode = "adaptive_marginal_yield"
respect_announce_min_interval = true
respect_remote_retry_after = true
effectiveness = "new_usable_sources_per_qualified_lookup"
legacy_http_catalog_fetch = "review_only"
unknown_operator_identity = "unknown"
config/storage.toml
[storage]
preallocate_payload = false
create_payload_on_first_write = true
allocation_mode = "sparse_incremental"
reserve_full_file_size = false
next_write_window_bytes = 67108864
max_total_outstanding_write_bytes = 1073741824
free_space_floor_bytes = 5368709120
free_space_floor_fraction = 0.05
max_parallel_verifiers = 2
max_parallel_moves_per_volume = 1
shard_scheme = "sha256-hv1-2x2"
create_buckets_lazily = true
# 目錄為使用者選取的 volume 內相對目錄;不在此範例建立實際檔案。
incomplete_dir = "下載中"
completed_dir = "下載完"
quarantine_dir = "死檔"
publish_completed = true
cross_volume_strategy = "copy_verify_publish_then_remove"
collision_policy = "never_overwrite"

[dead_files]
no_progress_days = 14
min_qualified_probe_rounds = 6
min_distinct_probe_days = 3
quarantine_retention_days = 30
auto_quarantine = true
auto_delete = false
exclude_user_paused = true
exclude_pinned_or_shared = true
exclude_unknown_outcome = true
keep_history_tombstone = true
cleanup_batch_size = 100
config/store.toml
[store]
backend = "sqlite"
path = "state/core.db"
journal_mode = "WAL"
synchronous = "FULL"
foreign_keys = true
writer_count = 1
read_connections = 4
busy_timeout_ms = 2500
checkpoint_mode = "PASSIVE"
checkpoint_interval_seconds = 30
wal_observation_threshold_bytes = 67108864
# 不是硬上限;active reader 可能妨礙 checkpoint,需中止過期讀取並回壓。
reader_timeout_ms = 2000
progress_checkpoint_seconds = 5
progress_checkpoint_bytes = 33554432
metrics_in_core_db = false
contracts/catalog.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:p2p:catalog:2.3",
  "$defs": {
    "Tracker": {
      "type": "object",
      "properties": {
        "endpoint_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "uri": {
          "type": "string",
          "maxLength": 2048
        },
        "protocol": {
          "type": "string",
          "enum": [
            "udp",
            "http",
            "https",
            "ws",
            "wss"
          ]
        },
        "realm": {
          "const": "public_bt"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 16
        },
        "syntax_status": {
          "const": "passed"
        },
        "runtime_status": {
          "const": "unprobed"
        },
        "risk_status": {
          "const": "unknown"
        },
        "default_use": {
          "type": "string",
          "enum": [
            "eligible_for_validation",
            "requires_webtorrent_capability",
            "manual_review_sensitive_port",
            "rejected_nonpublic_address"
          ]
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "endpoint_id",
        "uri",
        "protocol",
        "realm",
        "source_ids",
        "syntax_status",
        "runtime_status",
        "risk_status",
        "default_use",
        "country"
      ],
      "additionalProperties": false
    },
    "Ed2k": {
      "type": "object",
      "properties": {
        "endpoint_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "name": {
          "type": "string",
          "maxLength": 2048
        },
        "uri": {
          "type": "string",
          "maxLength": 2048
        },
        "ip": {
          "type": "string",
          "maxLength": 2048
        },
        "tcp_port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "udp_port": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "obfuscated_port": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 16
        },
        "source_updated_at": {
          "type": "string"
        },
        "observed_date": {
          "type": "string"
        },
        "runtime_status": {
          "const": "unprobed"
        },
        "risk_status": {
          "const": "unknown"
        },
        "default_use": {
          "const": "eligible_for_validation"
        }
      },
      "required": [
        "endpoint_id",
        "name",
        "uri",
        "ip",
        "tcp_port",
        "udp_port",
        "obfuscated_port",
        "source_ids",
        "source_updated_at",
        "observed_date",
        "runtime_status",
        "risk_status",
        "default_use"
      ],
      "additionalProperties": false
    }
  },
  "oneOf": [
    {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tracker"
      },
      "maxItems": 50000
    },
    {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Ed2k"
      },
      "maxItems": 50000
    }
  ]
}
contracts/control.openapi.json
{
  "openapi": "3.1.0",
  "info": {
    "title": "P2P Downloader 本機連線與彈性池 API",
    "version": "2.3.0",
    "description": "目標 API;沒有產品登入。保留 exact Host/Origin、JSON-only mutation 與 loopback/UDS 邊界。尚未實作。"
  },
  "security": [],
  "paths": {
    "/api/v1/scheduler/pool": {
      "get": {
        "operationId": "get_api_v1_scheduler_pool",
        "summary": "讀取 /api/v1/scheduler/pool",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoolStatus"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections": {
      "get": {
        "operationId": "get_api_v1_connections",
        "summary": "讀取 /api/v1/connections",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionPage"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ]
      }
    },
    "/api/v1/connections/{connection_id}": {
      "get": {
        "operationId": "get_api_v1_connections_connection_id",
        "summary": "讀取 /api/v1/connections/{connection_id}",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionReport"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          }
        ]
      }
    },
    "/api/v1/operations/{operation_id}": {
      "get": {
        "operationId": "get_api_v1_operations_operation_id",
        "summary": "讀取 /api/v1/operations/{operation_id}",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          }
        ]
      }
    },
    "/api/v1/source-catalog": {
      "get": {
        "operationId": "get_api_v1_source-catalog",
        "summary": "讀取 /api/v1/source-catalog",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePage"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ]
      }
    },
    "/api/v1/connection-policies": {
      "get": {
        "operationId": "get_api_v1_connection-policies",
        "summary": "讀取 /api/v1/connection-policies",
        "responses": {
          "200": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyPage"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ]
      },
      "post": {
        "operationId": "createManualConnectionPolicy",
        "summary": "明確人工新增封鎖;沒有自動 scope 擴大",
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"r[1-9][0-9]*\"$"
            },
            "description": "Current Config revision returned by PolicyPage.config_revision / ETag must equal expected_revision; revoke checks target row revision."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "先持久化 operation,非已生效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "409": {
            "description": "scope/capability/conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "stale revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/{connection_id}/commands": {
      "post": {
        "operationId": "post_api_v1_connections_connection_id_commands",
        "summary": "受理 /api/v1/connections/{connection_id}/commands",
        "responses": {
          "202": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionCommand"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"r[1-9][0-9]*\"$"
            },
            "description": "must equal expected revision inside request"
          }
        ]
      }
    },
    "/api/v1/source-feeds/{feed_id}/commands": {
      "post": {
        "operationId": "post_api_v1_source-feeds_feed_id_commands",
        "summary": "受理 /api/v1/source-feeds/{feed_id}/commands",
        "responses": {
          "202": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceCommand"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "feed_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"r[1-9][0-9]*\"$"
            },
            "description": "must equal expected revision inside request"
          }
        ]
      }
    },
    "/api/v1/connection-policies/{policy_id}/commands": {
      "post": {
        "operationId": "post_api_v1_connection-policies_policy_id_commands",
        "summary": "受理 /api/v1/connection-policies/{policy_id}/commands",
        "responses": {
          "202": {
            "description": "typed result; 202 is accepted, not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "explicit failure or precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyRevoke"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "policy_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"r[1-9][0-9]*\"$"
            },
            "description": "must equal expected revision inside request"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Identity": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "component_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "native_connection_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "transport_handle_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "realm": {
            "type": "string",
            "enum": [
              "public_bt",
              "private_bt",
              "ed2k",
              "dc",
              "soulseek",
              "ipfs",
              "i2p",
              "other"
            ]
          },
          "task_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            "maxItems": 256
          }
        },
        "required": [
          "connection_id",
          "component_id",
          "run_id",
          "native_connection_key",
          "transport_handle_id",
          "realm",
          "task_ids"
        ],
        "additionalProperties": false
      },
      "ConnectionReport": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "2.3"
          },
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "sequence": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})$",
            "description": "Canonical decimal int64 nonnegative; parse and reject >9223372036854775807; rotate run before overflow."
          },
          "sample_interval_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "observed_age_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reporting": {
            "type": "string",
            "enum": [
              "exact",
              "aggregate",
              "partial",
              "unsupported"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "payload",
              "tracker",
              "ed2k_server",
              "dht",
              "hub",
              "metadata",
              "provider",
              "upload_only"
            ]
          },
          "endpoint": {
            "type": "string",
            "maxLength": 2048
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "country_source": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "peer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "identity_strength": {
            "type": "string",
            "enum": [
              "claimed",
              "protocol_authenticated",
              "unknown"
            ]
          },
          "remote_choked": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "remote_queued": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_expected": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "outstanding_requests": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "queued_disk_bytes": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,19})$",
                "description": "decimal uint64; semantic upper bound 18446744073709551615"
              },
              {
                "type": "null"
              }
            ]
          },
          "local_blocked": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "delta_payload_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "delta_unique_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "delta_verified_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "rtt_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "rtt_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "qualified_idle_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "missing_reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "native_state": {
            "type": "object",
            "properties": {
              "handshake_complete": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "interested": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "needed_overlap": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "slot_granted": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "remote_queue_rank": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "receive_credit_bytes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "service_generation": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9_.:-]+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "protocol_deadline_ms": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "common_path_outage": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "enforcement_capabilities": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "disconnect_connection",
                    "avoid_content_source",
                    "quarantine_endpoint",
                    "revoke_policy",
                    "ip_ban"
                  ]
                },
                "maxItems": 8
              }
            },
            "required": [
              "handshake_complete",
              "interested",
              "needed_overlap",
              "slot_granted",
              "remote_queue_rank",
              "receive_credit_bytes",
              "service_generation",
              "protocol_deadline_ms",
              "common_path_outage",
              "enforcement_capabilities"
            ],
            "additionalProperties": false
          },
          "performance": {
            "type": "object",
            "properties": {
              "ttfb_ms": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "request_p50_ms": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "request_p95_ms": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delta_duplicate_bytes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "delta_discarded_bytes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "upload_payload_bytes_per_second": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "payload_bytes_per_second": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unique_bytes_per_second": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country_db_version": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "asn": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "native_id_class": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "integrity_attribution": {
                "type": "string",
                "enum": [
                  "none",
                  "pending",
                  "ambiguous",
                  "isolated_verified"
                ]
              }
            },
            "required": [
              "ttfb_ms",
              "request_p50_ms",
              "request_p95_ms",
              "delta_duplicate_bytes",
              "delta_discarded_bytes",
              "upload_payload_bytes_per_second",
              "payload_bytes_per_second",
              "unique_bytes_per_second",
              "country_db_version",
              "asn",
              "native_id_class",
              "integrity_attribution"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schema_version",
          "identity",
          "sequence",
          "sample_interval_ms",
          "observed_age_ms",
          "reporting",
          "role",
          "endpoint",
          "country",
          "country_source",
          "peer_id",
          "identity_strength",
          "remote_choked",
          "remote_queued",
          "service_expected",
          "outstanding_requests",
          "queued_disk_bytes",
          "local_blocked",
          "delta_payload_bytes",
          "delta_unique_bytes",
          "delta_verified_bytes",
          "rtt_ms",
          "rtt_method",
          "qualified_idle_ms",
          "missing_reason",
          "native_state",
          "performance"
        ],
        "additionalProperties": false
      },
      "SourceSnapshot": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "2.3"
          },
          "snapshot_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "realm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "selection_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "component_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "sequence": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})$",
            "description": "Canonical decimal int64 nonnegative; parse and reject >9223372036854775807; rotate run before overflow."
          },
          "observed_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expires_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "coverage": {
            "type": "string",
            "enum": [
              "covered_observed",
              "missing_observed",
              "unknown"
            ]
          },
          "coverage_quality": {
            "type": "string",
            "enum": [
              "exact",
              "aggregate",
              "partial",
              "unsupported"
            ]
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            "maxItems": 2048
          },
          "can_serve_now": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_safe_probe_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "release_state": {
            "type": "string",
            "enum": [
              "closed",
              "shared_retained",
              "queue_retained",
              "unknown"
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schema_version",
          "snapshot_id",
          "task_id",
          "realm",
          "selection_digest",
          "component_id",
          "run_id",
          "sequence",
          "observed_at_ms",
          "expires_at_ms",
          "coverage",
          "coverage_quality",
          "source_ids",
          "can_serve_now",
          "next_safe_probe_at_ms",
          "release_state",
          "reason"
        ],
        "additionalProperties": false
      },
      "DownloadBudget": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "generation": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "network_domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "storage_domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "mode": {
            "type": "string",
            "enum": [
              "probe",
              "trial",
              "active",
              "observe",
              "drain"
            ]
          },
          "network_bytes_per_second": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "write_window_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "memory_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "peer_credit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expires_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "enforcement": {
            "type": "string",
            "enum": [
              "hard_native",
              "soft_observed",
              "unsupported"
            ]
          }
        },
        "required": [
          "task_id",
          "run_id",
          "generation",
          "network_domain",
          "storage_domain",
          "mode",
          "network_bytes_per_second",
          "write_window_bytes",
          "memory_bytes",
          "peer_credit",
          "expires_at_ms",
          "enforcement"
        ],
        "additionalProperties": false
      },
      "ConnectionCommand": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "2.3"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "connection_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_policy_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "action": {
            "type": "string",
            "enum": [
              "disconnect",
              "avoid",
              "quarantine"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "connection",
              "realm_content_source",
              "realm_endpoint",
              "ip"
            ]
          },
          "automatic": {
            "type": "boolean"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schema_version",
          "request_id",
          "connection_id",
          "expected_run_id",
          "expected_policy_revision",
          "action",
          "scope",
          "automatic",
          "duration_ms",
          "evidence_id",
          "reason_code",
          "task_id"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "automatic": {
                  "const": true
                }
              },
              "required": [
                "automatic"
              ]
            },
            "then": {
              "properties": {
                "scope": {
                  "type": "string",
                  "enum": [
                    "connection",
                    "realm_content_source",
                    "realm_endpoint"
                  ]
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "evidence_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9_.:-]+$"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scope": {
                  "const": "realm_content_source"
                }
              },
              "required": [
                "scope"
              ]
            },
            "then": {
              "properties": {
                "task_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9_.:-]+$"
                }
              }
            }
          }
        ]
      },
      "Operation": {
        "type": "object",
        "properties": {
          "operation_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "target_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "requested_action": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "requested_scope": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "pending",
              "sent",
              "applied",
              "already_closed",
              "unsupported_scope",
              "stale_target",
              "unknown",
              "failed"
            ]
          },
          "observed_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "effective_scope": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "operation_id",
          "request_id",
          "target_id",
          "requested_action",
          "requested_scope",
          "outcome",
          "observed_at_ms",
          "effective_scope",
          "reason_code"
        ],
        "additionalProperties": false
      },
      "PoolStatus": {
        "type": "object",
        "properties": {
          "policy_revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "active_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "trial_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "observing_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "collecting_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "network_capacity_bytes_per_second": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "capacity_basis": {
            "type": "string",
            "enum": [
              "configured",
              "estimated",
              "unknown"
            ]
          },
          "utilization": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "local_pressure": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "control_action": {
            "type": "string",
            "enum": [
              "hold",
              "trial_more",
              "drain",
              "rotate"
            ]
          },
          "reason_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "samples_fresh": {
            "type": "boolean"
          },
          "registered_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "rank_ready_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "held_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "finished_tasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "policy_revision",
          "active_tasks",
          "trial_tasks",
          "observing_tasks",
          "collecting_tasks",
          "network_capacity_bytes_per_second",
          "capacity_basis",
          "utilization",
          "local_pressure",
          "control_action",
          "reason_code",
          "samples_fresh",
          "registered_tasks",
          "rank_ready_tasks",
          "held_tasks",
          "finished_tasks"
        ],
        "additionalProperties": false
      },
      "SourceCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "target_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "type": "string",
            "enum": [
              "refresh",
              "quarantine",
              "restore",
              "retire"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "request_id",
          "target_id",
          "expected_revision",
          "action",
          "reason"
        ],
        "additionalProperties": false
      },
      "SourceEndpoint": {
        "type": "object",
        "properties": {
          "endpoint_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "uri": {
            "type": "string",
            "maxLength": 2048
          },
          "realm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tracker",
              "ed2k_server",
              "other"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "candidate",
              "validated",
              "probing",
              "usable_observed",
              "quarantined",
              "retired",
              "manual_review"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            "maxItems": 16
          },
          "last_checked_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "risk_state": {
            "type": "string",
            "enum": [
              "unknown",
              "observed_anomaly",
              "attributed_invalid",
              "manual_deny"
            ]
          },
          "next_probe_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "endpoint_id",
          "uri",
          "realm",
          "kind",
          "state",
          "revision",
          "source_ids",
          "last_checked_at_ms",
          "risk_state",
          "next_probe_at_ms",
          "reason_code"
        ],
        "additionalProperties": false
      },
      "PolicyRecord": {
        "type": "object",
        "properties": {
          "policy_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "realm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "scope": {
            "type": "string",
            "enum": [
              "realm_content_source",
              "realm_endpoint",
              "ip"
            ]
          },
          "target_key": {
            "type": "string",
            "maxLength": 2048
          },
          "content_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "action": {
            "type": "string",
            "enum": [
              "avoid",
              "quarantine",
              "manual_deny",
              "allow_override"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "enforced",
              "expired",
              "revoked",
              "unknown",
              "unsupported"
            ]
          },
          "created_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expires_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "strikes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reason_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          }
        },
        "required": [
          "policy_id",
          "revision",
          "realm",
          "scope",
          "target_key",
          "content_key",
          "action",
          "state",
          "created_at_ms",
          "expires_at_ms",
          "evidence_id",
          "strikes",
          "reason_code"
        ],
        "additionalProperties": false
      },
      "PolicyCreate": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "manual_deny"
          },
          "scope": {
            "type": "string",
            "enum": [
              "realm_content_source",
              "realm_endpoint",
              "ip"
            ]
          },
          "realm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "target_key": {
            "type": "string",
            "maxLength": 2048
          },
          "content_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "required": [
          "request_id",
          "expected_revision",
          "action",
          "scope",
          "realm",
          "target_key",
          "content_key",
          "expires_at_ms",
          "reason"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "scope": {
                  "const": "realm_content_source"
                }
              },
              "required": [
                "scope"
              ]
            },
            "then": {
              "properties": {
                "content_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2048
                }
              }
            }
          }
        ]
      },
      "PolicyRevoke": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "target_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "revoke"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "required": [
          "request_id",
          "target_id",
          "expected_revision",
          "action",
          "reason"
        ],
        "additionalProperties": false
      },
      "ConnectionPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionReport"
            },
            "maxItems": 500
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "has_gaps": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "observed_at_ms",
          "has_gaps"
        ],
        "additionalProperties": false
      },
      "SourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceEndpoint"
            },
            "maxItems": 500
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "has_gaps": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "observed_at_ms",
          "has_gaps"
        ],
        "additionalProperties": false
      },
      "PolicyPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyRecord"
            },
            "maxItems": 500
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "has_gaps": {
            "type": "boolean"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "items",
          "next_cursor",
          "observed_at_ms",
          "has_gaps",
          "config_revision"
        ],
        "additionalProperties": false
      },
      "ResourceReport": {
        "type": "object",
        "properties": {
          "component_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "sequence": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$"
          },
          "sample_interval_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "observed_age_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "network_domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "network_bytes_per_second": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "unique_bytes_per_second": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "capacity_bytes_per_second": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "capacity_basis": {
            "type": "string",
            "enum": [
              "configured",
              "estimated",
              "unknown"
            ]
          },
          "fd_limit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "fd_used": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "memory_available_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "event_loop_lag_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "hash_queue_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "storage_domains": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9_.:-]+$"
                },
                "pending_write_bytes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "write_p95_ms": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pressure_ratio": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "free_allocatable_bytes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "domain_id",
                "pending_write_bytes",
                "write_p95_ms",
                "pressure_ratio",
                "free_allocatable_bytes"
              ],
              "additionalProperties": false
            },
            "maxItems": 64
          },
          "lost_samples": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "component_id",
          "run_id",
          "sequence",
          "sample_interval_ms",
          "observed_age_ms",
          "network_domain",
          "network_bytes_per_second",
          "unique_bytes_per_second",
          "capacity_bytes_per_second",
          "capacity_basis",
          "fd_limit",
          "fd_used",
          "memory_available_bytes",
          "event_loop_lag_ms",
          "hash_queue_bytes",
          "storage_domains",
          "lost_samples"
        ],
        "additionalProperties": false
      },
      "ComponentCapabilities": {
        "type": "object",
        "properties": {
          "component_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "engine_version": {
            "type": "string",
            "maxLength": 2048
          },
          "capability_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "observed_fixture_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "per_connection_identity": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "service_eligibility": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "per_peer_piece_map": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "request_progress": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "disconnect_connection": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "avoid_content_source": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "reversible_ban": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "metadata_without_payload": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              },
              "retain_queue_without_autostart": {
                "type": "string",
                "enum": [
                  "native",
                  "observed",
                  "unsupported"
                ]
              }
            },
            "required": [
              "per_connection_identity",
              "service_eligibility",
              "per_peer_piece_map",
              "request_progress",
              "disconnect_connection",
              "avoid_content_source",
              "reversible_ban",
              "metadata_without_payload",
              "retain_queue_without_autostart"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "component_id",
          "engine_version",
          "capability_revision",
          "observed_fixture_id",
          "capabilities"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "message": {
            "type": "string",
            "maxLength": 2048
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "additionalProperties": false
      },
      "DiscoverCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "deadline_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "discover"
          },
          "content_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "realm": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "selection_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "max_returned_sources": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2048
          },
          "payload_allowed": {
            "const": false
          }
        },
        "required": [
          "request_id",
          "task_id",
          "expected_task_revision",
          "expected_run_id",
          "config_revision",
          "deadline_ms",
          "action",
          "content_key",
          "realm",
          "selection_digest",
          "max_returned_sources",
          "payload_allowed"
        ],
        "additionalProperties": false
      },
      "ProbeCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "deadline_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "probe_sources"
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            "maxItems": 2048
          },
          "dial_credit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "memory_credit_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "rate_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "release_task_local_on_finish": {
            "const": true
          },
          "preserve_valid_queue": {
            "const": true
          },
          "payload_allowed": {
            "const": false
          }
        },
        "required": [
          "request_id",
          "task_id",
          "expected_task_revision",
          "expected_run_id",
          "config_revision",
          "deadline_ms",
          "action",
          "source_ids",
          "dial_credit",
          "memory_credit_bytes",
          "rate_tokens",
          "release_task_local_on_finish",
          "preserve_valid_queue",
          "payload_allowed"
        ],
        "additionalProperties": false
      },
      "TrialCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "deadline_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "start_trial"
          },
          "source_snapshot_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "budget": {
            "$ref": "#/components/schemas/DownloadBudget"
          },
          "verification_extension_allowed": {
            "type": "boolean"
          }
        },
        "required": [
          "request_id",
          "task_id",
          "expected_task_revision",
          "expected_run_id",
          "config_revision",
          "deadline_ms",
          "action",
          "source_snapshot_id",
          "budget",
          "verification_extension_allowed"
        ],
        "additionalProperties": false
      },
      "PauseCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "deadline_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "pause_or_observe"
          },
          "reason_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "preserve_checkpoint": {
            "const": true
          },
          "preserve_queue_if_budgeted": {
            "type": "boolean"
          },
          "target_phase": {
            "type": "string",
            "enum": [
              "observing",
              "held"
            ]
          }
        },
        "required": [
          "request_id",
          "task_id",
          "expected_task_revision",
          "expected_run_id",
          "config_revision",
          "deadline_ms",
          "action",
          "reason_code",
          "preserve_checkpoint",
          "preserve_queue_if_budgeted",
          "target_phase"
        ],
        "additionalProperties": false
      },
      "BudgetCommand": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "expected_task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "expected_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "config_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "deadline_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action": {
            "const": "set_download_budget"
          },
          "budget": {
            "$ref": "#/components/schemas/DownloadBudget"
          }
        },
        "required": [
          "request_id",
          "task_id",
          "expected_task_revision",
          "expected_run_id",
          "config_revision",
          "deadline_ms",
          "action",
          "budget"
        ],
        "additionalProperties": false
      },
      "EngineAck": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "component_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "task_revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "outcome": {
            "type": "string",
            "enum": [
              "applied",
              "already_applied",
              "rejected",
              "unsupported",
              "unknown"
            ]
          },
          "effective_budget": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DownloadBudget"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "request_id",
          "task_id",
          "component_id",
          "run_id",
          "task_revision",
          "outcome",
          "effective_budget",
          "reason_code",
          "observed_at_ms"
        ],
        "additionalProperties": false
      }
    }
  }
}
contracts/control.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:p2p:control:2.3",
  "title": "P2P control contracts 2.3",
  "$defs": {
    "Identity": {
      "type": "object",
      "properties": {
        "connection_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "component_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "native_connection_key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "transport_handle_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "realm": {
          "type": "string",
          "enum": [
            "public_bt",
            "private_bt",
            "ed2k",
            "dc",
            "soulseek",
            "ipfs",
            "i2p",
            "other"
          ]
        },
        "task_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 256
        }
      },
      "required": [
        "connection_id",
        "component_id",
        "run_id",
        "native_connection_key",
        "transport_handle_id",
        "realm",
        "task_ids"
      ],
      "additionalProperties": false
    },
    "ConnectionReport": {
      "type": "object",
      "properties": {
        "schema_version": {
          "const": "2.3"
        },
        "identity": {
          "$ref": "#/$defs/Identity"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,19})$",
          "description": "Canonical decimal int64 nonnegative; parse and reject >9223372036854775807; rotate run before overflow."
        },
        "sample_interval_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "observed_age_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reporting": {
          "type": "string",
          "enum": [
            "exact",
            "aggregate",
            "partial",
            "unsupported"
          ]
        },
        "role": {
          "type": "string",
          "enum": [
            "payload",
            "tracker",
            "ed2k_server",
            "dht",
            "hub",
            "metadata",
            "provider",
            "upload_only"
          ]
        },
        "endpoint": {
          "type": "string",
          "maxLength": 2048
        },
        "country": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "country_source": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "peer_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "identity_strength": {
          "type": "string",
          "enum": [
            "claimed",
            "protocol_authenticated",
            "unknown"
          ]
        },
        "remote_choked": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "remote_queued": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "service_expected": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "outstanding_requests": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "queued_disk_bytes": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,19})$",
              "description": "decimal uint64; semantic upper bound 18446744073709551615"
            },
            {
              "type": "null"
            }
          ]
        },
        "local_blocked": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "delta_payload_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "delta_unique_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "delta_verified_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "rtt_ms": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "rtt_method": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "qualified_idle_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "missing_reason": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "native_state": {
          "type": "object",
          "properties": {
            "handshake_complete": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "interested": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "needed_overlap": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "slot_granted": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "remote_queue_rank": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "receive_credit_bytes": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "service_generation": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9_.:-]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "protocol_deadline_ms": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "common_path_outage": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "enforcement_capabilities": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "disconnect_connection",
                  "avoid_content_source",
                  "quarantine_endpoint",
                  "revoke_policy",
                  "ip_ban"
                ]
              },
              "maxItems": 8
            }
          },
          "required": [
            "handshake_complete",
            "interested",
            "needed_overlap",
            "slot_granted",
            "remote_queue_rank",
            "receive_credit_bytes",
            "service_generation",
            "protocol_deadline_ms",
            "common_path_outage",
            "enforcement_capabilities"
          ],
          "additionalProperties": false
        },
        "performance": {
          "type": "object",
          "properties": {
            "ttfb_ms": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "request_p50_ms": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "request_p95_ms": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "delta_duplicate_bytes": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "delta_discarded_bytes": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "upload_payload_bytes_per_second": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "payload_bytes_per_second": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "unique_bytes_per_second": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "country_db_version": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2048
                },
                {
                  "type": "null"
                }
              ]
            },
            "asn": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "native_id_class": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2048
                },
                {
                  "type": "null"
                }
              ]
            },
            "integrity_attribution": {
              "type": "string",
              "enum": [
                "none",
                "pending",
                "ambiguous",
                "isolated_verified"
              ]
            }
          },
          "required": [
            "ttfb_ms",
            "request_p50_ms",
            "request_p95_ms",
            "delta_duplicate_bytes",
            "delta_discarded_bytes",
            "upload_payload_bytes_per_second",
            "payload_bytes_per_second",
            "unique_bytes_per_second",
            "country_db_version",
            "asn",
            "native_id_class",
            "integrity_attribution"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schema_version",
        "identity",
        "sequence",
        "sample_interval_ms",
        "observed_age_ms",
        "reporting",
        "role",
        "endpoint",
        "country",
        "country_source",
        "peer_id",
        "identity_strength",
        "remote_choked",
        "remote_queued",
        "service_expected",
        "outstanding_requests",
        "queued_disk_bytes",
        "local_blocked",
        "delta_payload_bytes",
        "delta_unique_bytes",
        "delta_verified_bytes",
        "rtt_ms",
        "rtt_method",
        "qualified_idle_ms",
        "missing_reason",
        "native_state",
        "performance"
      ],
      "additionalProperties": false
    },
    "SourceSnapshot": {
      "type": "object",
      "properties": {
        "schema_version": {
          "const": "2.3"
        },
        "snapshot_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "realm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "selection_digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "component_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,19})$",
          "description": "Canonical decimal int64 nonnegative; parse and reject >9223372036854775807; rotate run before overflow."
        },
        "observed_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "expires_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "coverage": {
          "type": "string",
          "enum": [
            "covered_observed",
            "missing_observed",
            "unknown"
          ]
        },
        "coverage_quality": {
          "type": "string",
          "enum": [
            "exact",
            "aggregate",
            "partial",
            "unsupported"
          ]
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 2048
        },
        "can_serve_now": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "next_safe_probe_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "release_state": {
          "type": "string",
          "enum": [
            "closed",
            "shared_retained",
            "queue_retained",
            "unknown"
          ]
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "schema_version",
        "snapshot_id",
        "task_id",
        "realm",
        "selection_digest",
        "component_id",
        "run_id",
        "sequence",
        "observed_at_ms",
        "expires_at_ms",
        "coverage",
        "coverage_quality",
        "source_ids",
        "can_serve_now",
        "next_safe_probe_at_ms",
        "release_state",
        "reason"
      ],
      "additionalProperties": false
    },
    "DownloadBudget": {
      "type": "object",
      "properties": {
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "network_domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "storage_domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "mode": {
          "type": "string",
          "enum": [
            "probe",
            "trial",
            "active",
            "observe",
            "drain"
          ]
        },
        "network_bytes_per_second": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "write_window_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "memory_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "peer_credit": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "expires_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "enforcement": {
          "type": "string",
          "enum": [
            "hard_native",
            "soft_observed",
            "unsupported"
          ]
        }
      },
      "required": [
        "task_id",
        "run_id",
        "generation",
        "network_domain",
        "storage_domain",
        "mode",
        "network_bytes_per_second",
        "write_window_bytes",
        "memory_bytes",
        "peer_credit",
        "expires_at_ms",
        "enforcement"
      ],
      "additionalProperties": false
    },
    "ConnectionCommand": {
      "type": "object",
      "properties": {
        "schema_version": {
          "const": "2.3"
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "connection_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_policy_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "action": {
          "type": "string",
          "enum": [
            "disconnect",
            "avoid",
            "quarantine"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "connection",
            "realm_content_source",
            "realm_endpoint",
            "ip"
          ]
        },
        "automatic": {
          "type": "boolean"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "evidence_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason_code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "schema_version",
        "request_id",
        "connection_id",
        "expected_run_id",
        "expected_policy_revision",
        "action",
        "scope",
        "automatic",
        "duration_ms",
        "evidence_id",
        "reason_code",
        "task_id"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "automatic": {
                "const": true
              }
            },
            "required": [
              "automatic"
            ]
          },
          "then": {
            "properties": {
              "scope": {
                "type": "string",
                "enum": [
                  "connection",
                  "realm_content_source",
                  "realm_endpoint"
                ]
              },
              "duration_ms": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "evidence_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "scope": {
                "const": "realm_content_source"
              }
            },
            "required": [
              "scope"
            ]
          },
          "then": {
            "properties": {
              "task_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              }
            }
          }
        }
      ]
    },
    "Operation": {
      "type": "object",
      "properties": {
        "operation_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "target_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "requested_action": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "requested_scope": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "outcome": {
          "type": "string",
          "enum": [
            "pending",
            "sent",
            "applied",
            "already_closed",
            "unsupported_scope",
            "stale_target",
            "unknown",
            "failed"
          ]
        },
        "observed_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "effective_scope": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "operation_id",
        "request_id",
        "target_id",
        "requested_action",
        "requested_scope",
        "outcome",
        "observed_at_ms",
        "effective_scope",
        "reason_code"
      ],
      "additionalProperties": false
    },
    "PoolStatus": {
      "type": "object",
      "properties": {
        "policy_revision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "active_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "trial_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "observing_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "collecting_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "network_capacity_bytes_per_second": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "capacity_basis": {
          "type": "string",
          "enum": [
            "configured",
            "estimated",
            "unknown"
          ]
        },
        "utilization": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "local_pressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "control_action": {
          "type": "string",
          "enum": [
            "hold",
            "trial_more",
            "drain",
            "rotate"
          ]
        },
        "reason_code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "samples_fresh": {
          "type": "boolean"
        },
        "registered_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "rank_ready_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "held_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "finished_tasks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "policy_revision",
        "active_tasks",
        "trial_tasks",
        "observing_tasks",
        "collecting_tasks",
        "network_capacity_bytes_per_second",
        "capacity_basis",
        "utilization",
        "local_pressure",
        "control_action",
        "reason_code",
        "samples_fresh",
        "registered_tasks",
        "rank_ready_tasks",
        "held_tasks",
        "finished_tasks"
      ],
      "additionalProperties": false
    },
    "SourceCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "target_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "type": "string",
          "enum": [
            "refresh",
            "quarantine",
            "restore",
            "retire"
          ]
        },
        "reason": {
          "type": "string",
          "maxLength": 2048
        }
      },
      "required": [
        "request_id",
        "target_id",
        "expected_revision",
        "action",
        "reason"
      ],
      "additionalProperties": false
    },
    "SourceEndpoint": {
      "type": "object",
      "properties": {
        "endpoint_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "uri": {
          "type": "string",
          "maxLength": 2048
        },
        "realm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "kind": {
          "type": "string",
          "enum": [
            "tracker",
            "ed2k_server",
            "other"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "candidate",
            "validated",
            "probing",
            "usable_observed",
            "quarantined",
            "retired",
            "manual_review"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 16
        },
        "last_checked_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "risk_state": {
          "type": "string",
          "enum": [
            "unknown",
            "observed_anomaly",
            "attributed_invalid",
            "manual_deny"
          ]
        },
        "next_probe_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "endpoint_id",
        "uri",
        "realm",
        "kind",
        "state",
        "revision",
        "source_ids",
        "last_checked_at_ms",
        "risk_state",
        "next_probe_at_ms",
        "reason_code"
      ],
      "additionalProperties": false
    },
    "PolicyRecord": {
      "type": "object",
      "properties": {
        "policy_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "realm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "scope": {
          "type": "string",
          "enum": [
            "realm_content_source",
            "realm_endpoint",
            "ip"
          ]
        },
        "target_key": {
          "type": "string",
          "maxLength": 2048
        },
        "content_key": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "action": {
          "type": "string",
          "enum": [
            "avoid",
            "quarantine",
            "manual_deny",
            "allow_override"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "enforced",
            "expired",
            "revoked",
            "unknown",
            "unsupported"
          ]
        },
        "created_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "expires_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "evidence_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "strikes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reason_code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        }
      },
      "required": [
        "policy_id",
        "revision",
        "realm",
        "scope",
        "target_key",
        "content_key",
        "action",
        "state",
        "created_at_ms",
        "expires_at_ms",
        "evidence_id",
        "strikes",
        "reason_code"
      ],
      "additionalProperties": false
    },
    "PolicyCreate": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "manual_deny"
        },
        "scope": {
          "type": "string",
          "enum": [
            "realm_content_source",
            "realm_endpoint",
            "ip"
          ]
        },
        "realm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "target_key": {
          "type": "string",
          "maxLength": 2048
        },
        "content_key": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "expires_at_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        }
      },
      "required": [
        "request_id",
        "expected_revision",
        "action",
        "scope",
        "realm",
        "target_key",
        "content_key",
        "expires_at_ms",
        "reason"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "scope": {
                "const": "realm_content_source"
              }
            },
            "required": [
              "scope"
            ]
          },
          "then": {
            "properties": {
              "content_key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              }
            }
          }
        }
      ]
    },
    "PolicyRevoke": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "target_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "revoke"
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        }
      },
      "required": [
        "request_id",
        "target_id",
        "expected_revision",
        "action",
        "reason"
      ],
      "additionalProperties": false
    },
    "ConnectionPage": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ConnectionReport"
          },
          "maxItems": 500
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "has_gaps": {
          "type": "boolean"
        }
      },
      "required": [
        "items",
        "next_cursor",
        "observed_at_ms",
        "has_gaps"
      ],
      "additionalProperties": false
    },
    "SourcePage": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SourceEndpoint"
          },
          "maxItems": 500
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "has_gaps": {
          "type": "boolean"
        }
      },
      "required": [
        "items",
        "next_cursor",
        "observed_at_ms",
        "has_gaps"
      ],
      "additionalProperties": false
    },
    "PolicyPage": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PolicyRecord"
          },
          "maxItems": 500
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "has_gaps": {
          "type": "boolean"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "items",
        "next_cursor",
        "observed_at_ms",
        "has_gaps",
        "config_revision"
      ],
      "additionalProperties": false
    },
    "ResourceReport": {
      "type": "object",
      "properties": {
        "component_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,18})$"
        },
        "sample_interval_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "observed_age_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "network_domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "network_bytes_per_second": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "unique_bytes_per_second": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "capacity_bytes_per_second": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "capacity_basis": {
          "type": "string",
          "enum": [
            "configured",
            "estimated",
            "unknown"
          ]
        },
        "fd_limit": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "fd_used": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "memory_available_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "event_loop_lag_ms": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "hash_queue_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "storage_domains": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "domain_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              "pending_write_bytes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "write_p95_ms": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pressure_ratio": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "free_allocatable_bytes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "domain_id",
              "pending_write_bytes",
              "write_p95_ms",
              "pressure_ratio",
              "free_allocatable_bytes"
            ],
            "additionalProperties": false
          },
          "maxItems": 64
        },
        "lost_samples": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "component_id",
        "run_id",
        "sequence",
        "sample_interval_ms",
        "observed_age_ms",
        "network_domain",
        "network_bytes_per_second",
        "unique_bytes_per_second",
        "capacity_bytes_per_second",
        "capacity_basis",
        "fd_limit",
        "fd_used",
        "memory_available_bytes",
        "event_loop_lag_ms",
        "hash_queue_bytes",
        "storage_domains",
        "lost_samples"
      ],
      "additionalProperties": false
    },
    "ComponentCapabilities": {
      "type": "object",
      "properties": {
        "component_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "engine_version": {
          "type": "string",
          "maxLength": 2048
        },
        "capability_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "observed_fixture_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "capabilities": {
          "type": "object",
          "properties": {
            "per_connection_identity": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "service_eligibility": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "per_peer_piece_map": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "request_progress": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "disconnect_connection": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "avoid_content_source": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "reversible_ban": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "metadata_without_payload": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            },
            "retain_queue_without_autostart": {
              "type": "string",
              "enum": [
                "native",
                "observed",
                "unsupported"
              ]
            }
          },
          "required": [
            "per_connection_identity",
            "service_eligibility",
            "per_peer_piece_map",
            "request_progress",
            "disconnect_connection",
            "avoid_content_source",
            "reversible_ban",
            "metadata_without_payload",
            "retain_queue_without_autostart"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "component_id",
        "engine_version",
        "capability_revision",
        "observed_fixture_id",
        "capabilities"
      ],
      "additionalProperties": false
    },
    "DiscoverCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "deadline_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "discover"
        },
        "content_key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "realm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "selection_digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "max_returned_sources": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2048
        },
        "payload_allowed": {
          "const": false
        }
      },
      "required": [
        "request_id",
        "task_id",
        "expected_task_revision",
        "expected_run_id",
        "config_revision",
        "deadline_ms",
        "action",
        "content_key",
        "realm",
        "selection_digest",
        "max_returned_sources",
        "payload_allowed"
      ],
      "additionalProperties": false
    },
    "ProbeCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "deadline_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "probe_sources"
        },
        "source_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$"
          },
          "maxItems": 2048
        },
        "dial_credit": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "memory_credit_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "rate_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "release_task_local_on_finish": {
          "const": true
        },
        "preserve_valid_queue": {
          "const": true
        },
        "payload_allowed": {
          "const": false
        }
      },
      "required": [
        "request_id",
        "task_id",
        "expected_task_revision",
        "expected_run_id",
        "config_revision",
        "deadline_ms",
        "action",
        "source_ids",
        "dial_credit",
        "memory_credit_bytes",
        "rate_tokens",
        "release_task_local_on_finish",
        "preserve_valid_queue",
        "payload_allowed"
      ],
      "additionalProperties": false
    },
    "TrialCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "deadline_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "start_trial"
        },
        "source_snapshot_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "budget": {
          "$ref": "#/$defs/DownloadBudget"
        },
        "verification_extension_allowed": {
          "type": "boolean"
        }
      },
      "required": [
        "request_id",
        "task_id",
        "expected_task_revision",
        "expected_run_id",
        "config_revision",
        "deadline_ms",
        "action",
        "source_snapshot_id",
        "budget",
        "verification_extension_allowed"
      ],
      "additionalProperties": false
    },
    "PauseCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "deadline_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "pause_or_observe"
        },
        "reason_code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "preserve_checkpoint": {
          "const": true
        },
        "preserve_queue_if_budgeted": {
          "type": "boolean"
        },
        "target_phase": {
          "type": "string",
          "enum": [
            "observing",
            "held"
          ]
        }
      },
      "required": [
        "request_id",
        "task_id",
        "expected_task_revision",
        "expected_run_id",
        "config_revision",
        "deadline_ms",
        "action",
        "reason_code",
        "preserve_checkpoint",
        "preserve_queue_if_budgeted",
        "target_phase"
      ],
      "additionalProperties": false
    },
    "BudgetCommand": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "expected_task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expected_run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "config_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "deadline_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "action": {
          "const": "set_download_budget"
        },
        "budget": {
          "$ref": "#/$defs/DownloadBudget"
        }
      },
      "required": [
        "request_id",
        "task_id",
        "expected_task_revision",
        "expected_run_id",
        "config_revision",
        "deadline_ms",
        "action",
        "budget"
      ],
      "additionalProperties": false
    },
    "EngineAck": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "component_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "run_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        },
        "task_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "outcome": {
          "type": "string",
          "enum": [
            "applied",
            "already_applied",
            "rejected",
            "unsupported",
            "unknown"
          ]
        },
        "effective_budget": {
          "anyOf": [
            {
              "$ref": "#/$defs/DownloadBudget"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason_code": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "request_id",
        "task_id",
        "component_id",
        "run_id",
        "task_revision",
        "outcome",
        "effective_budget",
        "reason_code",
        "observed_at_ms"
      ],
      "additionalProperties": false
    }
  },
  "anyOf": [
    {
      "$ref": "#/$defs/ConnectionReport"
    },
    {
      "$ref": "#/$defs/SourceSnapshot"
    },
    {
      "$ref": "#/$defs/DownloadBudget"
    },
    {
      "$ref": "#/$defs/ConnectionCommand"
    },
    {
      "$ref": "#/$defs/ResourceReport"
    },
    {
      "$ref": "#/$defs/ComponentCapabilities"
    },
    {
      "$ref": "#/$defs/Operation"
    },
    {
      "$ref": "#/$defs/PoolStatus"
    },
    {
      "$ref": "#/$defs/SourceCommand"
    },
    {
      "$ref": "#/$defs/PolicyRecord"
    },
    {
      "$ref": "#/$defs/PolicyCreate"
    },
    {
      "$ref": "#/$defs/PolicyRevoke"
    },
    {
      "$ref": "#/$defs/SourceEndpoint"
    },
    {
      "$ref": "#/$defs/DiscoverCommand"
    },
    {
      "$ref": "#/$defs/ProbeCommand"
    },
    {
      "$ref": "#/$defs/TrialCommand"
    },
    {
      "$ref": "#/$defs/PauseCommand"
    },
    {
      "$ref": "#/$defs/BudgetCommand"
    },
    {
      "$ref": "#/$defs/EngineAck"
    }
  ],
  "description": "Explicit target type selected by endpoint; validate using its $defs. Top-level anyOf is a convenience only."
}
contracts/store-base.sql
-- P2P Downloader v2.2 初始參考 schema;不是舊 v1/v2 DB 的就地 migration。
-- 正式產品固定受修補 SQLite(至少 3.51.3 或經核對之安全 backport),本機檔案系統。
PRAGMA foreign_keys = ON;
PRAGMA journal_mode = WAL;
PRAGMA synchronous = FULL;
PRAGMA busy_timeout = 2500;

CREATE TABLE IF NOT EXISTS schema_migrations (
 version INTEGER PRIMARY KEY, applied_at_ms INTEGER NOT NULL, digest TEXT NOT NULL
) STRICT;
CREATE TABLE component_instances (
 component_id TEXT PRIMARY KEY, component_type TEXT NOT NULL, current_run_id TEXT,
 capability_json TEXT NOT NULL CHECK(json_valid(capability_json)),
 applied_config_revision INTEGER NOT NULL CHECK(applied_config_revision >= 0)
) STRICT;
CREATE TABLE tasks (
 task_id TEXT PRIMARY KEY, component_id TEXT NOT NULL REFERENCES component_instances,
 title TEXT NOT NULL, desired_state TEXT NOT NULL CHECK(desired_state IN ('running','paused','cancelled')),
 execution_state TEXT NOT NULL, placement_state TEXT NOT NULL DEFAULT 'none',
 availability_class TEXT NOT NULL DEFAULT 'unknown' CHECK(availability_class IN ('high','available','unknown','incomplete','low')),
 auto_priority INTEGER NOT NULL DEFAULT 550 CHECK(auto_priority BETWEEN 0 AND 999),
 protected INTEGER NOT NULL DEFAULT 0 CHECK(protected IN (0,1)),
 revision INTEGER NOT NULL DEFAULT 1 CHECK(revision > 0),
 selection_digest TEXT NOT NULL, scope_key TEXT NOT NULL,
 total_selected_bytes INTEGER CHECK(total_selected_bytes >= 0),
 verified_durable_bytes INTEGER NOT NULL DEFAULT 0 CHECK(verified_durable_bytes >= 0),
 allocated_bytes INTEGER CHECK(allocated_bytes >= 0),
 eligible_wait_ms INTEGER NOT NULL DEFAULT 0 CHECK(eligible_wait_ms >= 0),
 last_service_at_ms INTEGER, last_useful_progress_at_ms INTEGER,
 next_probe_at_ms INTEGER, created_at_ms INTEGER NOT NULL,
 CHECK(total_selected_bytes IS NULL OR verified_durable_bytes <= total_selected_bytes)
) STRICT;
CREATE INDEX tasks_dispatch ON tasks(component_id,desired_state,execution_state,auto_priority,created_at_ms);
CREATE INDEX tasks_probe_due ON tasks(next_probe_at_ms,task_id) WHERE desired_state='running';
CREATE TABLE content_keys (
 task_id TEXT NOT NULL REFERENCES tasks, namespace TEXT NOT NULL, algorithm TEXT NOT NULL,
 digest TEXT NOT NULL, scope_key TEXT NOT NULL,
 strength TEXT NOT NULL CHECK(strength IN ('strong_native','verified_equivalence','locator','candidate')),
 PRIMARY KEY(task_id,namespace,algorithm,digest,scope_key)
) STRICT;
CREATE INDEX content_keys_lookup ON content_keys(namespace,algorithm,digest,scope_key);
CREATE TABLE attempts (
 attempt_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks, run_id TEXT,
 outcome TEXT NOT NULL, started_at_ms INTEGER NOT NULL, ended_at_ms INTEGER, reason_code TEXT
) STRICT;
CREATE TABLE active_claims (
 claim_id TEXT PRIMARY KEY, claim_key TEXT NOT NULL, task_id TEXT NOT NULL REFERENCES tasks,
 attempt_id TEXT REFERENCES attempts, active INTEGER NOT NULL CHECK(active IN (0,1))
) STRICT;
CREATE UNIQUE INDEX one_active_claim ON active_claims(claim_key) WHERE active=1;
CREATE TABLE native_jobs (
 mapping_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks,
 component_id TEXT NOT NULL REFERENCES component_instances, run_id TEXT NOT NULL,
 native_job_id TEXT NOT NULL, mapping_state TEXT NOT NULL,
 UNIQUE(component_id,run_id,native_job_id)
) STRICT;
CREATE TABLE operations (
 operation_id TEXT PRIMARY KEY, request_id TEXT NOT NULL UNIQUE, task_id TEXT REFERENCES tasks,
 action TEXT NOT NULL, payload_digest TEXT NOT NULL, state TEXT NOT NULL,
 expected_revision INTEGER, created_at_ms INTEGER NOT NULL, completed_at_ms INTEGER
) STRICT;
CREATE TABLE command_outbox (
 command_id TEXT PRIMARY KEY, operation_id TEXT NOT NULL REFERENCES operations,
 task_id TEXT NOT NULL REFERENCES tasks, expected_run_id TEXT NOT NULL,
 expected_revision INTEGER NOT NULL, config_revision INTEGER NOT NULL,
 payload_json TEXT NOT NULL CHECK(json_valid(payload_json)),
 state TEXT NOT NULL CHECK(state IN ('pending','sent','acknowledged','unknown','reconciled','rejected')),
 created_at_ms INTEGER NOT NULL
) STRICT;
CREATE INDEX outbox_pending ON command_outbox(state,created_at_ms);
CREATE TABLE resource_leases (
 lease_id TEXT PRIMARY KEY, task_id TEXT REFERENCES tasks, component_id TEXT NOT NULL REFERENCES component_instances,
 run_id TEXT NOT NULL, generation INTEGER NOT NULL CHECK(generation>0), mode TEXT NOT NULL,
 reservation_json TEXT NOT NULL CHECK(json_valid(reservation_json)),
 enforcement TEXT NOT NULL CHECK(enforcement IN ('hard_native','soft_observed','unsupported')),
 state TEXT NOT NULL CHECK(state IN ('reserved','active','draining','unknown','released')),
 expires_at_ms INTEGER NOT NULL, stopped_confirmed_at_ms INTEGER
) STRICT;
CREATE INDEX leases_accounting ON resource_leases(state,component_id);
CREATE TABLE probe_runs (
 probe_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks, run_id TEXT NOT NULL,
 level TEXT NOT NULL, started_at_ms INTEGER NOT NULL, ended_at_ms INTEGER,
 qualified INTEGER NOT NULL CHECK(qualified IN (0,1)), outcome TEXT NOT NULL,
 evidence_json TEXT NOT NULL CHECK(json_valid(evidence_json))
) STRICT;
CREATE INDEX probe_task_time ON probe_runs(task_id,started_at_ms);
CREATE TABLE resource_assessments (
 task_id TEXT PRIMARY KEY REFERENCES tasks, source_run_id TEXT NOT NULL, report_seq INTEGER NOT NULL,
 assessed_at_ms INTEGER NOT NULL, expires_at_ms INTEGER NOT NULL,
 coverage_scope TEXT NOT NULL, quality TEXT NOT NULL,
 summary_json TEXT NOT NULL CHECK(json_valid(summary_json)), config_revision INTEGER NOT NULL
) STRICT;
CREATE TABLE scheduler_decisions (
 decision_id INTEGER PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks,
 decision_type TEXT NOT NULL, priority INTEGER CHECK(priority BETWEEN 0 AND 999),
 reasons_json TEXT NOT NULL CHECK(json_valid(reasons_json)),
 config_revision INTEGER NOT NULL, input_report_seq INTEGER, created_at_ms INTEGER NOT NULL
) STRICT;
CREATE TABLE domain_events (
 event_seq INTEGER PRIMARY KEY AUTOINCREMENT, event_id TEXT NOT NULL UNIQUE,
 task_id TEXT REFERENCES tasks, attempt_id TEXT REFERENCES attempts,
 component_id TEXT, run_id TEXT, producer_seq INTEGER,
 event_type TEXT NOT NULL, payload_json TEXT NOT NULL CHECK(json_valid(payload_json)),
 committed_at_ms INTEGER NOT NULL,
 UNIQUE(component_id,run_id,producer_seq)
) STRICT;
CREATE INDEX events_task_cursor ON domain_events(task_id,event_seq);
CREATE TABLE volumes (
 volume_id TEXT PRIMARY KEY, root_path TEXT NOT NULL, filesystem_identity TEXT NOT NULL,
 storage_policy_revision INTEGER NOT NULL
) STRICT;
CREATE TABLE task_storage (
 task_id TEXT PRIMARY KEY REFERENCES tasks, volume_id TEXT NOT NULL REFERENCES volumes,
 storage_key TEXT NOT NULL CHECK(length(storage_key)=64), layout_version INTEGER NOT NULL,
 relative_path TEXT NOT NULL, payload_created INTEGER NOT NULL CHECK(payload_created IN (0,1)),
 native_checkpoint_ref TEXT, checkpoint_digest TEXT,
 logical_bytes INTEGER CHECK(logical_bytes>=0), allocated_bytes INTEGER CHECK(allocated_bytes>=0),
 accounted_at_ms INTEGER
) STRICT;
CREATE TABLE artifacts (
 artifact_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks,
 volume_id TEXT NOT NULL REFERENCES volumes, relative_path TEXT NOT NULL,
 selection_digest TEXT NOT NULL, verification_level TEXT NOT NULL,
 presence TEXT NOT NULL CHECK(presence IN ('present','missing','changed','unchecked','deleted')),
 placement_state TEXT NOT NULL, manifest_digest TEXT NOT NULL, verified_at_ms INTEGER,
 UNIQUE(volume_id,relative_path)
) STRICT;
CREATE TABLE artifact_refs (
 artifact_id TEXT NOT NULL REFERENCES artifacts, owner_kind TEXT NOT NULL, owner_id TEXT NOT NULL,
 state TEXT NOT NULL, PRIMARY KEY(artifact_id,owner_kind,owner_id)
) STRICT;
CREATE TABLE file_operations (
 file_op_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks, request_id TEXT NOT NULL UNIQUE,
 kind TEXT NOT NULL CHECK(kind IN ('publish','move','quarantine','restore','purge')),
 phase TEXT NOT NULL, expected_task_revision INTEGER NOT NULL,
 source_volume_id TEXT NOT NULL REFERENCES volumes, destination_volume_id TEXT REFERENCES volumes,
 source_path TEXT NOT NULL, destination_path TEXT,
 source_fingerprint TEXT NOT NULL, manifest_digest TEXT NOT NULL,
 copied_bytes INTEGER NOT NULL DEFAULT 0 CHECK(copied_bytes>=0),
 policy_revision INTEGER NOT NULL, created_at_ms INTEGER NOT NULL, updated_at_ms INTEGER NOT NULL
) STRICT;
CREATE INDEX file_operations_pending ON file_operations(phase,updated_at_ms);
CREATE TABLE dead_candidates (
 task_id TEXT PRIMARY KEY REFERENCES tasks, qualified_rounds INTEGER NOT NULL,
 distinct_probe_days INTEGER NOT NULL, reason_code TEXT NOT NULL,
 candidate_at_ms INTEGER NOT NULL, quarantined_at_ms INTEGER, delete_not_before_ms INTEGER,
 policy_revision INTEGER NOT NULL, stale INTEGER NOT NULL DEFAULT 0 CHECK(stale IN (0,1))
) STRICT;
CREATE INDEX cleanup_due ON dead_candidates(delete_not_before_ms,task_id) WHERE stale=0;
CREATE TABLE history_tombstones (
 tombstone_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks,
 native_keys_json TEXT NOT NULL CHECK(json_valid(native_keys_json)),
 outcome TEXT NOT NULL, deleted_bytes INTEGER NOT NULL CHECK(deleted_bytes>=0),
 reason_code TEXT NOT NULL, policy_revision INTEGER NOT NULL, created_at_ms INTEGER NOT NULL
) STRICT;
-- 每秒流量、peer 清單歷史、國家分布、RTT 等不寫入此 core DB;由 P2P Metrics 自有 DB 保存。
-- 每個 token pool 的 vector 檢查與 lease + outbox 建立必須在同一個 BEGIN IMMEDIATE 中完成。
contracts/store-v23.sql
-- v2.2 reference schema 的加法 migration;先在備份副本核對 baseline schema hash。
-- 此檔不碰 payload,不刪除歷史、不自行變更 user_version。migration runner 在同一交易記錄版本。
CREATE TABLE discovery_targets (
 task_id TEXT PRIMARY KEY REFERENCES tasks(task_id),
 phase TEXT NOT NULL CHECK(phase IN ('collecting','rank_ready','trial','active','observing','held','finished')),
 observation_reason TEXT, eligibility_at_ms INTEGER, revision INTEGER NOT NULL DEFAULT 1 CHECK(revision>0),
 qualified_wait_ms INTEGER NOT NULL DEFAULT 0 CHECK(qualified_wait_ms>=0)
) STRICT;
CREATE INDEX discovery_due ON discovery_targets(phase,eligibility_at_ms,task_id);
CREATE TABLE source_snapshots (
 snapshot_id TEXT PRIMARY KEY, task_id TEXT NOT NULL REFERENCES tasks,
 source_id TEXT NOT NULL, realm TEXT NOT NULL, run_id TEXT NOT NULL,
 sequence INTEGER NOT NULL CHECK(sequence>=0), selection_digest TEXT NOT NULL, observation_ms INTEGER NOT NULL, expires_ms INTEGER NOT NULL,
 completeness TEXT NOT NULL CHECK(completeness IN ('complete','partial','unknown')),
 evidence_json TEXT NOT NULL CHECK(json_valid(evidence_json)),
 UNIQUE(task_id,source_id,run_id,sequence), CHECK(expires_ms>=observation_ms)
) STRICT;
CREATE INDEX snapshots_lookup ON source_snapshots(task_id,expires_ms);
CREATE TABLE connection_identities (
 connection_id TEXT PRIMARY KEY, component_id TEXT NOT NULL REFERENCES component_instances,
 run_id TEXT NOT NULL, native_connection_key TEXT NOT NULL, transport_handle_id TEXT NOT NULL, realm TEXT NOT NULL,
 role TEXT NOT NULL, source_key TEXT NOT NULL, task_id TEXT REFERENCES tasks,
 opened_ms INTEGER NOT NULL, closed_ms INTEGER, last_sample_seq INTEGER,
 close_reason TEXT, CHECK(closed_ms IS NULL OR closed_ms>=opened_ms),
 UNIQUE(component_id,run_id,native_connection_key,opened_ms)
) STRICT;
CREATE TABLE connection_evidence (
 evidence_id TEXT PRIMARY KEY, connection_id TEXT REFERENCES connection_identities,
 task_id TEXT REFERENCES tasks, classification TEXT NOT NULL, reason_code TEXT NOT NULL,
 evidence_strength TEXT NOT NULL CHECK(evidence_strength IN ('observed','attributed','suspected','unknown')),
 sample_digest TEXT NOT NULL, evidence_json TEXT NOT NULL CHECK(json_valid(evidence_json)),
 config_revision INTEGER NOT NULL, created_ms INTEGER NOT NULL
) STRICT;
CREATE TABLE connection_policies (
 policy_id TEXT PRIMARY KEY, realm TEXT NOT NULL, target_kind TEXT NOT NULL,
 target_key TEXT NOT NULL, content_scope TEXT,
 action TEXT NOT NULL CHECK(action IN ('avoid','quarantine','manual_deny','allow_override')),
 state TEXT NOT NULL CHECK(state IN ('pending','enforced','expired','revoked','unknown','unsupported')),
 strikes INTEGER NOT NULL CHECK(strikes>=0), expires_ms INTEGER,
 evidence_id TEXT NOT NULL REFERENCES connection_evidence,
 revision INTEGER NOT NULL DEFAULT 1, created_ms INTEGER NOT NULL,
 CHECK(action='manual_deny' OR expires_ms IS NOT NULL), CHECK(revision>0)
) STRICT;
CREATE INDEX policies_target ON connection_policies(realm,target_kind,target_key,expires_ms);
CREATE TABLE connection_commands (
 command_id TEXT PRIMARY KEY, operation_id TEXT NOT NULL UNIQUE REFERENCES operations, request_id TEXT NOT NULL UNIQUE, payload_digest TEXT NOT NULL,
 connection_id TEXT NOT NULL REFERENCES connection_identities, expected_run_id TEXT NOT NULL,
 expected_policy_revision INTEGER NOT NULL, task_id TEXT REFERENCES tasks, action TEXT NOT NULL, scope TEXT NOT NULL,
 evidence_id TEXT REFERENCES connection_evidence,
 outcome TEXT NOT NULL CHECK(outcome IN ('pending','sent','applied','already_closed','unsupported_scope','stale_target','unknown','failed')),
 created_ms INTEGER NOT NULL, observed_ms INTEGER
) STRICT;
CREATE TABLE catalog_feeds (
 feed_id TEXT PRIMARY KEY, uri TEXT NOT NULL, lineage_group TEXT NOT NULL, enabled INTEGER NOT NULL CHECK(enabled IN (0,1)),
 approved_config_revision INTEGER NOT NULL, last_good_digest TEXT, last_checked_ms INTEGER,
 status TEXT NOT NULL
) STRICT;
CREATE TABLE catalog_revisions (
 revision_id TEXT PRIMARY KEY, feed_id TEXT NOT NULL REFERENCES catalog_feeds,
 content_digest TEXT NOT NULL, status TEXT NOT NULL CHECK(status IN ('staged','validated','rejected','published','withdrawn')),
 source_etag TEXT, fetched_ms INTEGER NOT NULL, diff_json TEXT NOT NULL CHECK(json_valid(diff_json)),
 UNIQUE(feed_id,content_digest)
) STRICT;
CREATE TABLE catalog_endpoints (
 endpoint_id TEXT PRIMARY KEY, canonical_uri TEXT NOT NULL, realm TEXT NOT NULL, kind TEXT NOT NULL,
 state TEXT NOT NULL CHECK(state IN ('candidate','validated','probing','usable_observed','quarantined','retired','manual_review')),
 first_seen_ms INTEGER NOT NULL, last_seen_ms INTEGER NOT NULL, next_probe_ms INTEGER,
 risk_state TEXT NOT NULL DEFAULT 'unknown', UNIQUE(realm,kind,canonical_uri)
) STRICT;
CREATE TABLE catalog_provenance (
 endpoint_id TEXT NOT NULL REFERENCES catalog_endpoints, revision_id TEXT NOT NULL REFERENCES catalog_revisions,
 source_line INTEGER CHECK(source_line>0), PRIMARY KEY(endpoint_id,revision_id)
) STRICT;
-- current connection status/history high-frequency series remain owned by P2P Metrics;
-- Store only retains lifecycle indexes, evidence behind decisions, and durable commands.
CREATE TABLE connection_tasks (
 connection_id TEXT NOT NULL REFERENCES connection_identities,
 task_id TEXT NOT NULL REFERENCES tasks,
 PRIMARY KEY(connection_id,task_id)
) STRICT;

-- Detached/manual policy changes also need a durable command path without a live connection.
CREATE TABLE policy_commands (
 command_id TEXT PRIMARY KEY, operation_id TEXT NOT NULL UNIQUE REFERENCES operations,
 request_id TEXT NOT NULL UNIQUE, policy_id TEXT NOT NULL REFERENCES connection_policies,
 expected_revision INTEGER NOT NULL CHECK(expected_revision>0),
 payload_json TEXT NOT NULL CHECK(json_valid(payload_json)),
 outcome TEXT NOT NULL CHECK(outcome IN ('pending','sent','applied','unsupported_scope','unknown','failed')),
 created_ms INTEGER NOT NULL, observed_ms INTEGER
) STRICT;
examples/avoid-command.json
{
  "schema_version": "2.3",
  "request_id": "req_example_18",
  "connection_id": "conn_example_17",
  "expected_run_id": "run_example_4",
  "expected_policy_revision": 3,
  "action": "avoid",
  "scope": "realm_content_source",
  "automatic": true,
  "duration_ms": 60000,
  "evidence_id": "evidence_example_5",
  "reason_code": "QUALIFIED_NO_PAYLOAD",
  "task_id": "task_1"
}
examples/connection-report.json
{
  "schema_version": "2.3",
  "identity": {
    "connection_id": "conn_example_17",
    "component_id": "mule_1",
    "run_id": "run_example_4",
    "native_connection_key": "socket17",
    "transport_handle_id": "transport17",
    "realm": "ed2k",
    "task_ids": [
      "task_1"
    ]
  },
  "sequence": "10",
  "sample_interval_ms": 1000,
  "observed_age_ms": 50,
  "reporting": "exact",
  "role": "payload",
  "endpoint": "example-not-dialed:4662",
  "country": null,
  "country_source": null,
  "peer_id": "claimed_example",
  "identity_strength": "claimed",
  "remote_choked": false,
  "remote_queued": false,
  "service_expected": true,
  "outstanding_requests": 2,
  "queued_disk_bytes": "0",
  "local_blocked": false,
  "delta_payload_bytes": 0,
  "delta_unique_bytes": 0,
  "delta_verified_bytes": 0,
  "rtt_ms": 80,
  "rtt_method": "transport_sample",
  "qualified_idle_ms": 35000,
  "missing_reason": null,
  "native_state": {
    "handshake_complete": true,
    "interested": true,
    "needed_overlap": true,
    "slot_granted": true,
    "remote_queue_rank": null,
    "receive_credit_bytes": 1048576,
    "service_generation": "service_3",
    "protocol_deadline_ms": 30000,
    "common_path_outage": false,
    "enforcement_capabilities": [
      "disconnect_connection",
      "avoid_content_source"
    ]
  },
  "performance": {
    "ttfb_ms": null,
    "request_p50_ms": null,
    "request_p95_ms": null,
    "delta_duplicate_bytes": 0,
    "delta_discarded_bytes": 0,
    "upload_payload_bytes_per_second": 0,
    "payload_bytes_per_second": 0,
    "unique_bytes_per_second": 0,
    "country_db_version": null,
    "asn": null,
    "native_id_class": "high_id_claimed",
    "integrity_attribution": "none"
  }
}
examples/manual-policy.json
{
  "request_id": "req_manual_7",
  "expected_revision": 3,
  "action": "manual_deny",
  "scope": "realm_content_source",
  "realm": "ed2k",
  "target_key": "source_example",
  "content_key": "content_example",
  "expires_at_ms": null,
  "reason": "人工指定示例;不代表真實端點惡意"
}
examples/pool-status.json
{
  "policy_revision": 3,
  "active_tasks": 5,
  "trial_tasks": 2,
  "observing_tasks": 18,
  "collecting_tasks": 975,
  "network_capacity_bytes_per_second": 100000000,
  "capacity_basis": "configured",
  "utilization": 0.5,
  "local_pressure": 0.2,
  "control_action": "trial_more",
  "reason_code": "NETWORK_HEADROOM",
  "samples_fresh": true,
  "registered_tasks": 1000,
  "rank_ready_tasks": 0,
  "held_tasks": 0,
  "finished_tasks": 0
}
examples/trial-command.json
{
  "request_id": "req_trial_1",
  "task_id": "task_1",
  "expected_task_revision": 1,
  "expected_run_id": "run_example_4",
  "config_revision": 3,
  "deadline_ms": 1790982000000,
  "action": "start_trial",
  "source_snapshot_id": "snapshot_1",
  "budget": {
    "task_id": "task_1",
    "run_id": "run_example_4",
    "generation": 3,
    "network_domain": "link_a",
    "storage_domain": "ssd_a",
    "mode": "trial",
    "network_bytes_per_second": 2097152,
    "write_window_bytes": 4194304,
    "memory_bytes": 8388608,
    "peer_credit": 2,
    "expires_at_ms": 1790982000000,
    "enforcement": "hard_native"
  },
  "verification_extension_allowed": true
}