Repository navigation
Conversation
Re-resolve the live binding on each request so a missing custom root stays unavailable instead of recreating an empty library. Same-disk restore continues through existing open/status; a rebuilt path remains binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Unavailable cached custom sessions are not required to keep the live identity. Restore still uses the original disk object; a replaced directory stays binding-moved. Signed-off-by: PraiseZhu <zhuzan@xd.com>
13 of 20 tasks
A stale custom resolveLibraryRoot could still reach vault.open, which recursively created the missing user parent and reported ready empty. Custom open now refuses to recreate a vanished parent (disk-missing); default first-time create still mkdir. keep files remain in the renamed directory and are not treated as deleted. Signed-off-by: PraiseZhu <zhuzan@xd.com>
…rift Stale resolve plus a same-path new inode is binding-moved at the mkdir boundary. disk-missing after a granted extraDir actually revokes the slot. Auto-open failures latch drift so status-only restore works. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Custom skeleton mkdir is non-recursive so a vanished user parent cannot be rebuilt as an empty library. Default roots still create recursively. Keep files stay in the renamed-away directory. Signed-off-by: PraiseZhu <zhuzan@xd.com>
After the last successful inspect, hold the parent directory and compare path identity after mkdir(root). A same-path new inode fails closed as binding-moved; an empty root created on the replacement is rolled back and keep files stay parked. Node has no mkdirat; this is not atomic. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Darwin mkdirat/openat (SYS_mkdirat=475) and Linux /proc/self/fd keep ghostId/meta on the granted parent object. Missing helper fail-closed before mutation; no path mkdir fallback. Windows custom init unsupported. Default roots still mkdir recursively. Keep files stay parked. Signed-off-by: PraiseZhu <zhuzan@xd.com>
After the held parent fd is closed, custom open does not write, rename, or unlink under this.root. Sweep unlink and persistUsage are skipped; read-only usage scan remains. Default roots unchanged. Later library writes still persist. Isolated D: no replacement usage.json. Signed-off-by: PraiseZhu <zhuzan@xd.com>
PraiseZhu
marked this pull request as ready for review
September 20, 2026 11:59
|
Open an already-initialized custom library from the held parent fd without mkdir. Missing structure on platforms without create stays fail-closed. Teardown only the captured session. Reuse a valid usage ledger; scan only when it is missing or corrupt. Custom tmp is not path-unlinked. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Existing libraries open from the inherited parent handle with NtCreateFile FILE_OPEN+ReadFile. FileIndex 0 and missing helpers fail closed. Create stays unsupported on Windows. Linux may unlink only uuid.tmp/.stream staging leftovers via /proc/self/fd. No path mkdir fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Pretty-printed and compact meta/usage payloads both parse. Malformed JSON or failed field checks stay CORRUPT. Do not split on the first newline of the helper stdout. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Age and an empty streams map cannot prove a fsynced .tmp/.stream is garbage after a crash before rename. Open no longer unlinks them. P2_tmp stays unresolved. Unknown names are kept. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Contributor
|
这条 PR 改到插件 Library 基座(自定义库 binding 复核、fd-relative 建库、session 不可用语义)以及 Library 规则文档,需要维护者确认后再继续审查和合并。插件基座改动不因标题是 bugfix 而豁免。 请维护者直接在本 PR 上 Approve;若需要作者修改,请 Request Changes。 讨论 issue:#4772 |
Create dirs with FILE_OPEN_IF and meta.json with FILE_CREATE from the inherited parent handle. No path mkdir, no rollback rmdir, no new native dependency. Existing FILE_OPEN stays read-only. Missing helper still fails closed before mutation. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Record list/resolver/control monotonic marks and dump them on waitFor failure so Linux CI can discriminate missed 500ms poll vs unpublished system-deny. Keep the original assertion and timeout. Mac is syntax sanity only. Signed-off-by: PraiseZhu <zhuzan@xd.com>
FILE_CREATE collision is exists only after FILE_OPEN of a regular file. Reparse and unknown collisions fail closed. CreateRelative always releases handles it still owns, including the catch path. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Keep 94f36c0 as an ancestor. Resolve the only content conflict in pi-startsession-cleanup onto main mockRunDiscovery (list+scan) while keeping the 132dc waitFor diagnostics and original system-deny assertion. Library files are the automatic merge result only. Signed-off-by: PraiseZhu <zhuzan@xd.com>
Consume ed4bef8. Keep 94f as ancestor. Re-resolve pi-startsession-cleanup onto mockRunDiscovery (list+scan) plus 132dc diagnostics, taking main 3s durable-approval waitFor timeout. No extra Library hand edits. Signed-off-by: PraiseZhu <zhuzan@xd.com>
…iginals Custom libraries skip age-based path sweep. Unlink uuid.tmp/.stream only when nlink>=2 and ino!=0 (successful commit residue). nlink=1 after fsync and before rename is kept. Linux custom uses held-parent fd unlinkat-style paths; Darwin/Windows custom stay fail-closed with no path fallback. Signed-off-by: PraiseZhu <zhuzan@xd.com>
…nique originals" Lead ruled nlink>=2 unlink is not a sound unique-original proof (name can be swapped after lstat; held parent does not lock names). Restore d7c custom skip + default age sweep. Do not close P2_tmp. Signed-off-by: PraiseZhu <zhuzan@xd.com>
5 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.
这次改了什么
摘要
自定义 Library 已打开后,如果原磁盘或目录消失,缓存会话仍可能再次创建原路径,形成空库。现在每次请求先核对实际 binding:目标消失时返回 unavailable,不创建空目录;同一原目标恢复后,既有 open/status 可继续访问原件。
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
不涉及。无新增按钮、提示、设置或系统授权触发路径。
怎么验证的
自动验证
当前 head:
d7c68cd966047dfc007d1252648c075e2f8829fc(baseed4bef88b48d24bc3c397b8f94f5faed4c14368a)。旧 SHAdd7f1506的 80 测 / related 绿 不能 复用到本 head。独立本地单审 APPROVE:
/Users/praise/AI-Agent/Codex/reviews/2026-09-21-ai-ui-4728-local-review.md(无 P0/P1)。不是 GitHub Approve,不能消 REVIEW_REQUIRED。回归使用独立临时目录:打开自定义库并写原件,移走目标后检查 open/status/write 均不重建空库;把同一目录移回后验证原件可读、重试写成功;另建同名目录则保持 binding-moved。Windows first-create 由云端 windows-latest 单测覆盖,不是 Electron 冷启。
手工验证
未执行桌面交互验证;所有文件测试使用合成临时目录,无用户素材或设置修改。
未执行的验证
Windows 同路径目录替换的 inode 识别沿用现有平台限制,测试不将 macOS 结果视为 Windows 实测。非作者维护者正式 Approve 仍缺。custom tmp 安全回收设计未做(见风险)。本批技术状态是「已审 / CI / E2E 通过,尚有明确 P2 取舍及正式批准外部依赖」,不能写无问题。
风险
风险分类
影响与回滚
d7c68cd96及其 Library 祖先,不是「两个提交」)。不涉及数据迁移。回退会恢复缓存 custom 根消失时可能创建空库的旧行为。.cindy-library/tmp的.tmp/.stream可能是 fsync 后、rename 前的唯一原件。现接口(含 LinuxlistProvableStagingOnLinux只列表、禁止 unlink)不能证明可安全回收。本 PR 保留 custom fail-closed(跳过 pathsweepStaleTmp),不按龄 unlink、不为关 P2 引入新跨平台删除。安全处置需后续明确设计。线程PRRT_kwDOTgdRUs6kI9yC未 resolve;是否接受残留或要求修复,须维护者具名,本包不冒充已接受。提交前检查
git commit -s,见 DCO)