Skip to content

[upstream pr #518] Report mtime and nlink from fs.stat, and mode, mtime and nlink from fs.list #46

Open

Description

@mengmengmengqiang

[upstream PR Ephemeral-AI-Lab#518] Report mtime and nlink from fs.stat, and mode, mtime and nlink from fs.list

Original body (excerpt)

Closes Ephemeral-AI-Lab#486.

fs.stat already reports mode. Readers that use only the Store still had to
call 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.stat reports mtimeSeconds, mtimeNanoseconds and nlink beside
    type, inode, size and mode.
  • fs.list entries report mode, mtimeSeconds, mtimeNanoseconds and
    nlink beside name, path, type and inode.
  • nlink is the committed namespace link count: 0 for the root, 1 for any
    other directory or symlink, and the number of names for a regular file.
    Hard-linked names share inode.
  • mtimeSeconds / mtimeNanoseconds are 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.
  • Inline portable metadata is still served from the inode value (no object
    read). Root-form metadata uses the listing's existing memo.
  • The listing reply budget per entry is 240 bytes to cover the extra fields.
  • CLI summaries for fs stat and fs list name the new fields.
  • Docs: api/docs/agent.md covers the fields and the listing.

No Store format change: every entry already stores mode, mtime and the
namespace link count. inode was already the hard-link group id.

Commits

  • feature, tests, docs and golden. Production LOC: 102831 -> 102851 (delta +20).

Tests

No test deleted or weakened. The sdk_methods golden adds the new fields to
its fs.stat and fs.list lines; mtime integers are masked as <varies>.

  • New engine/crates/layerfs-api/tests/fs_stat_metadata.rs: Init keeps a
    host mtime and hard link; fs.stat and fs.list agree; a content write's
    mtime reads back; main is untouched.
  • sdk_method_golden, sdk_list_entries, fs_mode, stat_symlink,
    write_refusals: pass.
  • rustfmt, and Clippy -D warnings on layerfs-store-service and
    layerfs-api: clean.
  • JS against the fake binding: api/agent/test/calls.mjs and
    api/cli/test/cli.test.mjs: pass.

Not run: the macOS/Windows worker routes. They forward the same SDK calls and
were not changed.

Author

  • I ran the checks listed above
  • Docs match the implemented fields

Demo

demo

Sync note

这是只读镜像,不是上游仓库的替代。上游 issue/PR 仍是唯一真源;本镜像不复制评论、不复制代码分支。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-prMirrored upstream pull request as an issueupstream-syncMirror of Ephemeral-AI-Lab/layerfs upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions