feat(tui): M0A.5b TUI 登录#84
Open
wangjk9527 wants to merge 5 commits into
Open
Conversation
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 23, 2026 16:49
0636a15 to
114eba5
Compare
Collaborator
Author
静态审查逐条结论(已落地)
验证
Commit相对 5a( |
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 23, 2026 16:58
114eba5 to
04a9a1c
Compare
Collaborator
Author
复审结论(对照 tip
|
| # | 条目 | 判定 | 现状(04a9a1c) |
|---|---|---|---|
| 1 | --no-auto-login 不注销旧 Session |
成立 → 已修 | 仍读缓存为 previousSession(不恢复 cookies / 不调 /me);新登录成功后 best-effort logout 旧 Session |
| 2 | 真实终端密码可能回显 | 成立 → 已修 | createSecurePrompt 同一时间只挂一个 readline;密码走 muted stdout |
| 3 | Session 失效不回登录界面 | 成立 → 已修 | onAuthRequired + Ink unmount;runTui 以 auth-required 重进登录;CSRF refresh 失败同路径 |
| 4 | browser opener 命令不存在可崩溃 | 成立 → 已修 | spawn 后挂 error listener;调用方始终打印可复制 URL |
| 5 | API 不可达缺恢复入口 | 成立 → 已修 | [r]etry / [o]ther address / [q]uit;runtimeUrl/configBaseUrl 可在循环内更新 |
第二轮(2 项)
| # | 条目 | 判定 | 现状(04a9a1c) |
|---|---|---|---|
| R1 | preflight 401 后 onAuthRequired 事件永久丢失 |
成立 → 已修 | 粘性 sessionInvalidNotified;订阅时若已失效立即 replay;有「先 401、后订阅」单测 |
| R2 | 恢复菜单缺「使用其他地址」 | 成立 → 已修 | 见上第 5 项;有 switches runtime URL from recovery menu 测试 |
验证
apps/tui:npm test→ 71 passnpm run test:auth-foundation→ 跑通
Commit
相对 5a(0989386)仍为单实现 commit:04a9a1c(无 docs/superpowers)。此前评论中的 114eba5 /「仅 retry-quit」已过时。
本轮无新增代码改动(tip 已覆盖上述条目)。
9 tasks
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
2 times, most recently
from
July 24, 2026 14:01
3c9d9ea to
ffc491b
Compare
Collaborator
Author
静态审查逐条核实(tip
|
| # | 条目 | 判定 | 处理 |
|---|---|---|---|
| 1 | 密码 stdout 重定向仍可能回显 | 成立 | 已修:terminal 改按 stdin.isTTY;密码前显式 setRawMode(true) 并恢复;无法隐藏 echo 则拒绝读密码;补 stdin TTY + stdout pipe 测试 |
| 2 | 允许非本机明文 HTTP | 成立 | 已修:validateRuntimeUrl 用于初始 --runtime-url 与交互改址;HTTP 仅 loopback;非 loopback 必须 HTTPS;拒 URL credentials;清 query/hash 并规范化路径 |
| 3 | 并发 CSRF refresh 竞争 | 成立 | 已修:AuthenticatedTransport single-flight 共享 Promise;并发测 refresh 只一次 |
| 4 | Session 文件并发更新丢记录 | 成立 | 已修:.lock 排他锁 + 锁内重读合并;临时文件改用 UUID |
| 5 | 损坏 Session 校验过浅 | 成立 | 已修:plain object + 字段校验(cookies/user/workspace/expiresAt);任一非法则隔离整文件 |
| 6 | 注销成功但本地清理失败混为一类 | 成立 | 已修:区分 remote-failed vs local-cleanup-failed;本地失败展示路径并可重试 |
| 7 | AuthClient 无超时;登录网络错误缺恢复 | 成立 | 已修:默认 15s 超时(TIMEOUT/NETWORK_ERROR);登录阶段不可达回顶层 [r]/[o]/[q] |
| 8 | CI 未跑 tui test;no-bare-fetch 扫 dist 恒通过 | 成立 | 已修:CI 增加 npm --workspace @datafoundry/tui test;门禁固定扫 apps/tui/src 且 files.length > 0 |
| 9 | 文档仍教 --demo;Demo 扫描范围偏窄 |
成立 | 已修:更新 zh/en quick-start、guides/tui、capabilities;Demo 扫描扩到 apps/README/docs |
验证
npm --workspace @datafoundry/tui test→ 87 passnpm run test:auth-foundation→ 24 pass
相对 upstream/main 已压成单实现 commit,并 --force-with-lease 更新本 PR。未动 5c/#82。
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 24, 2026 16:32
ffc491b to
81f2269
Compare
Collaborator
Author
复审跟进(相对 tip
|
7 tasks
提供 deploy.sh 原生部署链路(configure/install/build/start/stop/doctor/tui), 仅托管 Web + API;补齐无内置 DataLink 的 npm start / stack-runner。 语义 Data Link 改为外置 MCP 对接,deploy 不安装、不启动、不作健康门槛。 基于 main reset 后重提原 datagallery-lab#82。
7 tasks
仅在 verified running state 时标记 managed ports;redeploy 默认以磁盘密钥为准;launchId 校验失败时清除 stale 状态且不向错误进程发信号。附带端口精确匹配、postgres URL 脱敏与 .env 权限提示。
实现 password 模式会话/CSRF/注册策略,并修复 HITL 事件桥、cookie Path 与缺失注册策略静默 open 等确定性缺陷。脚本侧统一正式认证客户端,并为 FORMAL_HTTP_AUTH_TARGETS 增加 node --check 语法门禁。 基于 main reset 后重提原 datagallery-lab#83,叠在 DataLink 外置的一键部署分支之上。 Co-authored-by: wing <wangjk9527@users.noreply.github.com>
接入正式认证登录/会话恢复,并按复审加固: - 认证请求 redirect:manual,逐跳拒绝 HTTPS→HTTP 与跨 origin - AbortController 覆盖完整 body 读取;session 隔离/重置与保存同锁,锁支持过期回收 - CSRF 403 若 jar token 已更新则直接重试;session-invalid 去重先于清理副作用 基于 main reset 后重提原 datagallery-lab#84,rebase 到 DataLink 外置 deploy + M0A.5a 栈上; 同步清理 TUI 指南中残留的离线 Demo 模式表述。 Co-authored-by: wing <wangjk9527@users.noreply.github.com>
Max-Age=0/过期 Expires 的 Set-Cookie 现在会删除 jar 条目;session-invalid 清理失败仍通知 auth-required;logout/auth-required 后强制交互登录,避免 磁盘残留会话被静默恢复。
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 26, 2026 08:11
81f2269 to
62167a5
Compare
wangjk9527
marked this pull request as ready for review
July 26, 2026 08:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/logoutrun-defaults)共用AuthenticatedTransport;身份探测走GET /api/v1/meMax-Age=0吊销、session-invalid 清理失败仍通知、logout/auth-required 后强制交互登录Depends on
Depends on #87(原生一键部署 / DataLink 外置,已含部署 P0/P1 修复)与栈内 M0A.5a 正式认证 commit。请先合 #87,再合本 PR。
Stack
upstream/main→ #87 deploy tip → M0A.5a → M0A.5b → TUI 会话修复Test plan
npm --workspace @datafoundry/tui test(100 passed)npm run test:auth-foundation(24 passed)npm run smoke:tui-auth-sharing(需本地栈)