一開始可以把 1,000 個「探索工作」同時放入可執行集合。非同步 I/O 不表示
1,000×所有 peer 的 socket 必須在同一毫秒建立。共用 tracker transport、eD2k
server session、Kad routing table 與已在取得中的相同 metadata;相同
content+realm+設定版本的來源查詢合併,結果可供多個選取範圍使用。
窗口控制同時存活數,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 的成本要另列,且不得暗中自動開始無預算傳輸。
大檔低速/長 RTT 不能只因未達固定 MiB/s 被淘汰。協定提供慢速但穩定服務,也可走
fair/rescue
升級;小檔在試跑期間完成直接轉驗證,不硬湊三窗。可驗證單位超出窗口時延長經核發的
byte budget,或回 inconclusive;不能超額。
每個磁碟/檔案系統獨立 pressure domain;慢 HDD
只應限制寫往它的工作,不全面凍結另一顆空閒 SSD。Linux PSI 可提供
CPU、記憶體、I/O stall 訊號,但它不是完整網路容量或磁碟吞吐量測。S14
原始樣本約 1 秒,決策約 10 秒;變更後至少 30
秒或原生啟動成本的較大者再判成敗。快速保護事件不必等此週期。最近 10–30 秒
robust EWMA/中位數用於吞吐,p95 用於延遲與記憶體成本。
新增步幅以目前可負擔 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。
每次有效 unique progress 重置計時。協定 keepalive 不重置;合格時間暫停時不偷計
wall-clock。對已逾期請求執行有界取消/retry;反覆失敗則
disconnect + temporary avoid,保存證據。不存在實際
request、對方合法排隊、沒有缺段交集,最多釋放無用連線,不增加惡意 strike。
流量有但進度不動要另分:重複 endgame
block、已驗證範圍、無用訊息、暫存還沒校驗、對方送錯範圍。本機確認未發送
request 的 unsolicited
小幅晚到資料,不應一律判攻擊;證據須考慮取消競態與協定允許行為。S2
相同 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
系統能偵測的是可觀測行為,不是對方的真實意圖。能分析:路徑穿越、危險
URL/控制字元、錯誤 wire 長度、壓縮炸彈、已歸因 hash
失敗、來源宣告與實際不符、反覆回傳不可用來源、要求開啟外部頁面或輸入帳密的
metadata。UI 對這類內容只顯示純文字與警示,不自動執行、預覽腳本或開啟連結。
回應 provider 注入內網/管理 port、廣域相似來源洪水、DNS 轉向、metadata
變更等異常時,先保留 provenance,隔離對應 candidate/source;不能因短期網路
outage 將所有來源打入黑名單。
WSS 端點是 WebTorrent 特定能力候選;不用在不支援的普通 BT Engine。敏感 port 如
UDP/25 先轉人工審核,不因出現在公開清單就自動發送協定資料;常見低 port 的
tracker 亦須角色/scheme 精確允許,不能套成一般 peer 的全域放行。
自動更新在使用者啟用對應 Component 後運作,不因開 HTML/安裝 spec 執行。每 24
小時+jitter、conditional request,只有兩個實際取得的 tracker text feeds
預設開啟。新端點先 validated/probing,舊的已知良好設定在更新失敗時保留;手動
pin/deny 永遠覆蓋 feed。
大量新增/刪除、domain 所有權或 DNS/憑證異常、大量非 public
地址、來源格式變更,進入 quarantine diff 供審核。HTTPS 與 Git blob digest
保護的是來源/傳輸與快照一致性,不能證明端點善意,也不把未驗證簽章稱為已驗簽。
這些 SSRF 防護需要在實際 fetch/connect 路徑落地;只在字串 parser
做一次檢查不足以處理 DNS rebinding。OWASP 的驗證與 redirect/DNS
風險說明作為實作參考。S12
Tracker 的 UDP connect 並不等於收到有效 announce peers。BEP 15 定義
connect/announce/scrape,不同步驟結果分開保存;不對使用者所有 hash
做額外「測試 announce」。S15
真正建立 socket、選 piece、正常協定超時、parser 的立即拒絕屬 Engine。Scheduler
調整下載 budget;Connection Manager
下更窄的來源/連線限制。有效允許集合是兩者交集,Connection Manager
不能繞過使用者暫停或超出 Scheduler 的額度。
對 multiplex transport,content-source avoid 只限制指定 work。若引擎只能關整條
transport 而其他 Task 正在有效服務,不能冒充「只關這個工作」;自動治理回
unsupported_scope,保留窄 deny-new-request
規則。人工「關此實體連線」必須顯示全部受影響 Task。
每一命令含 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。
Store 無法寫入時停止新的派工及政策擴張;Engine 仍可立即拒絕解析錯誤或依已發布
policy 斷線,自保事件暫存有界記憶體並標未持久化。Metrics 壞掉時維持即時
ResourceReport 路徑,標歷史觀測缺口,不停止健康下載。
報告 freshness 與服務計時採單調時間;持久化 expiry 使用 UTC
並保存原觀測/本機接收時間。重啟後遇到時鐘回退、過期範圍不明或 sequence
跳躍,標記需要重新觀測,不拉長封鎖、不偷計未觀測服務時間。Component 重新註冊換
run,不能借舊 ID 延續別條連線的違規次數。
Store 使用 SQLite WAL、單 writer、短 transaction、讀取 snapshot
與有界批次;checkpoint 由同一協調者排程,避免長讀阻擋回收。正式 WAL 部署須包含
SQLite WAL-reset 修補;本規格沿用至少 3.51.3 或核實 backport 的政策,不以本機
schema smoke test 冒充正式版本驗收。S13
不按整檔大小先預配置 payload,也不為全部 target 預留滿額。bytes 是實際
allocated blocks、native
buffer、下一批寫入窗口、WAL/metadata/搬移暫存等分開記帳。sparse logical size
大於已配置 blocks 不等於真正占滿,UI 同時呈現兩者。
完成搬移先確認 writer 停止、驗證完成、manifest 固定。相同 filesystem atomic
rename;跨裝置 copy→fsync→校驗→發布→更新
journal→刪舊檔,任一步失敗保留可恢復資料。分享中的 Engine 改路徑必須經原生 API
協調,不直接搬走還在使用的檔案。
自動清理預設關閉;啟用後依 Config retention、先隔離再 purge,刪除保留
tombstone。低速、個別來源被 avoid、tracker 暫時掛掉,都不能構成單獨清理依據。
延用 Noir Workbench
暗色、繁中、系統字體、固定語義色、無新登入/i18n/Next.js。來源搜尋仍分
tabs,保留每個來源的原生欄位;大量資料採游標分頁/虛擬清單,不每秒全表重新掛載。
動作「關此連線」「暫時避開這個來源」「封鎖這個 IP」必須分開;不支援的精準動作
disable
並顯示原因,不能換成比較粗暴的另一種操作。誤封可撤銷但先核對原生結果;未知操作不顯示成功
toast。
目標測試基線由開發者記錄 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。
先凍結 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
接手後直接實作和測試既定任務,不把全部內容重寫成另一份計畫就算交付。
候選來源原始資料: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"
}
]
## 契約、設定與開發交接原文
以下是此版同包 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
}