Repository navigation
fix(ProjectForge): 写盘前复核 hash、Rollback 原子化、py_compile 异步化 - #212
Merged
Merged
Conversation
1902435792
commented
Sep 28, 2026
- EditCode / CreateFile / Rollback / GUI 单文件回退:写盘前重新读取并比对 hash。 读取与写入之间夹着 await(代码审查、回退规划),期间文件若被外部修改 (编辑器、其他插件、指向同一目录的其他工程),原逻辑会静默覆盖;现改为放弃写入并提示重新 ReadCode。
- Rollback:先写完所有文件,全部成功后再在一个事务里记录批次与节点; 中途写入失败(如文件被占用)时按逆序恢复已写入文件,不留下"回退了一半"且无记录的状态。
- fileKit/validator:py_compile 由 execFileSync 改为异步 execFile。 原实现在常驻进程中最长阻塞事件循环 20s,且 reviewCode 前后各执行一次; 临时文件名追加随机后缀,避免 before/after 并发校验时同毫秒撞名。
- 新增 tests/project-forge-robustness.test.js(3 个用例:旧代码全部失败,新代码全部通过; 原有 tests/project-forge.test.js 全部通过)。
- EditCode / CreateFile / Rollback / GUI 单文件回退:写盘前重新读取并比对 hash。 读取与写入之间夹着 await(代码审查、回退规划),期间文件若被外部修改 (编辑器、其他插件、指向同一目录的其他工程),原逻辑会静默覆盖;现改为放弃写入并提示重新 ReadCode。 - Rollback:先写完所有文件,全部成功后再在一个事务里记录批次与节点; 中途写入失败(如文件被占用)时按逆序恢复已写入文件,不留下"回退了一半"且无记录的状态。 - fileKit/validator:py_compile 由 execFileSync 改为异步 execFile。 原实现在常驻进程中最长阻塞事件循环 20s,且 reviewCode 前后各执行一次; 临时文件名追加随机后缀,避免 before/after 并发校验时同毫秒撞名。 - 新增 tests/project-forge-robustness.test.js(3 个用例:旧代码全部失败,新代码全部通过; 原有 tests/project-forge.test.js 全部通过)。
lioensky
pushed a commit
that referenced
this pull request
Sep 28, 2026
目前 main 上的 "Chat Kernel and UI gates" 对所有 PR 都会失败(如 #212 及 9/21、9/26 的 PR)。 本 PR 只修复其中可机械修复、不涉及设计决策的三处: - tests/content-pipeline.test.mjs:c31f6af9(加强代码块围栏)为 STREAM_FAST 路径新增了 protect-code-blocks / restore-code-blocks,同步测试的期望步骤。 无代码块时 codeBlockMap 仍为 null,原有断言不变。 - docs/contracts/generated/chat-event-graph.json:用 npm run build:chat-event-graph 重新生成 (此前缺少 ProjectForge、fileKit、BladeGame、ChartController 等新文件)。 - docs/contracts/chat-contracts.json:登记 modules/loom/webcore/comfyui-main-world-bridge.js 第 271、276 行两处 RESPONSE_EVENT 动态事件(常量 'vcp-comfyui-agent-response', 消费者 comfyui-page-adapter.js)。暂无自动化测试,status 如实标为 manual_required。 本地复现验证(Linux、Node 20、Rust stable): - npm run test:chat-kernel:182/182 通过 - npm run check:chat-evidence:全部通过(含 built-artifact smoke、transcript snapshot) 仍需维护者处理(本 PR 未改动,均为现有 main 的问题): 1. guard:next-delta:scripts/next-delta-shared-baseline.json 中 10 个文件有 6 个 sha256 已过期 (chatManager、messageRenderer、topicListManager、itemListManager、grouprenderer、settingsManager), 需人工审阅后更新 hash 与 reason。 2. guard:ui-system:modules/ui-system/settings/group-slots.js contains inline style mutation。 3. test:appearance-engine:断言 "global wallpaper applies glass locally to the sidebar" 失败。 4. guard:design-subtraction 以 merge-base(HEAD, origin/main) 为基准,任何修改 allowlist 以外文件的 PR 都会失败(例如 #212 修改 ProjectForge / fileKit 即被拦截)。是否将其限定为设计系统相关 PR,请维护者决定。
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.