Repository navigation
Support personal conversation workspaces - #175
Zhong-Chenchen wants to merge 4 commits into
Conversation
|
LoopForge PR Review Bot
Checks performed (isolated worktree, Go 1.26.11 matching the go.mod bump for GO-2026-6859):
Not run: full repository test suite and Docker/runner end-to-end verification for personal-workspace isolation — no Docker daemon access in this environment. Relying on the targeted package tests above plus the PR author's reported No blocking issues found in the reviewed scope (personal conversation workspace support, empty-workspace creation when no repository is configured, per-user/session isolation). Closes #167 as described. |
fx-kurumi
left a comment
There was a problem hiding this comment.
PR #175 review — head 6b4444daefa5b75b901edfb68b9a92838d4388a8
Request changes: knowledge submissions from deleted project runs become invisible and undeletable.
- Where:
internal/httpapi/knowledge.go:162(restrictedKnowledgeSubmission):return !ok || run.IsWorkspace() && run.ExecutionContext.ProjectID == "". It gates list, get, update, delete, publish and reject. - Scenario:
RunsRepo.DeleteRun(internal/repo/runs.go) does not cascade toknowledge_submissions. After a normal project run is deleted (DELETE /api/runs/:id),RunStatemisses (!ok). Every submission derived from that run is then treated as restricted, including published ones:- it disappears from the list;
- get, update, delete, publish and reject all return 403.
- Why it matters: admins can neither see nor clean up this existing data. That goes beyond the PR's goal of keeping personal workspaces out of the shared knowledge base, and beyond what the PR description calls conservative hiding.
- Reproduction: a temporary handler test seeded
{ProjectID:"workbench", RunID:"deleted-project-run", ArtifactID:"a1", Status:published}. Result: list visible=false, GET 403, DELETE 403. - Suggested fix: when the run is gone, fall back to the submission's own
ProjectID:if !ok { return item.ProjectID == "" }.Submitstores the run's project, which is empty for personal workspaces. At minimum, do not block DELETE.
Non-blocking
runWriteGuard adds a RunState lookup to every /api/runs/:id* request, including SSE and log polling. The candidates/submissions endpoints also do one RunState per row.
Executed checks
go vetonhttpapi,engineandrepo: ok.go test ./internal/httpapi -run 'Personal|Scratch|Knowledge|WorkspaceOpen|SubmitMR|Sandbox': 38 pass.
| return item.ArtifactID != "" | ||
| } | ||
| run, ok := h.repo.RunState(item.RunID) | ||
| return !ok || run.IsWorkspace() && run.ExecutionContext.ProjectID == "" |
There was a problem hiding this comment.
When the run has been deleted, RunState misses (!ok). Deletion does not cascade to knowledge_submissions, so every submission from a deleted project run, including published ones, becomes hidden and returns 403 on get, update, delete, publish and reject. A temporary test reproduced this: list visible=false, GET 403, DELETE 403.
Suggested fix: fall back to the stored project, e.g. if !ok { return item.ProjectID == "" }. Personal workspaces store an empty ProjectID. At minimum, keep DELETE allowed.
There was a problem hiding this comment.
Fixed in 49d5871. Knowledge submissions remain accessible and manageable after their source run is deleted, with regression tests added. All CI checks pass. Could you take another look?
|
❌ 结论:Request changes(需要修改) 审查 head 个人工作区的权限隔离:我逐条检查了以下路径,没有发现越权:
无仓库工作区禁止 submit_mr 的处理也正确。 Robert0622 的 bot 结论是 Pass,但它没有覆盖下面这个知识库行为变化,PR 描述里也请维护者评估这一点。我验证后认为这是需要修复的回归。 [P2] 关联运行被删除后,正常项目知识提交被隐藏且无法管理
可选建议(不阻塞):Go 1.26.11 的升级 main 已经包含,与 main 合并无冲突( 验证
|
|
LoopForge PR Review Bot
Re-review: head moved from Checks performed (isolated worktree, Go 1.26.11 matching go.mod):
No blocking issues found in the reviewed scope (personal workspace write-access guard, knowledge-submission restriction for personal-workspace runs, workspace binding). |
复审 head
|
Re-reviewed at current head: the blocking issue is fixed. See the latest fx-kurumi re-review comment.
What changed
个人对话现在可以直接打开可写工作区;项目未配置仓库时也可以创建空工作区,供文件操作、命令执行和预览使用。个人工作区按用户和会话隔离,并限制其产物进入共享知识库。
同时将 Go 工具链和 Docker 构建镜像更新到 1.26.11,修复导致 CI 漏洞扫描失败的 GO-2026-6859。
Closes #167
Scope
Compatibility
已有项目仓库的检出和提交路径保持不变。空工作区不支持仓库提交或 PR/MR。项目运行删除后,已有知识库提交仍可查看和管理;个人工作区产物不能提交到共享知识库。Go 构建现在要求 1.26.11 或更新版本。
Validation
./internal/httpapi ./internal/engine ./internal/repo);安全更新后重新运行了这些包中名称包含 Personal 或 Scratch 的测试。go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 ./...(Go 1.26.11):通过,未发现代码可触达的漏洞。go vet ./internal/httpapi ./internal/engine ./internal/repo通过。python3 scripts/check-public.py、git diff --check通过。git init -b。Safety