Commit Graph
492 Commits
Author SHA1 Message Date
BaaRai 95a8206cb6 Merge pull request #30 from BaaRai/bot/fix-argjson
Bot: quote the response_format JSON for --argjson
2026-10-10 19:19:39 +02:00
BaaRai 0e82253686 Bot: quote the response_format JSON for --argjson
--argjson requires strict JSON; the unquoted-key object made jq fail,
sent an empty request body, and the triage died with 'model returned
nothing'. Also log the raw API response when choices is missing so the
next failure shows its cause immediately.
2026-10-10 19:19:34 +02:00
BaaRai 905e401676 Merge pull request #28 from BaaRai/bot/json-mode
Bot: JSON mode for triage, temperature 0, flash model
2026-10-10 19:16:42 +02:00
BaaRai 42f3bd98ea Bot: JSON mode for triage, temperature 0, flash model
The trailing-line LABELS contract was unreliable at temperature 0.2:
a raw A/B run showed both deepseek-chat and deepseek-flash emit the
line correctly at temperature 0 but drop it nondeterministically at
0.2 (five failed live runs, one lucky success). Structural fix: the
triage now requests response_format json_object, temperature 0, and
parses the reply with jq (comment field for the reply, labels array
for labeling). The label whitelist still drops invented names and the
raw JSON is logged before parsing. Model switched to deepseek-flash:
the A/B showed JSON compliance on both models and flash is the
cheaper line. Mentions and PR first-looks keep text mode at
temperature 0.
2026-10-10 19:16:37 +02:00
BaaRai cf68aece0a Merge pull request #26 from BaaRai/bot/restore-prompt
Bot: restore the original LABELS instruction wording
2026-10-10 19:08:06 +02:00
BaaRai f420277729 Bot: restore the original LABELS instruction wording
The reworded instruction from #20 ("plain text with no markdown
formatting, characters, or emphasis") made models stop emitting the
LABELS line entirely; the original quoted phrasing had 100 percent
compliance. Tolerant parser and debug logging stay.
2026-10-10 19:08:00 +02:00
BaaRai e39734539d Merge pull request #24 from BaaRai/bot/debug-tail
Bot: log the raw reply tail for triage debugging
2026-10-10 19:06:04 +02:00
BaaRai d1d28cb333 Bot: log the raw reply tail for triage debugging 2026-10-10 19:05:59 +02:00
BaaRai 631859657a Merge pull request #22 from BaaRai/bot/revert-flash
Bot: back to deepseek-chat
2026-10-10 19:02:19 +02:00
BaaRai 698ec389e0 Bot: back to deepseek-chat
deepseek-flash dropped the LABELS instruction twice in live tests
(decorated once, absent once); deepseek-chat followed it exactly on
the first try. The price difference is fractions of a cent per call,
reliability wins. The tolerant parser from #20 stays: it is harmless
and protects against any model formatting quirks.
2026-10-10 19:02:13 +02:00
BaaRai 919755dc2a Merge pull request #20 from BaaRai/bot/robust-labels
Bot: tolerate decorated LABELS lines from smaller models
2026-10-10 19:00:09 +02:00
BaaRai c08a229a57 Bot: tolerate decorated LABELS lines from smaller models
deepseek-flash sometimes bolds or backticks the LABELS marker and the
individual names. Accept any decoration around the marker line and
strip markdown characters from each name before the whitelist check.
Also log the parsed label line for easier triage of future misses.
2026-10-10 19:00:04 +02:00
BaaRai 0213310e38 Merge pull request #18 from BaaRai/bot/deepseek-flash
Bot: switch the model to deepseek-flash
2026-10-10 18:56:23 +02:00
BaaRai f95e975e31 Bot: switch the model to deepseek-flash
DeepSeek's current recommendation: V4.1-Flash replaces V4-Pro and is
the efficient line (new encoder-decoder MoE, quarter-size KV cache,
off-peak at half price). Plenty for triage work; the API name is
deepseek-flash.
2026-10-10 18:56:18 +02:00
BaaRai 765308712e Merge pull request #16 from BaaRai/bot/maintainer-labels
Bot: label maintainer-opened issues, silently
2026-10-10 18:46:37 +02:00
BaaRai 7511937e82 Bot: label maintainer-opened issues, silently
Closes #15. Issues opened by the maintainer now go through the same
classification and label application but without the triage comment
or reaction. Visitors keep the full behavior; mentions and PR
first-looks stay maintainer-off.
2026-10-10 18:46:31 +02:00
BaaRai e9527fa8f2 Merge pull request #14 from BaaRai/bot/triage-labels
Bot: apply type and priority labels when triaging new issues
2026-10-10 18:43:27 +02:00
BaaRai 875f2f0f53 Bot: apply type and priority labels when triaging new issues
Closes #13. The triage prompt now ends with a LABELS line (bug,
question, feature, plus P1/P2/P3 for bugs). The script strips that
line from the posted comment, filters it against a fixed whitelist,
creates the labels with stable colors if missing, and applies them.
Mentions and PR first-looks stay comment-only.
2026-10-10 18:43:21 +02:00
BaaRai 3eebf02596 Merge pull request #12 from BaaRai/bot/issue-pr-bot
Add triage and reply bot for issues and pull requests
2026-10-10 18:18:20 +02:00
BaaRai 815a12d91c Merge pull request #11 from BaaRai/ci/add-ci
Add CI: go build/vet/test with postgres, web typecheck and static build
2026-10-10 18:18:16 +02:00
BaaRai 525ad9ffde Skip the four known-broken tests in code instead of CI -skip flags
The go test -skip flag proved unreliable in the full-suite CI shape
(the same pattern skipped correctly in isolation but ran on the
runner), so each of the four tests now carries an explicit t.Skip with
the reason and a pointer to issue #9. The CI workflow drops the -skip
argument and keeps serial package execution.
2026-10-10 18:12:42 +02:00
BaaRai 78a2d2c01f ci: serialize test packages against the shared postgres
The rotating agent-package failures were cross-package database
interference: go test runs package binaries in parallel and they all
share the one postgres service, so fixtures delete each other's rows.
-p 1 makes package execution serial and the database deterministic.
2026-10-10 17:50:07 +02:00
BaaRai 24e40338b1 ci: fix skip typo, add the CI-flaky llmrec test to the list
First CI run caught a typo in the skip list (the test name is
TestGraphOverviewExpands, with a d) and exposed that
TestSideUsageRecordedOnceOnConsumerCancellation is timing-sensitive
on 2-core runners: it passes locally, fails on CI. Both noted in #9.
2026-10-10 17:44:57 +02:00
BaaRai 88dbe0cb66 Add triage and reply bot for issues and pull requests
Closes #10. A GitHub Action bot with no server: one triage comment per
new issue (classification, missing-info list, grounded first answer),
answers comments that @artex-bot, and a first-look summary checklist on
opened pull requests. Comment-only, never an approving review. Skips
the maintainer, bots, and itself; exits cleanly without the API key;
all model inputs are size-capped.
2026-10-10 17:38:07 +02:00
BaaRai 74e85bc945 Add CI: go build/vet/test with postgres, web typecheck and static build
Closes #9. Go job runs the test suite against a postgres:16 service
container, skipping the three tests that fail on unmodified upstream
code with a fresh database (documented in the issue). Web job runs
tsc --noEmit and the static export build.
2026-10-10 17:36:38 +02:00
BaaRai 858021252e Merge pull request #7 from BaaRai/fix/credential-username-placeholder
Clarify credentials username placeholder
2026-10-09 15:17:24 +02:00
BaaRai 39e630f3fb Clarify credentials username placeholder
Bug bounty alias accounts are nearly always emails, so a bare
"username" placeholder read like a handle only. Say "email or
username" in both the creation dialog and the task detail tab.
The agent tool description already said "login name / email used".
2026-10-09 15:17:12 +02:00
BaaRai ea933902c9 Merge pull request #6 from BaaRai/fix/credentials-ui-regression
Fix credentials UI regression from #4
2026-10-09 14:46:17 +02:00
BaaRai d3e6f4167e Fix credentials UI regression from #4
The test accounts section was mounted after the scrollable field area
of the New task sheet, so it sat pinned under the scrollbar instead of
scrolling with the other fields, and its Add account button floated in
a header row instead of sitting in the field content like Add row.

