Skip to content

[PR] test: threads-lane fake upstream strictification + side-call 404 contract (#3617 B) | test: threads-lane 假上游严格化 + side-call 404 契约(#3617 B) - #3627

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-18_strict-fake-upstream
Oct 18, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-18_strict-fake-upstream

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: vllm-qwen/qwen3.8-27b)

Part of #3617 item B(fake upstream 严格模式)。纯测试 PR,无源码改动。

背景

#3569:threads lane 的 summary side-call 打到了裸 origin(没有路径),生产 anthropic 恒 404——但 tests/threads-lane.test.ts 的假上游对任何 url 都回 200,side-call 在测试里永远「成功」,于是带病发版。这就是 #3617 说的「假绿绝根」对象。

改动

  1. 假上游严格化:未知路径现在回真实的 anthropic 形 404(not_found_error),只有 POST /v1/messages 应答。路径回归一旦复发:side-call 拿到真 404 → fail-open → reforge 断言(SUMMARY head 缺失 → 没有 reforged create)和 forwardedPaths 钉点同时红。
  2. 新增 404 契约测试:harness 加 sideCallFailStatus(默认仍 500,既有用例不动),新用例按 [Bug][threads lane] reforge summary side-call always 404s: executeThreadsReforge receives the upstream origin instead of /v1/messages, compression never completes (0.1.198) | [Bug][threads lane] reforge 摘要 side-call 恒 404:executeThreadsReforge 收到的是上游 origin 而非 /v1/messages,压缩从未完成(0.1.198) #3569 的生产签名(404 not_found_error)验证:side-call 失败后 continue 原样转发(fail-open)+ 冷却期内不重传(cooldown,与既有 500 用例同纪律)。

范围说明

#3617-B 说「逐个 fake 迁移,不需要一次全改」。本 PR 迁的是造成 #3569 假绿的那个 fake;两个共享 e2e fake(tests/e2e/fake-upstream.mjs、fake-upstream-chat.mjs)核查过已经是严格的(未知路径 404)。其余单测内联 fake 的迁移留作后续(可按同样模式逐个做)。

验证

  • 本地:node --import tsx --test tests/threads-lane.test.ts → 10/10 通过(9 既有 + 1 新);
  • 本地 npm run typecheck 干净;
  • 全量回归以 CI 为准。

Closes 无——本 PR 是 #3617 六项之一,issue 待六项全部合入后关闭。

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-18_strict-fake-upstream (6920b18)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4272-pr.3627.47351f7

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3627.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复——本 PR 是 #3617 六项中的 B(threads-lane 假上游严格化 + side-call 404 契约);同 issue 的兄弟 PR A(#3620)、D(#3625)、F(#3626)各管各的条目,open/closed 检索无同签名(threads-lane fake strict / sideCallFailStatus)条目。

初审发现一个必须先处理的问题:基线落后(stale base)。分支从 fd3232fae 切出,之后 master 又合入了 #3618(#3616 dsh attach origin-generation 修复)和 #2950(#2948 persona-lineage ref-guard 修复)。GitHub 上 master→PR 的净 diff 因此把这两个已合入的修复显示成「删除」(src/agent/dsh-native.ts -40、src/plugin.ts -27、tests/issue2948-aux-lane-lineage-guard.test.ts 整文件 -200)——看起来像回滚两个 shipped fix,实际是基线漂移,本 PR 并没有动过它们。PR 的真实内容只有 tests/threads-lane.test.ts(+45/-4),与「纯测试 PR」声明一致。

