Issue #922: std entries the orchestrator’s move needs: sha256, env, file locks, file times and identity

Open and answer this issue on GitHub.

ready · opened 2026-10-28 · updated 2026-11-02 · 2 comments


agent: builder model: opus max_turns: 100 budget_usd: 20 —

Facts

Owner, 2026-10-28: crates/orchestrator moves into Nikaia completely; a missing std entry is no reason for Rust to stay, it is work to plan. Nothing that exists in std moves (owner’s addition, same day); these are new thin entries over Rust, the kind of std that stays Rust by design. Plan: docs/bootstrap.md, section 1, crates/orchestrator. The spawns are #920.

Checked absent in crates/nikaia-std/std.contracts (2026-10-28): any digest but hash::crc32c; any environment read; any file lock; fs::Metadata has only len, is_dir, is_file; time has only the monotonic clock (ADR-368).

Entry (decided signature) Needed by (crates/orchestrator/src/) Rust under it
hash::sha256_hex(data: ref Vec[u8]) -> String sync: lowercase hex, 64 characters cache.rs:46 sha256_hex, :382-418 KeyBuilder sha2 (already a dependency of the toolchain)
env::var(name: ref String) -> String? sync: null when unset, empty or not Unicode; env::temp_dir() -> fs::Path sync cache.rs:638-663 user_cache_dir, :742 limit, project.rs:562 cargo_binary std::env
fs::lock(path: ref fs::Path, root: ref fs::Root; exclusive: bool = false, create: bool = true) -> fs::Lock? throws: a non-blocking flock; null when another holds it; held while the fs::Lock lives (released by its cleanup); create opens read/write without truncating, as open_lock does. Where the platform has no flock: always granted, as today cache.rs:812-843 use_entry/hold/open_lock, :975-994 cargo_holds, :996-1031 mod lock rustix::fs::flock (no unsafe in nikaia-std, ADR-218 D4)
fs::Metadata::modified(self) -> time::Duration sync (since the Unix epoch; zero where unknown), fs::Metadata::links(self) -> u64 sync, fs::Metadata::file_id(self) -> (u64, u64)? sync (device and inode; null off Unix); time::since_epoch() -> time::Duration sync (the wall clock) cache.rs:1142 used_at, :962-973 first_link, :1025 the one-hour rule off Unix std::fs::Metadata, std::os::unix::fs::MetadataExt, SystemTime

The process-wide HELD/ADDED statics (cache.rs:800-803) need no entry: in Nikaia the held locks and the added flag are a value the driver keeps and hands to settle.

To build

  1. hash::sha256_hex: hash.rs, std.contracts, Part III’s std table; test tests/compiler/tests/hash_sha256.nika (+ .stdout, the digest of "one\n" as crates/nikaia/tests/it/cache.rs has it).
  2. env::var, env::temp_dir: a new module env.rs, std.contracts, Part III; test with an env: given to a child through process::run, or nikaia test’s own environment.
  3. fs::lock and fs::Lock: fs.rs, ADR-319 amendment (a lock is a capability on a path under a Root), std.contracts, Part III; test: a second shared lock is granted, an exclusive one beside a shared one is null, dropping releases.
  4. fs::Metadata::modified, links, file_id, time::since_epoch: fs.rs, time.rs, ADR-319 and ADR-368 amendments (the wall clock is not the monotonic one: say why both), std.contracts, Part III; test over a file the program writes.

Each step its own commit; the version raises are the supervisor’s (report a Changelog line). Then the orchestrator moves (O1 cache.rs, O2 project.rs, see the plan) have no Rust left but the toml reading of the compiler’s manifest.rs adapter.

Report

The report form of docs/architect.md, Briefs and reports.

Comments

keywan-ghadami, 2026-10-31

Architect, 2026-10-31: steps 1-2 are briefed as docs/briefs/s922-sha256-env.md (main lane, after BT, before GR).

Steps 3-4 (fs::lock, the Metadata/wall-clock entries) stay open.


Generated by Claude Code

keywan-ghadami, 2026-10-31

Step 4 (fs::Metadata::modified, links, file_id, time::since_epoch) is briefed as docs/briefs/s922b-metadata-times.md, first in the main batch (K3b needs modified). Step 3 (fs::lock) stays open for O1.


Generated by Claude Code

Back to Open Issues