Move it inside the scroll container as a proper Field with the add
button below the rows, matching the intercept rules editor pattern.
Also place the credentials TabsContent after assets in the task detail
page to match the TABS array order and use the local id variable.
2026-10-09 14:45:52 +02:00
BaaRai 6c7169565b Merge pull request #4 from BaaRai/feat/task-credentials
feat(tasks): per-task test-account credentials
2026-10-09 14:34:15 +02:00
BaaRai c177ab9d86 feat(tasks): per-task test-account credentials
Task credentials (#3): declare test accounts at task creation, and never
lose the accounts the agent registers on its own.

- task_credentials table (unique per task+domain+username; upsert
  overwrites the password in place), idempotent schema migration
- POST /api/tasks accepts credentials; GET/POST/DELETE
  /api/tasks/{id}/credentials serve the UI (manual add, e.g. relaying an
  OTP-verified account; delete)
- empty password = the "agent generates" mode: the entry surfaces in the
  worker's graph overview with an explicit instruction to register that
  account with a strong password and record it
- new tools save_task_credential / list_task_credentials for worker and
  pentest; the graph overview injects the task's credentials each round
  with a standing note: reuse matching entries, always record accounts
  you register
- New Task dialog: optional credentials section (domain, username,
  password, note) with a dedicated-test-accounts hint
- task detail: Credentials tab, passwords masked with explicit
  reveal/copy, agent-recorded badge, light polling so mid-run recordings
  appear

One-shot binding migration (settings-flag-guarded, same pattern as the
other seeds) grants the two tools to worker+pentest on databases seeded
before this change; fresh DBs get them via WorkerTools()/the pentest
catalog.

Closes #3
2026-10-09 14:28:08 +02:00
BaaRai b28829e36d Merge pull request #2 from BaaRai/fix/pause-preserves-timeout-budget
fix(tasks): freeze the timeout budget while a task is paused
2026-10-09 11:46:18 +02:00
BaaRai 353a947285 fix(tasks): freeze the timeout budget while a task is paused
deadline_at is a wall-clock timestamp, so pause time counted against the
task timeout: pausing overnight (or shutting the machine down while
paused) made the deadline ring while parked, and resuming landed
straight into the settle sequence and a timeout terminal state.

ApplyTaskPause now stamps paused_at, and ApplyTaskAdmission credits the
paused interval back onto deadline_at in the same atomic UPDATE that
ends the pause (paused_at is cleared there too). The shifted deadline
flows to the live handle via the existing RETURNING mirror, so the
engine clock context picks it up. Matches the re-basing the
archive-restore path already did for paused tasks.

Migration is an idempotent ADD COLUMN; tasks paused before the upgrade
have no paused_at and keep the old behavior.

Fixes #1
2026-10-09 11:37:30 +02:00
BaaRai 0aa837149d README: note this is a private English fork of Autumn-27's ARTEX 2026-10-08 23:22:05 +02:00
BaaRai e233c02314 Translate all Chinese text to English
Comments, doc comments, UI labels, log and error messages, LLM prompt
strings, markdown docs, test data and assertions. Identifiers, enum
keys, routes, placeholders and code structure are unchanged.

Notes:
- docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md
- tests that exercised CJK specific handling (GBK zip names, Chinese
  full text search) now use ASCII equivalents; go build passes and the
  test suite matches the pre translation baseline (remaining failures
  need a PostgreSQL DSN and fail identically on the original)
- frontend mention syntax now uses English kinds (finding, asset, ...)
  matching the backend, chat mentions tests pass
2026-10-08 23:14:34 +02:00
Autumn-27 d1196853dc docs(changelog): 定版 0.3.15 2026-10-07 08:54:02 -04:00
Autumn bd4a6e31e8 Merge pull request #197 from Autumn-27/fix/auth-init-fail-open
fix: 密码初始化/登录接口在数据库读失败时 fail closed
2026-10-07 19:47:48 +08:00
Autumn-27 66b7006c69 fix bug 2026-10-07 07:45:28 -04:00
Autumn f4aea9859d Merge pull request #191 from Autumn-27/feat/judge-token-usage
feat(intercept): 模型兜底审批单独计量 token 并在配置页展示
2026-10-04 14:43:54 +08:00
Autumn-27 8bc4d58c85 feat(intercept): 模型兜底审批单独计量 token 并在配置页展示
兜底审批(LLM judge)调模型判定漏网命令,其 token 消耗此前无法单独查看:
usage 行要么无 worker 归属、要么被并进复用的模型 profile 桶里。

- llmrec 增加 WithWorker 上下文覆盖,reviewer 调用前标注 worker='judge',
  让审批调用的计量行可被单独筛出(复用现有 llm_usage.worker 列,无需迁移)。
- db.JudgeUsageStats 返回累计总量 + 近 N 天每日序列(WHERE worker='judge')。
- 新增 GET /api/intercept/judge/usage。
- 配置页「模型兜底审批」开关下方新增用量卡片:调用次数 / 输入 / 输出 /
  缓存读写 五项统计 + 近 30 天每日消耗迷你柱图 + 刷新。
2026-10-04 02:43:26 -04:00
Autumn 2bd1dab7c7 Merge pull request #189 from Autumn-27/fix/sse-same-origin
fix(web): SSE 活动流默认同源,修复反代部署连不上 :8787
2026-10-03 08:10:35 +08:00
Autumn-27 6239c46c12 fix(web): SSE 活动流默认同源,修复反代部署连不上 :8787
sseUrl() 原先无条件把 SSE 地址拼成 ${hostname}:8787,连生产静态导出
也带这个硬编码。反代到 443 的部署里页面从 https://域名/ 加载,SSE 却被
指向 https://域名:8787/...,而 8787 未对公网开放,导致活动流连不上、反复重连。

改为用 NODE_ENV 区分:生产默认同源(相对路径),仅 next dev 保留 :8787
以绕过 Next.js /api 反代对 SSE 的缓冲。NEXT_PUBLIC_SSE_BASE 覆盖口保留。
验证:NEXT_EXPORT=1 next build 后生产包里 :8787 分支已被 tree-shake。

补充 README 反向代理部署文档(同源说明 + nginx 关缓冲配置)。

Closes #169
2026-10-02 20:10:08 -04:00
Autumn 9ff7e6f5e4 Merge pull request #187 from Autumn-27/fix/notify-digest-and-mask
fix(notify): 汇总模式退化、目的地留空误判、SMTP 缺 SSRF 守卫
2026-10-01 19:00:43 +08:00
Autumn 82a2567cec Merge pull request #185 from lucksec/feat/vuln-im-push
feat(notify): 漏洞发现支持推送到钉钉/飞书/企业微信等六种渠道
2026-10-01 18:58:50 +08:00
Autumn-27 4c8273d9f8 fix(notify): 邮件渠道的 SMTP 拨号补上 SSRF 守卫
emailDial 用的是裸 net.Dialer,没挂 blockInternalDial,Validate 也只检查
host 非空。于是 SMTP 是整套 SSRF 防护里唯一的缺口:host 填 169.254.169.254
或 127.0.0.1 能直接连上,而 smtp.NewClient 握手失败时会把对端返回的那一行
(textproto 的 short response)包进错误、经 last_error 由投递历史接口回显,
正是其它渠道已经关掉的半盲读原语;「连接被拒 vs 超时」的耗时差异还能
用来探测端口。

拨号阶段是最终生效点,也覆盖 DNS 重绑定,与 HTTP 系渠道共用同一道守卫。
RFC1918 私网继续放行,与 isBlockedDialIP 既有的取舍一致——内网自建 SMTP
中继是常见的合法部署。

这个缺口没有测试会发现:本包 TestMain 全局打开了 ARTEX_NOTIFY_ALLOW_LOCAL,
邮件用例无论守卫在不在都会通过。新增的两条用例自己清掉该变量,
并配一条反向用例确认显式放开后本机 SMTP 仍可投递。
2026-10-01 06:43:48 -04:00
Autumn-27 b658591f06 fix(notify): 目的地字段留空不应被判成地址变更
Telegram 渠道从第二次保存起会永久失败,用户什么都没改也存不上:

  新建时 base_url 留空(用官方 API 地址),创建路径直接存下 base_url:""
  → 第一次保存,MergeConfig 把空串当显式清空、delete 掉该键
  → 第二次保存,前端照常提交 base_url:"",而 stored 里已经没这个键
  → sameConfigValue("", nil) 比较 `""` 与 `null`,判为不等 → changed=[base_url]
  → bot_token 是掩码回显值 → 400「目标地址已变更,请同时重新填写凭据字段」

此后每次保存都失败,除非重新粘贴一遍 Bot Token,而错误提示还把人
往「凭据有问题」上引。

根因是 MergeConfig 与 sameConfigValue 对「空」的口径不一致:前者认为
空串就是「该删掉这个键」,后者认为 "" 与键不存在是两个不同的值。
现在比较前先归一化,口径与 MergeConfig 的清空判定对齐。

这是上一轮修「改目标地址、保留凭据」那条凭据外发路径时引入的回归——
守卫本身是对的,只是把一个没变的空字段误判成了地址变更。配套用例覆盖了
两个方向的真实变更(空→自建反代、自建反代→空)仍必须要求重填 Token,
确认防护没有被削弱。
2026-10-01 06:43:48 -04:00
Autumn-27 9b88c55af0 fix(notify): 汇总模式按消息计量限流,批次大小不再被每轮请求预算掐死
令牌桶的额度此前被同时当成两个量纲用:对实时模式它是「发几条消息」,
对汇总模式却被直接当成「一批装几条漏洞」传给 ClaimDigestBatch。

notifyMaxSendsPerChannelPerTick(=5)是由租约时长倒推的 HTTP 请求预算,
而一个汇总批次只发一次请求,两者本不该相乘。稳态下更糟:rate_per_min=20
的渠道在 3 秒的 tick 里只补得到 1 个令牌,于是每条汇总消息只装 1 个漏洞,
头部还写着「近 30 分钟新增 1 个漏洞」——digest 退化成带汇总文案的实时推送,
MaxDigestBatchSize(500) 永不可达。

改为统一按**消息条数**计量:一批漏洞合成一条消息、消耗一个令牌,
rate_per_min 对 digest 依然生效(每分钟最多这么多条汇总消息),
而批次大小只受 MaxDigestBatchSize 这个内存上界约束。

ClaimDigestBatch 原先的注释声称「单批同时受限流额度与内存上界约束」,
那正是本问题的来源——限流额度本不该充当批次大小。注释一并改掉,
免得下次又按「rate_per_min 对 digest 不生效」把它改回去。

顺带让 takeTokens 接受 want 上限:原先整桶抽空后才由调用方截断,
多出来的令牌(飞书默认 100/min 时是 95 个)直接丢弃,渠道这一轮
没有待发投递时也照扣,注释声称的突发容量在任何情况下都做不到。

决策收在 digestTickPlan 里由新增用例直接钉住。现有端到端用例都手动给
stepDigest 传一个够大的 limit,绕过了 step 里的额度计算,所以覆盖不到这里。
2026-10-01 06:43:29 -04:00
luckoneandClaude Code ee383aa1a9 fix(notify): 复测判定「已修复」时也要推送状态变更
复测结论为 fixed 时,db/finding_retests.go 里是裸的
`UPDATE findings SET status=...`,绕过了带通知的版本——于是配了
on_status_change 的渠道对这种状态流转完全收不到推送:状态在界面上悄悄变了,
运维要打开平台才知道。

把「更新状态 + 登记状态变更事件」抽成事务级的 SetFindingStatusTx,供
patchFinding 与复测路径共用,两者的语义(状态没变就不登记、快照带全渲染字段)
由同一份代码保证,不会再出现只改一处的情况。

附回归用例:复测判 fixed 后必须有一条 finding_status_changed 事件,
且快照里的 from/to 与渲染字段正确。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 16:25:06 +08:00
luckoneandClaude Code 311d9d85cf refactor(web): 通知页拆分为组件,1095 行降到 605 行
页面此前接近 1100 行,超过 CLAUDE.md 的 800 行硬上限。按项目的 _components/
约定拆开,每个文件都能单独读懂:

  _components/channel-fields.ts   渠道字段表与配置值解析(纯数据,无视图)
  _components/channel-form.tsx    按字段定义渲染控件的表单
  _components/delivery-list.tsx   投递记录表与筛选
  _components/stat-tile.tsx       概览统计卡片
  page.tsx                        只负责编排:加载、表单状态、调接口

拆分是纯模块搬移,未改行为;tsc 与 next build 均通过,/system/notify 仍正常
预渲染。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 16:25:06 +08:00
luckoneandClaude Code 765c0e99e3 fix(notify): 安全审计修复 —— 掩码绕过、SSRF、静默丢失等 12 项
对推送功能做了一轮安全审计,每条都先复现、再修、再补回归测试。
以下按严重程度排列。

【严重】掩码可被「改目标地址、保留凭据」绕过
目标地址与凭据是两套独立字段,而配置合并对「未提及的键」保留原值。于是
只改地址、对凭据避而不谈,服务端就会把库里的真凭据发到任意地址。已实测
复现四个渠道:通用 Webhook 的 Authorization 头、Telegram 的 Bot Token
(进请求路径)、邮件的 SMTP 密码(STARTTLS 后交给对端)、钉钉/飞书的加签
密钥(该项不可利用,一并列出仅为说明面)。完全静默、不依赖重定向,所以
上一轮加的「拒绝跨主机跳转」挡不住它。

修法:新增 Channel.DestinationKeys() 声明「消息发往哪」,PrepareConfigUpdate
在地址变化时要求对**每一个**凭据字段显式表态(给新值,或显式留空表示不再
需要)——原样回传掩码值等于「沿用旧凭据」,正是攻击形状,一并拒绝。
刻意不做「自动丢弃凭据」:对可选字段(如 headers)那会变成「鉴权静默没了
但接口返回成功」,比报错更难排查。

【中】markdown 系三渠道对不可信内容零转义
钉钉/企微/飞书此前完全不转义(Telegram 与邮件都做了),而标题与摘要来自
模型输出、资产 url 来自被测目标。一条标题里的 `[文字](http://evil)` 会在
工程师的钉钉里变成可点击外链;`![](http://evil/beacon)` 会被客户端拉取,
泄露阅读者 IP 并暴露「这条已被看过」。现统一单行化 + markdown 元字符转义。

修的过程中还纠了自己一个设计错误:转义一度被放进 markdownTitle,而它被
markdown 正文、Telegram 的 HTML、飞书卡片、Webhook 的 JSON 与邮件主题四种
语境共用,markdown 的反斜杠泄漏到了 Telegram 消息里(用户会看到 `\(1\)`)。
转义必须发生在各自的渲染出口——测试直接抓到了这个回归。

【中】投递地址的 SSRF 面
此前只校验 scheme 与 host,云元数据 169.254.169.254、环回、内网一律可投递;
而失败响应体前 200 字节会进 last_error 并被投递历史接口回显,构成半盲读
原语。现在在**拨号阶段**设防(最终生效点,同时覆盖 DNS 重绑定与同主机
重定向)。环回/链路本地需显式 ARTEX_NOTIFY_ALLOW_LOCAL=1 才放行(本机
SMTP 中继是合法配置);RFC1918 私网**刻意放行**——内网自建 Mattermost /
SMTP 很常见,做到那个程度会把正常部署一起废掉,这条取舍写进了测试断言。

【中】汇总消息被截断后整批标记已送达 = 静默丢失
渠道都有长度上限(企微 4096 字节最紧)。此前渲染完整篇再截断、然后整批
标记成功:被截掉的那些既不在消息里、也不在失败列表里,投递历史还显示
成功。现改为按**整条**打包,只标记真正装下的,其余回队续发,消息头部
如实写明还有多少条在下一条。被推迟的条目**不消耗重试次数**(领取时乐观
+1 的那次减回去),否则 500 条的积压会在第三段就把尾部判成失败。

【中】其余修复
- min_severity 打错字让过滤器静默失效(未知级别序数为 0 → rank>=0 恒真,
  用户以为「仅高危」实际全推)。改为写入时校验取值。
- rate_per_min=0(不限流)不可达:文档/UI/令牌桶都按 0=不限流解释,唯独
  写库那层 `if <=0 取默认值` 把它改成 20 或 100。默认值改到接口层填。
- digest 渠道完全绕过令牌桶(allow 被扣却没人用)。
- 失败处置按整批 max(attempts) 判断,让老投递连坐同批的新投递。
- 汇总批次里快照无法解析的投递被静默标记成功。
- url.Parse 失败时错误文本仍带完整地址(上一轮只修了 http.Client.Do 那侧;
  且当时的用例全走 scheme 分支、没覆盖解析失败路径,是假保证)。
- 单渠道每轮投递条数可能超出租约时长(多实例下重复发送)。加了防漂移
  断言,写的时候立刻发现原取值 6 恰好用满租约、零余量,已改 5。
- Telegram 截断可能切断 HTML 实体,导致整条被拒收。
- 邮件把 SMTP 4xx(灰名单等临时失败)判成永久失败,最该重试的场景从不重试。
- 提交嵌套结构时会把掩码字面量真的写进库,导致鉴权静默失效。

测试:notify 包从 82% 提到 86%,新增 SSRF 守卫、掩码绕过(用攻击形状的
输入而非「防御逻辑的正确输入」)、分段投递收敛、markdown 转义、SMTP 4xx/5xx
分类等回归用例;端到端补了一条「60 条长标题跨多轮发完且不卡死」的收敛测试。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 16:25:06 +08:00