Skip to content

[A10][Draft] HumanGrant 回执校验、会话隔离与客户端恢复测试 - #880

Merged
LIghtJUNction merged 5 commits into
wip/rust-core-go-extensionsfrom
a10/humangrant-web-client
Oct 18, 2026
Merged

LIghtJUNction merged 5 commits into
wip/rust-core-go-extensionsfrom
a10/humangrant-web-client

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

A10 Web 客户端兼容切片(仍未完成 A10)

此 PR 目标为 wip/rust-core-go-extensions,不是 main,仅包含 Web 可独立审查改动;不改变 Core/Go 权限,不部署,不更新 CLI 子模块。

已提交

  • 恢复 Continue with human beings 入口:显式检查 enabled === true && ready === true,读取失败、过期与停用隐藏入口。
  • HumanGrant 设置读取与写入:只用同源人类 Cookie 和 X-HG-CSRF,不用控制台 Bearer;PUT 必须有 HTTP 200 JSON 业务回执,随后读取权威状态。未知结果不自动重发副作用请求。
  • 用户/会话切换隔离:旧请求、延迟响应和 A→B→A 切换不能改写新会话草稿或状态。
  • 映射 A02 不支持邮箱注册的明确错误及 HumanGrant 常见错误状态,拒绝以未知错误码显示成功。
  • 提交合成 HTTP 客户端回归、会话测试、8 项真实回环 TCP 场景、可手动执行的 Chromium 客户端传输脚本,以及七种语言的翻译输入补丁 tests/e2e/a10/translations.json。
  • 浏览器测试依赖外部 Playwright/Chromium,使用回环合成提供方,不能代替真实浏览器登录和人类授权旅程。

核验分层

  • 曾在隔离环境完成 19 项 HumanGrant transport、4 项错误映射、8 项 TCP 回环测试;随后增加用户/会话隔离测试,并在独立提交内记录 27 项 transport/session 测试通过。这些不是固定源码的全量构建记录,不能相加当新覆盖。
  • 本轮再次以 Node 22.16.0 运行包内旧 TCP 脚本:8/8 通过;已提交的 Web TCP runner 与上一版本有细小差异,需以最终 PR HEAD 重新验证。
  • Chromium 传输脚本先前在受限环境未进入业务断言。本轮提交只做源码/语法和 Git blob SHA 核对,没有获得 Chromium/browser PASS。
  • 没有完成固定 mise + Bun 1.3.14 的全量 typecheck、lint、format、fullsuite、正式 build;没有真实 Core/Go/PG、真实审批/授权/claim/revoke、资金业务验收。
  • 查询当前 PR HEAD 没有可用的同 SHA GitHub Actions 运行记录。

集成前仍需

  1. A01/A02 冻结完整人类登录与授权协议,验证 Cookie、CSRF、权限和 revoke 的真实后端;服务端而非前端判断最终权限。
  2. 用项目翻译 helper 将七种语言的输入补丁作用于实际 locale,并检查只变动相关键。
  3. 以固定工具链运行前端质量检查、合成浏览器测试与真实隔离候选的全业务旅程。
  4. 与 A03–A09 联合覆盖模型调用/流、钱包未知金额、历史费用、团队 Key、订阅、支付退款、商店/客服/助手/工具;CLI 独立 PR TokenNotIncluded/lmm#3 先通过 Rust 检查和可到达 SHA 验证,S11 再更新父仓库 gitlink。

状态:Draft / BLOCKED,不是 A10 完成、可发布或生产部署的声明。 关联 #675;任务定义:architecture-completion-prompts.md#a10。

Restore the HumanGrant sign-in entry independently of OAuth,
prevent stale availability responses, and guard owner setting
writes with a single same-origin CSRF request and readback.

Add 15 synthetic HTTP contract tests. This does not activate
server-side grants or claim browser acceptance.
…sions

Require main's JSON acknowledgement before readback. Preserve unknown outcomes
without automatic PUT replay, and distinguish failed reads from false settings.

