notes

Navigating a system with no global namespace (milestone 47's commands)

cd, pwd, ls, mkdir, rm, on a machine where there is no / to root anything in and no ambient authority to reach with. The keystone that made these possible is the directory capability, which you should read first: the six-rung rights ladder, OPENDIR handing back authority rather than bytes, and fs_subtree_caretaker as the subtree caretaker. That note calls this part "the easy part once this exists", which was true of four of the five verbs.

The governing constraint is calef's, and it is not a technical one: "I hate Windows/DOS specifically because they went differently than virtually every other OS I've used." Gratuitous divergence taxes every user forever. So the bar is not "is this more capability-pure", it is "does the model actually force this", and three divergences clear it. The rest of Unix's surface survives.

The pure half is crates/grant_plan/src/nav.rs (host-tested in milliseconds); the requests are components/src/swish/navigation.rs; the wire verb rm needed is file_system_contract::file_system::UNLINK with Server::unlink behind it; the guest proof is system_tests/src/user/shell_navigation_tests.rs and the host half is xtask::shell_navigation_landed.

They are builtins, and that retires a worry rather than dodging one

Same category as caps: they spawn nothing, need no grant, and confer no new authority, because the shell is reading and rebinding a capability it already holds. A working directory, in capability terms, is a directory capability used as the default base for resolving names, and held by the shell that is entirely legitimate, the same as its untyped budget.

The worry this retires was raised while designing ls: a listing program would have to be handed the power to read everything it lists, which is the over-granting this whole milestone exists to refuse. It is not a program. Nothing is granted, so nothing is over-granted.

What is bad about Unix's cwd is three specific things, and cd is none of them:

  1. Children inherit it silently, so every process gets a starting point nobody granted it.
  2. Relative paths resolve implicitly, so a program's reach depends on invisible state.
  3. .. walks out, so the cwd bounds nothing.

The two earned divergences, and the one that was retired

The third was "no absolute paths", and it came out on 2026-08-18 (milestone 47's namespace half). It was never a position, it was the honest state of a system that had no namespace to root a path in: the syntax was refused rather than quietly reinterpreted as relative, and grant_plan::navigation::Refused carried an Absolute variant saying so. What replaced it is Plan 9's answer, which this note's own first paragraph on the subject named as the recommendation for later:

It grants nothing, and that is the whole of the argument for it. /a/b is cd to your root followed by two descents: exactly the walk you could already take, spelled in one token. /.. is refused for the same reason .. at the root is, because your root is the only root there is and there is no level above it to name. The negative control is in the guest suite rather than in this paragraph: the two shells run the same two probes with a leading slash (navscape::ABSOLUTE_REACHED_INNER and ABSOLUTE_REACHED_SECRET) and each reaches exactly the file its own root contains. A / rooted in anything global would set both bits in both reports.

What forced it was pwd printing a path nobody could type back. DirectoryPath::render has answered /logs/2026 since the day it was written, because naming a position relative to your own root is the only honest rendering; and typing that same token back was a refusal. A round trip that does not close is the tell that a refusal has outlived its reason (§71's promotion trigger, met exactly). Milestone 64 supplied the second half of the demand from the other side: a std program is not a shell, cannot be told to cd, and builds paths with Path::join, so current_dir() had no answer it could give.

One divergence that is not earned and was not taken: cd with no operand. Unix goes to $HOME; there is no environment here (that is out of this lane's scope), so bare cd goes to your root, which is the one distinguished place a shell has and is exactly what it was granted.

The cwd stops at the process boundary

This is the rule most likely to be got wrong, and the place it is made true is grant_plan::FileGrant.

wc report.txt resolves the name against the shell's position at the moment the grant is made. plan_against walks any leading path once, there, and records where it landed as a value:

pub struct FileGrant<'a> {
    pub dir: navigation::DirectoryPath,   // where the name was resolved, fixed at plan time
    pub name: &'a [u8],  // always a single component
    pub writable: bool,
}

The child receives a capability to that one file. It has no cwd, inherits nothing, and cannot re-resolve anything: the convenience is the shell's, the authority is explicit. A child that could re-resolve a name later would have ambient authority smuggled in through a string.

That dir is a value and not a pointer to the shell's position is what makes it structural rather than a promise, and there is a host test that moves the shell afterwards and checks the grant did not follow. a_name_is_resolved_against_the_shells_position_at_grant_time is the whole rule in one test.

A consequence worth naming: the resolver lives in the client, which is the roadmap's recommendation over putting a path walker in the server. The FS server still only ever sees a single component relative to a capability presented to it, so §27's rule is intact, and a path is N OPENDIRs from the shell rather than one walk in a server.

rm separates two things Unix conflated, and one of them is not offered

Why revoke is absent is a fact about the contract rather than a preference: it would mean invalidating handles the FS server minted for clients it cannot enumerate. The handle table is per server (that is dir-capability.md's structural finding), and the server does not track which client holds which handle. §13 revokes frames and §16 revokes objects because the kernel owns those tables; nothing owns this one that way yet. partsfoundry/generational_table's generational names would make a revoked handle fail safely once something does.

RedoxFS frees a node the instant its last link goes, so remove_node plus a handle table alone would remove the object: a read after an unlink would get ENOENT from a deallocated node. The engine has the right mechanism (on_open_node/on_close_node and a release list, which is Unix's deferred delete), and our handle table has to drive it, because the table is ours.

So Server::open_file_at and Server::create_file_at register the node as open and Server::close deregisters it, and that pairing is what makes this verb an unlink. The sabotage check is direct: delete either registration and unlink_takes_the_name_and_leaves_the_object_for_whoever_holds_it goes red. The test goes through both doors, because one that exercised only the create path stays green with the open registration deleted.

The cost is stated where it is paid: a handle nobody closes pins the node for the life of the server, exactly as a leaked fd does on Unix, and this table outlives its clients.

rm refuses a directory, and rmdir removes only an empty one

UNLINK answers EISDIR for a directory, which is POSIX's own answer. The directory verb is file_system_contract::file_system::RMDIR, from DECISIONS §49 (removal is a directory operation), which refuses a non-empty directory with ENOTEMPTY; navscape::RMDIR_REFUSED_NON_EMPTY and RMDIR_REMOVED_EMPTY prove the two halves. The reasoning that shaped it: a single call that removed whatever it found is how one word takes a subtree away. So the recursion in rm -r lives in userspace as a loop of individually safe steps and no single call on this contract can take a subtree away.

Two shells, two roots, and neither can name the other's files

The headline, and it is proven with the real shell binary: components/src/swish.rs grew a role that reads a script instead of a keyboard, holding a fs_subtree_caretaker's narrowed endpoint where the interactive one holds a terminal. So what the guest test exercises is what the prompt exercises, not a reimplementation of it, and the thing being confined is a shell.

  /            motd  scratch  sub/  other/
  /sub         inner  deeper/       <- shell A is rooted here
  /other       secret               <- shell B is rooted here

Neither shell is told which subtree it holds. Each tries to open inner and secret and reports which it reached, so the property is read off the pair of reports rather than claimed by either. Shell A reaches inner and not secret; shell B the reverse. The same crossing holds for what their listings contain, because a listing is a rendering of authority and a stranger in one is an escape even though nothing was opened.

Not by policy. The FS server can reach both directories on any request it likes, and each caretaker one hop up holds the whole image root. What stops each shell is that no capability reaching the other subtree exists in its capability table.

The falsification is cheap and was run: point the second shell at sub as well, and two_shells_with_different_roots_cannot_name_each_others_files fails with "it opened a file that exists only in the OTHER shell's root".

The two runs are sequential, and that is a fact about the harness rather than about the model. All three processes in a caretaker chain share one page with the FS server, so two live clients would scribble over each other's requests. Being alive at the same instant would prove no more than this does; they are separate processes with separate roots either way.

And from outside the guest

xtask::shell_navigation_landed reads the image the run left behind with the pinned engine, for both subtrees. In each: the name the shell kept is there, the directory it made is there, and the name it removed is not. The pair is what makes it non-vacuous, since a shell that created nothing satisfies "what it removed is gone" perfectly. And no name of either shell's making is in the image root, which is the upward escape.

What the shell had to be told, because nothing on the wire will say

There is no verb that reports what a handle carries. That matters here rather than being a curiosity. OPENDIR refuses with EPERM when the intersection is smaller than the request (deliberately, per the rule against silent degradation in §42 (a filesystem declares what it offers and must be truthful)). So a shell that asked for dir::ALL from a narrower capability could not cd at all. It has to ask for exactly what it holds.

So the shell is told its rights at spawn, in the same file_system_contract::grant::spec word the caretaker's own grant rides in. That works and it is a gap. A program handed a directory capability by someone else has no way to ask what it can do with it. Its options are to be told out of band or to probe by attempting things. Reported rather than fixed, because widening the contract to suit a builtin is the wrong direction, and because "what does this capability carry" is a question caps should be able to answer for every capability rather than a flag on one verb.

BUGS

EXAMPLES

At a prompt with a directory capability (the navigating role's script, spelled as you would type it):

$ pwd
  /
$ cd ..
  you are at your root; there is nothing above it to name
$ cd /..
  you are at your root; there is nothing above it to name
$ ls
  deeper/
  inner
$ cd deeper
$ pwd
  /deeper
$ cd /
$ pwd
  /
$ cd deeper
$ ls /
  deeper/
  inner
$ cd ..
$ mkdir logs
$ rm logs
  that is a directory

Unlink, and the thing that makes it an unlink:

// redoxfs_server/src/lib.rs, and its test in redoxfs_server/src/tests/directory_capability.rs
let h = srv.create_file_at(sub, "doomed").unwrap();
srv.write(h, 0, b"the bytes outlive the name").unwrap();
srv.unlink(sub, "doomed").unwrap();
assert!(srv.open_file_at(sub, "doomed").is_err());   // the name is gone
srv.read(h, 0, &mut buf).unwrap();                   // and the object is not

Resolve at grant time, from the shell's side:

// grant_plan: the grant records WHERE it was resolved, as a value
let g = plan_against(&run, prog, m, holds)?.file.unwrap();
// g.dir is the directory as it stood when the line was typed; a later `cd` cannot change it,
// and the child holds a capability to g.name in g.dir and no way to name anything else.

Run it:

script/test                  # both ISAs, plus the post-run host check on the image
cargo test -p grant_plan          # the cwd, the clamp, and resolve-at-grant-time
cargo test --manifest-path redoxfs_server/Cargo.toml   # unlink, and that it is not a revoke