[FEATURE] Implement source-qualified file status and seekable directories #25

Closed
opened 2026-09-30 13:23:19 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Compatibility clients need stat/fstat/lstat/fstatat, readdir and seekable directory iteration for real build workloads. The current descriptive FileStatus type and native legacy stat reply do not supply a complete authenticated bridge: filesystem/file identity is absent, timestamp zero can mean unknown, and directory cursors do not yet belong to shared compatibility descriptions. Opening a file for read merely to stat it would impose the wrong final-file permission requirement.

Proposed behavior and scope

Implement a source-qualified native metadata snapshot and exact held-object transport through LibIPC, the filesystem providers and Vfsd. Bind filesystem/file identity to original native objects; never derive it from a pathname, open handle or lossy hash. Preserve complete signed timestamp values, explicit precision and source/unavailability, independent ctime and mtime, owner/mode/link counts, and real symlink size. Initialize required volatile metadata from original trusted clock evidence instead of claiming a later query time was the creation time.

Connect compatibility status through Posixd's authenticated root/cwd/dirfd traversal and original shared descriptions. Path status requires search on real prefixes but does not acquire final-file Read authority. lstat/no-follow inspects the original link. fstat uses the retained description without reopening by path and handles all supported descriptor backends honestly. Reuse and refactor the existing original-candidate walk/custody machinery instead of duplicating a resolver.

Add original-directory enumeration with correct dot and dot-dot identities, root clamping and mounted overlays. Retain a shared cursor and support tell/seek/rewind without stealing bits from a provider's full-width cursor or publishing uninitialized names. Metadata/entry result capacity must be admitted before cursor effects; aliases and cancellation preserve the actual outcome. Update native workloads, contracts/manual and the signed immutable dependency graph. Existing rename/unlink lifetime, locks and event-driven poll work remains separately tracked; no source finding discovered here is waived as a test failure.

Authority, security and reliability

The original client receiver, realm generation and delegated scope select the namespace. Native provider routes, object pins and mount identities come only from retained owners. Numeric device/inode/cookie/status fields confer no authority. No ambient lookup, process grant, filesystem reopening fallback, fabricated zero timestamp, hidden unbounded identity map or reply-selected provider is allowed. Unknown fields remain explicitly unknown; the compatibility bridge must never fabricate a successful complete stat result from incomplete evidence.

Retain original provider caller and server custody across partial failure, cancellation, revoked scopes and malformed replies. No accepted native effect may be replayed because its result was lost. Source-qualified observations remain descriptive and do not replace current permission admission. Use counted existing storage or explicit added resource geometry, nonwrapping generations and exact teardown before reuse. Security, reliability, then performance govern the design.

Acceptance criteria

Checklist
  • Define exact source-qualified status and directory wire contracts with independent hostile/atomic-encoding controls.
  • Supply original provider identities, complete required metadata and honest signed time/source/precision semantics, including volatile roots and mutations.
  • Route held-object metadata and mounted directory enumeration through Vfsd with exact original scope, no authority widening and full-width cursors.
  • Implement compatibility path/fd stat families with correct follow/search/error behavior and original native cleanup.
  • Implement shared-description readdir/tell/seek/rewind, dot entries, alias behavior, result-capacity admission and cancellation.
  • Author meaningful unit/provider/native integration controls; audit/refactor touched code and update inline/component/manual documentation.
  • Publish signed immutable revisions and reconcile owning issues, affected PRs and the Phase6 master with exact metadata/readbacks.

No pass, measured speedup or guest rebuild is claimed; both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required.

Alternatives and tradeoffs

Do not reinterpret existing unknown-zero legacy replies as observed metadata, use handles as inode numbers, or hash paths into identities. Preserve the existing counted native owners and add exact observation contracts. No terminal file Read admission is needed merely to return metadata after authorized traversal. Timestamp and filesystem-format limitations need explicit source distinctions and checked errors, not saturation or invented values.

The behavior is derived independently from the public stat structure contract, directory interfaces and directory iteration specification. No third-party implementation code is imported.

Tracking and rollout

Implemented and closed under source acceptance; test and CI execution remain waived.

Complete original metadata and status/directory source acceptance — 1 October 2026

Source acceptance covers explicit format admission/recovery, persistent original identities and full metadata, shared ordinary/acquired observations, fresh permissions, atomic filesystem/catalog updates, alias and cleanup lifetime, compatibility stat families and shared seekable directory descriptions. Imported unavailable facts remain explicit refusals.

Runtime and independent fixture producers emit the mandatory stream allocation flag, which admission and image verification require.

This checkpoint authors 14 Rust and four Python controls plus two selected exFAT VM scenarios; two existing FAT scenarios now also require six-child directory growth, post-growth observations and complete cleanup.

Both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed.