Scope cookie/CSRF requests and page drafts to the initiating user and session.
Discard late responses after account switches, including batched A-B-A changes.
Map A02's explicit unsupported-registration error without resending a request.

27 transport/session tests and 4 isolated error-map tests passed with Node 22.16.0.
Pinned Bun, full React build and real backend/browser acceptance remain pending.
Keep real client transport tests separate from browser and server acceptance.
Include the complete seven-language patch as integration input, not runtime
locale data. Document pinned-tool commands and outstanding integration work.

The eight loopback TCP scenarios passed with Node 22.16.0 and the exact client
source from 9ebd18e. They use a synthetic provider and Cookie/Origin adapter.
@LIghtJUNction LIghtJUNction changed the title [A10][Draft] Restore fail-closed HumanGrant Web client on microservice WIP [A10][Draft] HumanGrant 回执校验、会话隔离与客户端恢复测试 Oct 12, 2026
Add an isolated synthetic browser runner and explicit scope/required-tool
notes. Previous restricted browser attempt reached no business assertions;
keep browser acceptance pending for S11.
@LIghtJUNction

Copy link
Copy Markdown
Member Author

已在本 PR 原分支追加并推送 d730d1e2b83b88f85e5c8e40246428df7482f031,没有另起重复 HumanGrant 实现,也没有合并/部署。

这次只改 session scope 和其测试:在 JSON 解析前后重新验证会话归属,旧会话响应取消读取;保持 Cookie/CSRF transport、UI 和服务端授权职责不变。

本机固定工具检查:

  • 新增两个反例在原 head c4a90beed4 的 scope 实现上:8 pass / 2 fail;应用本补丁后,transport + session 两文件共 29 pass / 0 fail。
  • bun run typecheck:web 通过;两文件 oxlint、oxfmt、git diff --check 通过。
  • 实际客户端编译为 ES module,Node 26.10.0 的 TCP runner:8/8 通过,提供方/Cookie-Origin adapter 仍为合成 fixture。

保留一个具体验收差异,不弱化断言: README 中 Bun 1.3.14 的 TCP 入口在 lost-ack 场景观察到 writes=2,结果 7 pass / 1 fail;Node 入口为 writes=1。该 transport 模块未被本补丁修改,SHA-256 仍为 030e4010d0c7ab5f1ba06da2f5ea7c04234e7ac8c7d8f50fef2fc301c831770f。需要确认运行时 HTTP 重发与服务端原子回执/幂等合同,不能把“JS 未主动重试”扩写为“网络绝不重复发送”。

Draft 保留。真实 Core 人类 Cookie/CSRF、授权/撤销/关闭重开、实际浏览器及七语言 patch 接入仍未完成;这些测试不代表 A10 或 S11 整体通过。不触发或等待远程 CI。

@LIghtJUNction
LIghtJUNction marked this pull request as ready for review October 12, 2026 17:44
Copilot AI balanced review requested due to automatic review settings October 12, 2026 17:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@LIghtJUNction
LIghtJUNction marked this pull request as draft October 18, 2026 17:01

Copy link
Copy Markdown
Member Author

本轮恢复为 Draft,与标题、原验证评论及仍未完成的 Core HumanGrant 契约保持一致。

现有客户端 session/receipt 测试属于有价值的独立工作,应保留并与 #866 整合。当前还需真实 Core 的人类会话/CSRF、授权与撤销、关闭重开、幂等回执和七语言界面接入;此前已记录的 Bun lost-ack 重发差异也未由本轮解决。新主线的 trusted delegation 实现不足以替代这些 HumanGrant 业务验收。

具体剩余责任继续归入 #895,未合并或关闭本 PR。

@LIghtJUNction
LIghtJUNction merged commit 60e5719 into wip/rust-core-go-extensions Oct 18, 2026
@LIghtJUNction
LIghtJUNction deleted the a10/humangrant-web-client branch November 5, 2026 07:31
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.

2 participants