Repository navigation
Conversation
fs.stat now includes mtimeSeconds, mtimeNanoseconds and nlink. Each fs.list entry includes mode, the same mtime pair, and nlink, so a directory listing does not need one fs.stat per name. Seconds and nanoseconds stay separate so a JavaScript Number keeps them exactly. nlink is the committed namespace link count; hard-linked names share inode. Inline portable metadata still costs no object read. The listing memo serves root-form metadata. No Store format change. New fs_stat_metadata test covers Init mtime, hard links, list/stat agreement and a content write. Golden, list-cost, mode, symlink and write-refusal tests pass. Clippy -D warnings on layerfs-store-service and layerfs-api is clean. Fake-binding SDK and CLI tests pass. Deleted tests: none. Production LOC: 102831 -> 102851 (delta +20) First-parent comparison: 35d3657. Scopes: core 38395 -> 38395 (0), engine 61777 -> 61797 (+20), api 2659 -> 2659 (0). Engine layerfs-store-service accounts for all +20. Method: tools/production_loc.py blob 3341e4d, --json on each snapshot. First-party production Rust, runtime SQL and JavaScript; tests, docs, tooling, generated and third-party code excluded. Reference absent (retired R9c; last counted 65,417 at tree 498dd19).
Member
|
感谢贡献,也感谢 AI 协作工具在 #486 的讨论中梳理接口面 🙏 真实评估(已读 diff): 对 AI agent 的使用价值:agent 遍历大目录(如 node_modules、数据集)时不再需要每个 entry 补一次 建议:合入前在真实环境对含硬链接的树实测一次 fs.list 输出,确认 nlink 与 inode 配对正确。功能性调整等 LayerFS 2.0(#446)发布后再做。 |
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.
Closes #486.
fs.statalready reportsmode. Readers that use only the Store still had tocall it once per directory entry for times and link counts, and it did not
report either. This adds those fields end to end.
What changes
fs.statreportsmtimeSeconds,mtimeNanosecondsandnlinkbesidetype,inode,sizeandmode.fs.listentries reportmode,mtimeSeconds,mtimeNanosecondsandnlinkbesidename,path,typeandinode.nlinkis the committed namespace link count: 0 for the root, 1 for anyother directory or symlink, and the number of names for a regular file.
Hard-linked names share
inode.mtimeSeconds/mtimeNanosecondsare the portable modification time(Unix epoch seconds and the fractional second). They are two integers so a
JavaScript Number keeps them exactly. A single nanosecond timestamp is not a
safe integer after 1970.
read). Root-form metadata uses the listing's existing memo.
fs statandfs listname the new fields.api/docs/agent.mdcovers the fields and the listing.No Store format change: every entry already stores mode, mtime and the
namespace link count.
inodewas already the hard-link group id.Commits
Tests
No test deleted or weakened. The
sdk_methodsgolden adds the new fields toits
fs.statandfs.listlines; mtime integers are masked as<varies>.engine/crates/layerfs-api/tests/fs_stat_metadata.rs: Init keeps ahost mtime and hard link;
fs.statandfs.listagree; a content write'smtime reads back;
mainis untouched.sdk_method_golden,sdk_list_entries,fs_mode,stat_symlink,write_refusals: pass.-D warningsonlayerfs-store-serviceandlayerfs-api: clean.api/agent/test/calls.mjsandapi/cli/test/cli.test.mjs: pass.Not run: the macOS/Windows worker routes. They forward the same SDK calls and
were not changed.
Author
Demo