Repository navigation
feat(workhub): add task-scoped supplemental execution grants - #14
Merged
Merged
Conversation
Commit original path/network/client approvals atomically as scoped grants. Resolve effective authority using immutable invocation identity, validate root and child ownership, and drain granted resources on revocation or expiry without changing Session defaults. Add native allow/list/revoke controls and durable recovery. Refs #8 Generated-by: OpenAI Codex
8 of 56 tasks
Owner
Author
Initial hosted-check statusExact head: The test and packaging jobs are still running. Two completed checks are red:
Local verification results in the description remain exact-head results; they do not imply that hosted CI has passed. The PR remains open for owner review, without auto-merge. 简体中文远端测试和打包仍在运行。目前已有两项失败:依赖审计报告现有 PR 描述中的本地测试结果不代表远端 CI 已通过;等待人工审查,不自动合并。 |
4 of 6 tasks
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
This completes Step 5B of the WorkHub plan in one PR, on top of merged #13.
Refs #8. Base:
8a905631e67d15f4682b81fb2ab6a54fce5656f9. Head:b8d4b2ce91475aadb942e7ee51c13ab7994fd8f9.Migration and review focus
SQLite metadata schema 41 → 42 adds grant records to
runtime.sqlite; existing execution defaults remain unchanged. Runtime Host protocol epoch 209 → 210 requires matching Host/Desktop builds. No second task database, model approval tool, permission override/restore scheme or Windows command/Grep backend is added.Review the root/child ownership proof, atomic settlement, revoke/admit races and resource draining. Cancellation after client admission reports an unknown outcome rather than claiming external effects were undone; nothing automatically replays those effects. Cleanup failure drains the Host instead of restoring permission.
Verification
The committed tree is the tested tree (
79a7ab5e0ff1b99354f857eb2d38578c264a5879). Final checks on macOS:runningversuscancelledassertion failure; restoring it passes.Browser verification receipt:
{"passed":33,"failed":0,"retries":0,"playFunctions":"finished"}Earlier verification exposed migration fixtures retaining the newly created table, one directory-alias
candidate_set_stalerejection and stale local UI build output. The migration was made idempotent and exercised from a real v41 table layout; the UI output was rebuilt. Isolated and final full runs passed without weakening assertions or retry settings. The earlier candidate rejection is retained as a failed observation, not claimed to be a deterministically reproduced baseline defect.Native Windows execution/packaging and live-provider calls were not run on this Mac. Inventory checks do not replace those; unsupported backends remain fail-closed. Step 6 is not included.
AI use
Tool(s) and scope: OpenAI Codex assisted with source inspection, implementation, regression tests, verification and this description at the repository owner's request. Human review and merge remain with the owner; this PR is not automatically merged.
Checklist
Does this PR entail a change in behavior?
简体中文
本 PR 在已合并的 #13 上一次性交付完整 5B:原生待办可允许当前任务的路径、网络与客户端能力请求,查看有效授权并撤销。授权有效期为一小时,不改写 Session 默认权限、模型或工作目录;普通工具审批继续使用原 reviewer,模型不能通过新增工具代为批准。
授权与原请求结果在现有数据库中原子提交。执行时携带固定 Session/Turn/Run/invocation 身份,依据 Message-owned root 和被证明的子执行关系检查权限;排队任务、后续人工 Turn 与无关执行不继承授权。撤销、过期、完成、取消、归档/退休、替换或默认边界 revision 改变时,先持久失效,再取消相关资源并等待清理。后台 shell 进程在前台调用返回后仍受授权生命周期约束,不能继续沿用已撤销的权限。重启只接受仍有效的原执行范围,不自动重放审批或未知副作用。
数据库 schema 为 41 → 42,协议 epoch 为 209 → 210;不新增第二数据库,不使用覆盖权限后恢复旧快照的办法,不扩展 Windows 命令/Grep 后端。客户端调用在已经放行后被取消,结果标记为未知,不宣称能够撤回已经发生的外部效果。清理失败时停止 Host 服务,而不是重新开放权限。
精确提交
b8d4b2ce91475aadb942e7ee51c13ab7994fd8f9的提交树与最终测试树相同。完整回归为 Node 14,382 通过/0 失败/38 个既有跳过,Python 94 项/0 失败/13 跳过;发布检查 214/214、协议守卫测试 17/17、WorkHub 浏览器 33/33、现有 Electron 5/5,构建与静态检查均通过。真实 Host/SQLite、关联子任务、图式 claim 正反身份、重启后的授权/撤销记录、scope 隔离、过期和真实后台进程清理均有覆盖;临时删除资源绑定时,回归会以“进程仍在运行”的行为错误失败,恢复后通过。没有增加 Electron 用例或放宽断言、超时、重试。此前失败记录保留:数据库迁移夹具冲突已修正;UI 缓存重建后发布检查通过;另一次目录候选集过期拒绝不据此断言为稳定的 main 缺陷,最终完整复测通过。本 Mac 未运行 Windows 真机/打包或真实供应商调用,清单检查不能替代这些验收。录屏使用生产 Storybook 组件和隔离测试数据,不是实际供应商授权。
本 PR 等待所有者审查和合并,不自动合并,也不开始第 6 步。