[FEATURE] Create temporary objects and atomically replace build outputs #30

Closed
opened 2026-10-02 07:48:04 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Build tools need exclusive temporary files and directories plus atomic publication in their delegated output trees. The existing native creation and rename effects need a reusable client composition and combined lifetime controls.

Proposed behavior and scope

Add a bounded client operation over the existing compatibility protocol: six trailing template characters, explicit caller-supplied seed and path/base, read-write exclusive file creation at mode 0600 or directory creation at mode 0700. Only a fully correlated EEXIST with retired original caller permits advancing to another candidate. Enumerate the complete six-character alphabet without an arbitrary retry count. Use existing original-entry rename for atomic output replacement, retaining open source and displaced-object lifetime and explicit same-filesystem constraints.

Authority, security and reliability

Use only the admitted client ingress and its original root/cwd/dirfd ceiling. Do not discover a temporary directory, read environment paths, acquire entropy, change umask or add capabilities. Candidate names are descriptive, not secrets or entropy. Native exclusive creation remains the race boundary. Preserve original caller custody on incomplete or uncertain effects. An unreported successful creation is not automatically unlinked by spelling. Atomic visibility and crash durability are separate: existing file and directory sync retain their actual provider guarantees.

Acceptance criteria

Checklist
  • Implement reusable native-client temporary file/directory creation, exact template validation, collision-only progression and original-call lifetime.
  • Cover atomic output replacement, prior readers, held source descriptors, cross-filesystem refusal and cleanup in the actual compatibility filesystem workload.
  • Author independent client and sealed-service controls for collisions, hostile replies, refusal, exhaustion, permissions and uncertain cleanup.
  • Complete inline documentation, authority/code-size review, component/manual updates, coherent signed revisions and public tracking.

Alternatives and tradeoffs

Compose existing exclusive creation and conditional rename instead of adding another wire opcode or provider mutation. A caller-supplied candidate seed avoids hidden clock, process, environment or entropy dependencies. Complete candidate-space exhaustion is a real finite representation limit; transport and filesystem errors are returned without search or replay. Predictable candidates are unsuitable as secrets. C entry points remain part of the separately tracked libc runtime integration.

Tracking and rollout

Coordinate filesystem semantics, namespace lifetime, Posixd review and phase completion. Tests, builds, lint, generated documentation, VM/profiler execution and CI observation remain deferred under the execution waiver. Authored controls are unrun. Both full EriX guest generations and external Rust/LLVM guest rebuilding remain required.

Temporary objects and atomic output completion — 2 October 2026

Full libc integration, both full EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed.

Related records and contracts
Repository Links
posixd issue 30, issue 31, temporary-output.md
## Problem and motivation Build tools need exclusive temporary files and directories plus atomic publication in their delegated output trees. The existing native creation and rename effects need a reusable client composition and combined lifetime controls. ## Proposed behavior and scope Add a bounded client operation over the existing compatibility protocol: six trailing template characters, explicit caller-supplied seed and path/base, read-write exclusive file creation at mode 0600 or directory creation at mode 0700. Only a fully correlated EEXIST with retired original caller permits advancing to another candidate. Enumerate the complete six-character alphabet without an arbitrary retry count. Use existing original-entry rename for atomic output replacement, retaining open source and displaced-object lifetime and explicit same-filesystem constraints. ## Authority, security and reliability Use only the admitted client ingress and its original root/cwd/dirfd ceiling. Do not discover a temporary directory, read environment paths, acquire entropy, change umask or add capabilities. Candidate names are descriptive, not secrets or entropy. Native exclusive creation remains the race boundary. Preserve original caller custody on incomplete or uncertain effects. An unreported successful creation is not automatically unlinked by spelling. Atomic visibility and crash durability are separate: existing file and directory sync retain their actual provider guarantees. ## Acceptance criteria <details> <summary>Checklist</summary> - [x] Implement reusable native-client temporary file/directory creation, exact template validation, collision-only progression and original-call lifetime. - [x] Cover atomic output replacement, prior readers, held source descriptors, cross-filesystem refusal and cleanup in the actual compatibility filesystem workload. - [x] Author independent client and sealed-service controls for collisions, hostile replies, refusal, exhaustion, permissions and uncertain cleanup. - [x] Complete inline documentation, authority/code-size review, component/manual updates, coherent signed revisions and public tracking. </details> ## Alternatives and tradeoffs Compose existing exclusive creation and conditional rename instead of adding another wire opcode or provider mutation. A caller-supplied candidate seed avoids hidden clock, process, environment or entropy dependencies. Complete candidate-space exhaustion is a real finite representation limit; transport and filesystem errors are returned without search or replay. Predictable candidates are unsuitable as secrets. C entry points remain part of the separately tracked libc runtime integration. ## Tracking and rollout Coordinate [filesystem semantics](https://git.erikinkinen.fi/erix/posixd/issues/2), [namespace lifetime](https://git.erikinkinen.fi/erix/posixd/issues/27), [Posixd review](https://git.erikinkinen.fi/erix/posixd/pulls/5) and [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). Tests, builds, lint, generated documentation, VM/profiler execution and CI observation remain deferred under the execution waiver. Authored controls are unrun. Both full EriX guest generations and external Rust/LLVM guest rebuilding remain required. ### Temporary objects and atomic output completion — 2 October 2026 Full libc integration, both full EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | posixd | [issue 30](https://git.erikinkinen.fi/erix/posixd/issues/30), [issue 31](https://git.erikinkinen.fi/erix/posixd/issues/31), [temporary-output.md](https://git.erikinkinen.fi/erix/posixd/src/branch/feature/posix-compat/docs/temporary-output.md) | </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#30
No description provided.