按 §7.2(rebase 到当前 master 再谈 mergeable):我现在把分支 rebase 到 07501b353 并推回,让净 diff 收敛到单文件、CI 在最新 master 上重跑;同时对测试内容做完整审查(严格化是否真能钉住 #3569 的生产签名、新 404 用例断言是否有牙)。稍后给结构化八问结论。

…act (#3617-B)

The threads-lane test fake answered 200 for ANY request url — the exact permissiveness that let #3569 (summary side-call sent to the bare origin, permanent 404 in production) ship green: the side-call 'succeeded' in every test while failing forever in prod. Two changes:\n\n1. Strict mode: unknown paths now get a real anthropic-shaped 404 (not_found_error); only POST /v1/messages answers. A wrong-path side-call regression now lands as a genuine failure — both the forwardedPaths pin (#3569 assert) and the dependent reforge asserts (no SUMMARY head → no reforged create) go red.\n2. New contract test for the #3569 production signature: the side-call receives 404 (harness gains sideCallFailStatus, default stays 500) → the lane must fail open (client continue forwarded untouched) AND cool down (no doomed retry re-uploading the transcript), same discipline as the existing 500 cooldown test.\n\nFirst of the incremental fake-strictness migration proposed in #3617-B ('逐个 fake 迁移'); the shared e2e fakes (fake-upstream.mjs / fake-upstream-chat.mjs) are already strict. Test-only.
@ranxianglei
ranxianglei force-pushed the 2026-10-18_strict-fake-upstream branch from d7668e7 to 6920b18 Compare October 17, 2026 18:53
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审核完成,结论:可合。 过程中发现并处理了一个基线问题(见下),rebase 后全量 CI 已绿。

处理过程

结构化八问

  1. 是什么问题:threads-lane 单测的假上游对任何路径都回 200,[Bug][threads lane] reforge summary side-call always 404s: executeThreadsReforge receives the upstream origin instead of /v1/messages, compression never completes (0.1.198) | [Bug][threads lane] reforge 摘要 side-call 恒 404:executeThreadsReforge 收到的是上游 origin 而非 /v1/messages,压缩从未完成(0.1.198) #3569(side-call 打到裸 origin、生产恒 404)因此在测试里永远「成功」、带病发版;Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617-B 要求把这个假绿绝根。
  2. 什么原因导致的:permissive fake 缺生产语义——真实 anthropic 对未知路径回 not_found_error,fake 没有这层校验,路径回归在测试层不可见。
  3. 影响范围与严重程度:仅测试层,零生产行为变化。修的是盲区本身:此前该类回归(打错路径)必绿必漏,此后在测试层即红。
  4. 怎么修复的:① fake 默认严格化——未知路径回 anthropic 形 404,只有 POST /v1/messages 应答,forwardedPaths 记录每个请求的路径(剥 query);② harness 加 sideCallFailStatus(默认仍 500,既有用例零改动),新用例按 [Bug][threads lane] reforge summary side-call always 404s: executeThreadsReforge receives the upstream origin instead of /v1/messages, compression never completes (0.1.198) | [Bug][threads lane] reforge 摘要 side-call 恒 404:executeThreadsReforge 收到的是上游 origin 而非 /v1/messages,压缩从未完成(0.1.198) #3569 生产签名(404 not_found_error)验证 fail-open(continue 原样转发)+ 冷却期不重传,与既有 500 用例同纪律。断言有牙:fail-open 破→状态码/thread.type/消息数红;冷却破→计数红。
  5. 是否有回归问题:无。逐项过:源码零改动;唯一行为变化是 fake 变严,本文件全部合法流量走 /v1/messages(9 个既有用例严格化后全绿);forwardedPaths 记录时机前移(解析前、剥 query)不影响既有钉点,反而使其有真 404 背书。无语义漂移/fail-fast 变吞错/阈值时序输出格式漂移。diff 整洁度:单文件、每行与目的相关,命名注释符合仓库惯例,无死代码。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重键逻辑)。
  7. 是否改了设计方向:不涉及。按 Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617-B「逐个 fake 迁移」只迁了造成 [Bug][threads lane] reforge summary side-call always 404s: executeThreadsReforge receives the upstream origin instead of /v1/messages, compression never completes (0.1.198) | [Bug][threads lane] reforge 摘要 side-call 恒 404:executeThreadsReforge 收到的是上游 origin 而非 /v1/messages,压缩从未完成(0.1.198) #3569 假绿的这一个;两个共享 e2e fake 已核查本就是严格的,其余内联 fake 后续按同模式逐个做。
  8. 是否引入了新的配置:无(sideCallFailStatus 是测试 harness 参数,非运行时 config/env)。

合并判定:可合。我无权合 PR,请自行合并:#3627

@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.552-master.c987c60 (rolling master tag).

npm install -g billion-context@0.0.552-master.c987c60  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant