Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/fixtures/pelican-question-e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN mkdir -p /opt/fixture/tls && \
chmod 644 /opt/fixture/tls/key.pem
COPY scripts/pelican-question-e2e.mjs /opt/fixture/pelican-question-e2e.mjs
COPY scripts/pelican-detail-identity.mjs /opt/fixture/pelican-detail-identity.mjs
COPY scripts/pelican-nominal-round.mjs /opt/fixture/pelican-nominal-round.mjs
COPY scripts/pelican-complete-rounds.mjs /opt/fixture/pelican-complete-rounds.mjs
ENV NODE_EXTRA_CA_CERTS=/opt/fixture/tls/cert.pem
ENTRYPOINT ["node", "/opt/fixture/pelican-question-e2e.mjs"]

Expand Down
30 changes: 17 additions & 13 deletions .github/fixtures/pelican-question-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Refs #795。本目录只提供 CI fixture,不修改应用业务代码,不表示完整验收、真实模型兼容性或经验难度校准完成。逐场景状态由 `acceptance.json` 声明;脚本即使成功,也固定输出 `full_acceptance_complete: false`。

PR #832 独审 P2 仍为 **BLOCKED**,直到修正后候选的远程证据取得。`pelican-detail-identity.mjs` 按请求 URL 选 PG 行,逐条校验 URL result/plan、响应体 id/plan、PG id/plan 和 marker;账号窗口在所有详情响应通过后才以该请求绑定选卡与命名截图,产物保留 `request_binding`。分组 URL 只有 result ID,因此明确校验 URL result=body id=PG id,以及 body plan=PG plan,不虚构 URL plan。远程工作流先运行无网络/API替换的 `node:test` 合成门禁,要求同计划 R1/R2 整包交换两个方向均被拒绝,另验正常乱序和错误 plan/样本内容;保存 `detail-identity-synthetic.tap`。合成门禁不替代真实应用 E2E,未在本机执行。
PR #832 的六个真实成功结果和请求身份门禁已由父级接受,仅代表该增量。当前 successor 从 `dfc0219a9e66a19642eb73875e4914e540b49575` 开始,保留原有场景,再增加同账号/分组计划的第二 nominal round;待当前 head 的远程运行证据,不能用旧 SHA 的成功代替。`pelican-detail-identity.mjs` 按真实请求 URL 将响应绑定到 PG result/plan,拒绝整包交换。独立合成门禁与真实应用结果分开记录。

第二轮只根据源码 `pelican_questions.go` 的 bank version、SHA256 前八字节 big-endian 与 modulo 公式选择已到期且题目不同的微秒时间,写入 fixture 计划的 `next_run_at`。不注入题目、不修改抽题算法,不保证普通随机轮次必不重复。远程 oracle 回归另以 #832 两份真实 PG 问题身份校验公式。真实 RunDue/Claim 的持有租约、Finish 释放、last_run_at 和已推进 next_run_at 均读取限定投影;旧/新结果按各自冻结快照关联 provider marker、API 请求 URL 和真实 DOM。
## 本增量的运行链

GitHub `pull_request`(base 为 `production`,包含 fixture/script/workflow 变动)即可触发本分支新工作流,Draft 不跳过。`workflow_dispatch` 只是工作流进入默认分支后的备用入口,不能假定新分支已经可 dispatch。父协调者负责 publication 和精确 head/check 回读。
Expand All @@ -20,25 +21,28 @@ GitHub `pull_request`(base 为 `production`,包含 fixture/script/workflow

分组定时阶段复用先前真实创建的禁用计划:经真实编辑表单设置年周期 Cron,等计划行显示新 Cron 后点击 Enable。以实际 PUT 响应、启用后的 DOM 和限定 PG 规则投影对账,然后仅对这个 fixture plan/group 更新一次 `next_run_at`。仍等待真实分钟 tick/RunDue/Claim,并复用 provider 最多30秒的回复等待来观察有效运行租约、推进后的到期时间及两份真实请求;释放回复后要求两份真实 PG 结果和成功轮次的 lease 完成。每份结果按实际 `account_id` 与 capture alias 对账,允许两份都选中 A 或 B,不断言路由均匀。

页面保持在真实 `PelicanTestsView`,等待其15秒轮询取得本轮 list,随后点击按 result ID 标记的行,监听实际 detail 响应,核对组名、模型、实际账号、成功状态、展开的 question/actual_prompt 和 iframe marker。按 group plan/result ID 保存截图与受限投影。不写结果、调用 `/run` 或注入 auth/store;这个分组的首次 nominal T 不是同一计划的第二轮 T2。CI 浏览器总等待上限为660秒,job仍为45分钟;本轮新代码未远程验证。
页面保持在真实 `PelicanTestsView`,等待其15秒轮询取得本轮 list,随后点击按 result ID 标记的行,监听实际 detail 响应,核对组名、模型、实际账号、成功状态、展开的 question/actual_prompt 和 iframe marker。按 group plan/result ID 保存截图与受限投影。不写结果、调用 `/run` 或注入 auth/store;这个分组的首次 nominal T 不是同一计划的第二轮 T2。CI 浏览器总等待上限为1080秒,job仍为45分钟;本轮新代码未远程验证。

## HTTPS fixture 与原 HTTP 建议的差异

当前 `AccountTestService.validateUpstreamBaseURL` 在白名单启用时调用 `ValidateHTTPSURL`,不会读取 `allow_insecure_http` 来放行 HTTP。为保持真实校验启用,fixture 使用 `https://fake-upstream:4199`,临时生成仅含 fixture SAN 的证书,并仅在 CI fixture 镜像中加入该 CA。所有三类 URL host 白名单只列 `fake-upstream`,允许隔离私网,保持 HTTP 禁止。未关闭 TLS 校验、白名单或改动业务代码。该选择与 audit 中的 `http://` 提议不同,须在独审中确认;它不改变任何生产配置。

假上游只接受模型发现和 messages SSE,额外的健康、去认证 capture 读取及单次 refusal 控制端点仅供 fixture。可选 pricing 刷新明确返回 503,真实应用使用打包的 fallback 文件;未知路径/输入记录为拒绝并使浏览器验收失败。网页本身仅允许 app origin;provider 只能由应用调用,Node fixture 控制读取不伪装成浏览器请求。主防外呼边界是所有运行容器的 Docker internal 网络,虚构 key 不是防外呼措施。

## 未完成的完整验收范围

- [ ] 远程验收上述已实现的 A/B 随机定时 UI 创建、同一 T、真实 Claim 和四份 PG/provider/API/DOM 对账;静态实现不等于通过。
- [ ] 远程验收已实现的分组 UI 启用、真实 RunDue/Claim、成功轮次 lease 完成、PG/provider/list/detail/真实 DOM 对账;不假设分组均匀路由 A/B。
- [ ] 经真实浏览器编辑计划后,旧 PG/API/UI 快照保持不变。
- [ ] 第二 nominal time T2 按现有哈希公式选到另一题,等待真实 tick,新旧记录共存;不能修改生产抽题算法。
- [ ] arm 单次 refusal 后真正产生 failed 持久化结果、失败历史及 lease 释放;现有 refusal server 能力尚未被此增量测试。
- [ ] 失败场景的结果/租约/到期字段限定投影及关联。账号与分组成功轮次已编写限定投影,但尚待各自实际候选的远程证据。
- #809 已合并;本 successor 的远程 Actions、失败记录及当前 head 检查结论由父级发布后补录,以当前候选 artifact 为准。没有运行本地动态检查。
- [ ] 隔离链路真实截图上传 PR 原生附件并回读;现有组件 job 截图仍只是组件证据,不能混同此 job。无 PNG 提交到源码。
- [ ] 父协调者独审、完整技术验收与产品/经验难度证据。fixture 的简单 SVG 不代表题目作答合格或难度相当。
## Successor 的编辑、失败和恢复门禁(待本 head 远程运行)

同计划 T2 后,通过实际账号 Scheduled tests 编辑表单与分组编辑表单,将随机规则改为不同的 custom prompt、样本数改为1。核对 PUT、PG,刷新页面后读取真实 list API,再打开编辑器核对保存值。原计划的 last_run_at 不应被 UI 编辑改写,账号 B 的计划应保持不变。再次打开旧历史,逐条按原 PG result/plan、请求 URL、provider marker 校验旧题目、版本、actual_prompt、样本数和 DOM;不使用当前计划覆盖旧结果。随后经同一真实表单恢复 random 模式,保留新样本数。

账号和分组各运行一次确定 refusal,再各运行一个有效 nominal round。refusal 是实际假提供商 SSE 的 stop_reason=refusal/category,附带唯一 partial-output marker;它是真实 service 的模型输出失败,不是编译 RED、网络拦截或预先写入的 failed 行。账号 A/B 并发时只拒绝一个实际到达的请求,不预设到达顺序或拒绝账号;按 marker/alias 精确绑定实际失败样本。分组拒绝应保留失败答案而不 failover。每轮都观察 Claim、原 last_run_at 保持、Finish 释放、last_run_at 前进及 next_run_at 已推进,检查旧结果不变。

账号失败卡片通过真实 history/detail 展开,核对冻结快照与失败文本。分组原 UI 失败行没有 preview 按钮,仅从实际 list 请求核对 snapshot/身份,并核对 DOM failed/error;不伪造该 UI 不提供的 detail 请求或失败快照 DOM。下一有效轮次要求相同计划再次实际执行成功并保留之前失败历史。

## 剩余验收

- [ ] 当前 successor exact-head 的远程原始日志、每个 attempt、真实 PG/provider/API/DOM 产物;静态实现不是通过,#832 六份结果也不替代本轮。
- [ ] 下载并检查当前真实渲染截图,原生附件上传/字节回读(可用时);无 PNG 入源码。
- [ ] 父级独立冻结 diff 复审及全部检查验收。
- [ ] 原始产品/完整题库判据和专家或经验难度可比性。没有实际模型调用,fixture SVG 只证明工程链路,`full_acceptance_complete:false` 保留。

## 证据与清理

Expand Down
24 changes: 12 additions & 12 deletions .github/fixtures/pelican-question-e2e/acceptance.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"scope": "manual-account-and-group-scheduled-increment",
"scope": "issue795-successor-complete-engineering-rounds",
"full_acceptance_complete": false,
"review_P2_identity_gate": "BLOCKED pending remote synthetic whole-response swap rejection evidence and real account/group E2E at the corrected head; static diff is not acceptance",
"unimplemented": [
"plan UI edit followed by proof old stored/API/DOM snapshot is unchanged",
"second nominal time mapped to a different question, new and old scheduled records coexist",
"deterministic upstream refusal yields failed persisted history and released lease",
"failed-result/lease SQL projections linked to captures and API IDs"
],
"review_P2_identity_gate": "Prior PR832 exact cb54990 accepted by parent; successor requires its own exact-head remote artifacts. Pure identity tests are not business proof.",
"unimplemented": [],
"pending_external_gates": [
"remote execution and exact PR head checks for account and group scheduled scenarios; prior SHA or component-only success is not their validation",
"screenshots from successful isolated chain uploaded as PR native attachments and read back",
"product policy and empirical difficulty calibration; fixture output cannot prove either"
"current successor exact-head remote execution and raw attempt logs for all added engineering gates; earlier SHA success is insufficient",
"current CI captures downloaded and inspected, PR native attachments with byte readback if upload is available",
"parent independent frozen-diff review and all-check acceptance",
"original product policy, complete question-bank criteria and expert/empirical difficulty acceptance; no actual model calls or quality equivalence inferred"
],
"fixture_transport_difference": "Uses fixture-only HTTPS and an ephemeral fixture CA, because the enabled real account-test URL allowlist calls ValidateHTTPSURL. The audit's proposed HTTP URL is not accepted with that allowlist enabled. No application validation is disabled or modified.",
"implemented_scenarios": [
Expand All @@ -29,7 +25,11 @@
"restricted account plan/result/due/active-lease projections; no result writes and no manual /run substitutes",
"existing disabled group plan configured and enabled through actual PelicanTestsView UI; only its fixture next_run_at aligned via SQL",
"actual group RunDue/Claim observed with two held provider replies, two persisted results and successful-run lease completion",
"group plan/result IDs and actual selected accounts correlated across restricted PG projection, provider captures, real page list/detail API responses, DOM rows, expanded snapshots and iframe markers; no equal account routing assumption"
"group plan/result IDs and actual selected accounts correlated across restricted PG projection, provider captures, real page list/detail API responses, DOM rows, expanded snapshots and iframe markers; no equal account routing assumption",
"same account A/B plans second nominal RunDue with a deterministically different question; original and second PG/provider/API/request-bound DOM histories coexist",
"same group plan second nominal RunDue with a deterministically different question; original and second PG/provider/API/request-bound DOM histories coexist",
"real account and group UI edits random to distinct custom prompts and one sample, update response/PG/reloaded list/reopened editor persistence; all previously saved PG/API/DOM snapshots unchanged",
"random mode restored through real UI; deterministic single provider refusal persists failed result with unique partial-output marker and exact frozen snapshot, UI failure history, released leases; same account/group plans execute next valid nominal RunDue"
],
"verification_evidence": "Read scenario-results.json and the current PR head checks; this declaration does not assert runtime success."
}
16 changes: 16 additions & 0 deletions .github/fixtures/pelican-question-e2e/detail-identity.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ test('account: wrong request plan is rejected even when the body matches a PG ro
assert.throws(() => bindDetailResponse(url('account', '101', '8'), bodies[0], rows),
/request plan ID must equal PG plan ID/)
})

for (const kind of ['account', 'group']) {
test(`${kind}: old result IDs and marker cannot relabel the saved snapshot with the current rule or next round`, () => {
const changed = { ...bodies[0], pelican_config: { parallel_count: 1, prompt_mode: 'custom',
actual_prompt: 'edited current rule', pelican_question: { round_id: 'scheduled:next', id: 'different-question' } } }
assert.throws(() => bindDetailResponse(url(kind, '101'), changed, rows, kind), assert.AssertionError)
})
test(`${kind}: refusal keeps its own failed identity and partial-output marker`, () => {
const failed = { ...rows[0], status: 'failed' }
const body = { ...bodies[0], status: 'failed', response_text: `${failed.marker}: fixture refusal` }
assert.equal(bindDetailResponse(url(kind, '101'), body, [failed], kind).marker, failed.marker)
assert.throws(() => bindDetailResponse(url(kind, '101'), { ...body, status: 'success' }, [failed], kind), assert.AssertionError)
assert.throws(() => bindDetailResponse(url(kind, '101'), { ...body, response_text: bodies[1].response_text }, [failed], kind),
/request-bound response marker/)
})
}
18 changes: 18 additions & 0 deletions .github/fixtures/pelican-question-e2e/nominal-round.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { nextDifferentNominal, questionAt } from '../../scripts/pelican-nominal-round.mjs'

test('selection oracle agrees with two prior real Go scheduler result artifacts', () => {
// PR832 run43405643066 attempt1, PG result projections; no model-quality claim.
assert.equal(questionAt('2026-11-13T10:06:24.123456Z'), 'penguin-bicycle')
assert.equal(questionAt('2026-11-13T10:07:16.654321Z'), 'rabbit-scooter')
})

test('later nominal time changes the question without changing the source algorithm', () => {
const previous = [{ nominal_time: '2026-11-13T10:06:24.123456Z', question_id: 'penguin-bicycle' }]
const next = nextDifferentNominal('2026-11-13T10:08:00Z', previous)
assert.match(next, /^2026-11-13T10:08:00\.\d{5}[1-9]Z$/)
assert.notEqual(questionAt(next), previous[0].question_id)
assert.ok(Date.parse(next) > Date.parse(previous[0].nominal_time))
assert.throws(() => nextDifferentNominal('2026-11-13T10:00:00Z', previous), /No later/)
})
Loading
Loading