Related records and contracts
Repository Links
docs PR 4
fatd issue 10, issue 8, issue 9, PR 3, exfat-directory-mutation.md, original-catalog.md
integration issue 65, PR 12
posixd issue 25, PR 5
rootd PR 2
## Problem and motivation Compatibility clients need stat/fstat/lstat/fstatat, readdir and seekable directory iteration for real build workloads. The current descriptive FileStatus type and native legacy stat reply do not supply a complete authenticated bridge: filesystem/file identity is absent, timestamp zero can mean unknown, and directory cursors do not yet belong to shared compatibility descriptions. Opening a file for read merely to stat it would impose the wrong final-file permission requirement. ## Proposed behavior and scope Implement a source-qualified native metadata snapshot and exact held-object transport through LibIPC, the filesystem providers and Vfsd. Bind filesystem/file identity to original native objects; never derive it from a pathname, open handle or lossy hash. Preserve complete signed timestamp values, explicit precision and source/unavailability, independent ctime and mtime, owner/mode/link counts, and real symlink size. Initialize required volatile metadata from original trusted clock evidence instead of claiming a later query time was the creation time. Connect compatibility status through Posixd's authenticated root/cwd/dirfd traversal and original shared descriptions. Path status requires search on real prefixes but does not acquire final-file Read authority. lstat/no-follow inspects the original link. fstat uses the retained description without reopening by path and handles all supported descriptor backends honestly. Reuse and refactor the existing original-candidate walk/custody machinery instead of duplicating a resolver. Add original-directory enumeration with correct dot and dot-dot identities, root clamping and mounted overlays. Retain a shared cursor and support tell/seek/rewind without stealing bits from a provider's full-width cursor or publishing uninitialized names. Metadata/entry result capacity must be admitted before cursor effects; aliases and cancellation preserve the actual outcome. Update native workloads, contracts/manual and the signed immutable dependency graph. Existing rename/unlink lifetime, locks and event-driven poll work remains separately tracked; no source finding discovered here is waived as a test failure. ## Authority, security and reliability The original client receiver, realm generation and delegated scope select the namespace. Native provider routes, object pins and mount identities come only from retained owners. Numeric device/inode/cookie/status fields confer no authority. No ambient lookup, process grant, filesystem reopening fallback, fabricated zero timestamp, hidden unbounded identity map or reply-selected provider is allowed. Unknown fields remain explicitly unknown; the compatibility bridge must never fabricate a successful complete stat result from incomplete evidence. Retain original provider caller and server custody across partial failure, cancellation, revoked scopes and malformed replies. No accepted native effect may be replayed because its result was lost. Source-qualified observations remain descriptive and do not replace current permission admission. Use counted existing storage or explicit added resource geometry, nonwrapping generations and exact teardown before reuse. Security, reliability, then performance govern the design. ## Acceptance criteria <details> <summary>Checklist</summary> - [x] Define exact source-qualified status and directory wire contracts with independent hostile/atomic-encoding controls. - [x] Supply original provider identities, complete required metadata and honest signed time/source/precision semantics, including volatile roots and mutations. - [x] Route held-object metadata and mounted directory enumeration through Vfsd with exact original scope, no authority widening and full-width cursors. - [x] Implement compatibility path/fd stat families with correct follow/search/error behavior and original native cleanup. - [x] Implement shared-description readdir/tell/seek/rewind, dot entries, alias behavior, result-capacity admission and cancellation. - [x] Author meaningful unit/provider/native integration controls; audit/refactor touched code and update inline/component/manual documentation. - [x] Publish signed immutable revisions and reconcile owning issues, affected PRs and the Phase6 master with exact metadata/readbacks. No pass, measured speedup or guest rebuild is claimed; both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required. </details> ## Alternatives and tradeoffs Do not reinterpret existing unknown-zero legacy replies as observed metadata, use handles as inode numbers, or hash paths into identities. Preserve the existing counted native owners and add exact observation contracts. No terminal file Read admission is needed merely to return metadata after authorized traversal. Timestamp and filesystem-format limitations need explicit source distinctions and checked errors, not saturation or invented values. The behavior is derived independently from the public [stat structure contract](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html), [directory interfaces](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html) and [directory iteration specification](https://pubs.opengroup.org/onlinepubs/007904875/functions/readdir_r.html). No third-party implementation code is imported. ## Tracking and rollout Implemented and closed under source acceptance; test and CI execution remain waived. ### Complete original metadata and status/directory source acceptance — 1 October 2026 Source acceptance covers explicit format admission/recovery, persistent original identities and full metadata, shared ordinary/acquired observations, fresh permissions, atomic filesystem/catalog updates, alias and cleanup lifetime, compatibility stat families and shared seekable directory descriptions. Imported unavailable facts remain explicit refusals. Runtime and independent fixture producers emit the mandatory stream allocation flag, which admission and image verification require. This checkpoint authors 14 Rust and four Python controls plus two selected exFAT VM scenarios; two existing FAT scenarios now also require six-child directory growth, post-growth observations and complete cleanup. Both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | docs | [PR 4](https://git.erikinkinen.fi/erix/docs/pulls/4) | | fatd | [issue 10](https://git.erikinkinen.fi/erix/fatd/issues/10), [issue 8](https://git.erikinkinen.fi/erix/fatd/issues/8), [issue 9](https://git.erikinkinen.fi/erix/fatd/issues/9), [PR 3](https://git.erikinkinen.fi/erix/fatd/pulls/3), [exfat-directory-mutation.md](https://git.erikinkinen.fi/erix/fatd/src/branch/feature/posix-compat/docs/exfat-directory-mutation.md), [original-catalog.md](https://git.erikinkinen.fi/erix/fatd/src/branch/feature/posix-compat/docs/original-catalog.md) | | integration | [issue 65](https://git.erikinkinen.fi/erix/integration/issues/65), [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12) | | posixd | [issue 25](https://git.erikinkinen.fi/erix/posixd/issues/25), [PR 5](https://git.erikinkinen.fi/erix/posixd/pulls/5) | | rootd | [PR 2](https://git.erikinkinen.fi/erix/rootd/pulls/2) | </details>
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:07 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/posixd#25
No description provided.