feat(core): convert fswatch functions to rust drafts #29

Open
arnold.cui-agent wants to merge 7 commits from feat/func-fswatch into feat/migration-base
pull from: feat/func-fswatch
Member

背景

fswatch 模块的转换与修红工作独立于基础分支推进;本分支 base 于 feat/func-tspath,承接 fswatch 全部生成产物。

变更内容

  • fswatch generated_funcs 与 generated_funcs_test(514 候选 507 产出:36 精确体、221 函数哨兵、250 测试哨兵)及 mod 注册行
  • 内容与拆分前 feat/func-fswatch-tspath 完全一致,仅随拓扑文档更新

自测结果

  • cargo check 135 个哨兵红、非哨兵错误 0
  • fswatch-only 清单重生成验证逐字节稳定
## 背景 fswatch 模块的转换与修红工作独立于基础分支推进;本分支 base 于 feat/func-tspath,承接 fswatch 全部生成产物。 ## 变更内容 - fswatch generated_funcs 与 generated_funcs_test(514 候选 507 产出:36 精确体、221 函数哨兵、250 测试哨兵)及 mod 注册行 - 内容与拆分前 feat/func-fswatch-tspath 完全一致,仅随拓扑文档更新 ## 自测结果 - cargo check 135 个哨兵红、非哨兵错误 0 - fswatch-only 清单重生成验证逐字节稳定
arnold.cui changed target branch from feat/func-tspath to main 2026-11-22 12:42:55 +00:00
arnold.cui-agent changed target branch from main to feat/migration-base 2026-11-25 10:54:11 +00:00
arnold.cui-agent force-pushed feat/func-fswatch from 556230bbe3 to 4fce6e31f8 2026-11-25 13:41:38 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from d359b5bb2a to 8ecda16197 2026-11-26 17:06:37 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from 8ecda16197 to 3a6bcfc6d7 2026-11-26 17:09:44 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from 402aff2460 to bd6e1e5da5 2026-11-29 11:11:51 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from 7fc33aa982 to d4fac4b449 2026-12-03 00:53:03 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from d4fac4b449 to ef0ca2457b 2026-12-03 02:37:22 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from ef0ca2457b to cbd929cea1 2026-12-03 03:55:52 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from cbd929cea1 to 7cc0af3bd2 2026-12-03 07:08:15 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from 7cc0af3bd2 to a487f7d3a2 2026-12-03 07:16:34 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from a487f7d3a2 to 45c3d09187 2026-12-04 04:19:06 +00:00 Compare
arnold.cui-agent force-pushed feat/func-fswatch from 45c3d09187 to 4b15f2ea73 2026-12-05 03:03:38 +00:00 Compare
arnold.cui-agent added 4 commits 2026-12-05 06:40:16 +00:00
Squashes the regenerated fswatch module products on feat/migration-base into a single commit.
Every file here is converter output; the matching converter delta is the feat/func-fswatch squash in tsox-scripts.

Original commits (oldest first):
- 45c3d091 chore(regen): translate unique_name random suffix
- 4bc8e4d4 chore(regen): pick up the io_read_full kit in generated_struct
- 8f37b3a4 chore(regen): translate fanotify markDir and the dfid round-trip test
- 35091242 chore(regen): carry the fswatch handle family through P1a
- 3e29057e chore(regen): translate the watchAddMany subscribe dedup else branch
- e1b72eaf chore(regen): translate watcherBase.run through the Arc receiver machine
- 1153ba99 chore(regen): keep drain event slots alongside the error
- 535b42e4 FW-17 regen: FakeFallbackWatcher 收口——watch 构造共享句柄(哨兵 __recv_arc)、测试局部/槽构造 Arc 身份面、failDir Option 面+shouldFail 烘焙、Watcher1 三 watch 方法 Arc 接收者(shim 自由函
- 095fe3a7 FW-18 regen: watcher 包变量单例 + 接口指针判等——fallback 家族五测全绿
scripts c9bd5a5b 重生成(结构 --all + fswatch + tpath + lsproto-printer +
vendor 全 --force):cargo check --all-targets 0 错,cargo test 171/21 ->
175/17,todo! 53 -> 51,两遍重生成零 diff。

- watcher/dirWatch sequence 与 callback.ignore 转 Option 面:字面量缺省
  None、判空 is_some/is_none、调用 unwrap,nil 函数字段不再触发
  go nil func call panic(4 测转绿)。
- debounce notifyIfReady/latchWait 持锁泊车与真守卫释放:debounce loop
  线程不再挂死,consolidated_child/file_callback 族不再卡死测试进程。
- pkg_vars 单例 sequence: None。
Regenerated from scripts@2aa98b4bafd0f993dedc29f41d61b31477cb56c0.
55 files changed; regen idempotent (two passes, md5 identical).

Gate: cargo check --all-targets 0 errors; cargo test 171 passed/21 failed
-> 181 passed/11 failed; todo!() 53 -> 45.

Highlights:
- mutex unlock now drops the real segment guard (debounce deadlock gone),
  post-drop field reads re-lock once
- all .lock().unwrap() poison-tolerant (Go lock semantics)
- watcher/dirWatch.sequence, callback.ignore, watcher.factory,
  fakeFallbackWatcher.fail_dir become Option<Arc<dyn Fn>> faces
- spawn closures capture loop vars via reverse-parsed clone prelude
- statement-position channel send parses and renders
- strings.EqualFold SimpleFold table; filepath.Join now Cleans

11 remaining failures are attributed (nativepath cross-branch x3,
WatchDirectories body todo x5, package-init/factory mechanism x1,
iface singleton getImpl face x1, walkDir receiver capture x1) - see
csv-records/fswatch-loop-log.md FW-20.
regenerated from tsox-scripts 52cce7ff (fix(convert): fswatch rebase round).
restores the session baseline after the base merge: cargo test 181 passed /
11 failed (was 121/71 with 55 runForEachWatcher todo regressions); cargo
check --locked --all-targets 0 errors, 1 pre-existing warning (inotify
watch_path, was 5 warnings from regenerated test files); todo!() 45
unchanged; regen idempotent (two passes, tree hash identical)
arnold.cui-agent force-pushed feat/func-fswatch from 4b15f2ea73 to 570ece647e 2026-12-05 06:40:16 +00:00 Compare
arnold.cui-agent added 1 commit 2026-12-05 06:55:16 +00:00
regenerated from tsox-scripts 7b06b9ed (feat(convert): package init bakes
singleton field values). cargo test 182 passed / 10 failed:
test_default_backend_matches_platform green (fanotify/inotify factory now
set per platform at singleton first access); check 0 errors, 1 pre-existing
warning; todo!() 45 unchanged; regen idempotent (two passes)
arnold.cui-agent added 1 commit 2026-12-05 10:58:41 +00:00
引用 scripts 提交 73b4876e(fix(convert): generalize statement-level
same-lock hoist to any receiver),fswatch-regen r45 全量重生成落盘
(结构 --all -> lsproto-printer -> tpath -> fswatch -> vendor,--force
无 --prune),r46 二遍幂等:crates 树 md5
1f28f99b40ab2bc91aebe7350a7e77f9 两遍一致。

产物变化规模:30 文件 +282/-374。要点:
- fanotify/inotify start 的 pollfds vec! 双元素语句提升为单守卫块,
  test_linux_fanotify_backend_selection 由挂起转绿;
- watcher remove_dir_watch 同语句双 dw 链归一守卫;
- eventlist create_locked 等 if/else 分支链保持原位(条件含调用的
  化合物不提升,守卫不罩条件求值),eventlist 六测由挂转绿;
- cargo test 183 过 / 9 挂(!todo 占位快速失败) / 0 挂起,无 60 秒
  告警行;cargo check 0 错仅既有 1 警;todo!() 44 不超 44。
arnold.cui-agent added 1 commit 2026-12-05 11:38:50 +00:00
引用 tsox-scripts 92d1bbd7(fix(convert): fanotify subscribe takes the me
face so walkdir closures capture an owned arc)。

- fanotify_backend1.rs:subscribe 从 FanotifyBackendInner 内面改为 me 面
  自由函数(fanotify_backend_subscribe),recursive 分支 todo 消除,闭包以
  w_cap/me_cap 'static 捕获;旧外型壳删除
- WatcherImpl.subscribe trait 接收者升 self: Arc<Self>;五个后端桥与测试
  假件 shim 同形转发
- watcher4/5:self_ 槽 subscribe 调用改 __self_call.clone().unwrap()
- kqueue_backend(darwin cfg):walk_dir 实参锁链提升为前置 let,文本形态
  与 linux subscribe 一致
- fanotify_linux_test:cleans_up 调用点走 me 面 UFCS

门禁:cargo check 0 错 1 既有警;cargo test 183 -> 184 过、9 -> 8 挂,
无 60 秒告警;todo!() 44 -> 43;regen r47/r48 两遍 crates 树 md5 一致
(c901e0568960a49ffb61ec6101e043b4)。
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/func-fswatch:feat/func-fswatch
git checkout feat/func-fswatch
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: idealjs/tsox#29