notes

The shell's witness scripts

Name: provisional, after components/src/swish/witness.rs. calef names files.

nifeos/nife:components/src/swish/witness.rs holds the test roles system_tests spawns the shell in. Milestone 885 (the shell's test roles become scripts the shipping shell runs) replaces them. This page carries the design each script's doc comment links to.

Every script drives the real shell. Its lines go through dispatch or builtin, the functions the prompt itself calls, so what is under test is the shell and not a reimplementation of it. The lines are chosen so the answers check each other rather than constants.

The piping script

Everything it prints goes over the terminal contract to whoever holds the other end, which in the guest test is the kernel. The transcript is the assertion. date and date | wc are the same binary sent to two destinations. The second one's byte count has to be the first one's length, or the claim that a program cannot tell its destinations apart is false.

The redirecting script

It has the piping wiring plus one filesystem capability. That one capability is the whole difference between a > that is refused and a > that writes a file.

The quoting lines write a name with a space in it and read it back. Without quoting, the > would write to a file called "my.

One witness, not a seventh

The grammar lines of milestone 67 (swish the language) run on this same shell rather than a new role. That is a memory decision, not a filing one. Every scripted shell in the suite is a live process whose frames are never reclaimed. One more put time_tests over the frame pool intermittently, failing with refused to load a user program: Unmappable(OutOfPageFrames). The lines need exactly this wiring, so a second copy of it buys nothing but that failure.

The timing script

It has the piping wiring plus at most one capability, the clock page. That page is the whole difference between a time that reports a duration and one that refuses. The same script runs against three clock states: a published page, a blank page and no page at all. So the refusals come from a capability table, not from a branch anybody wrote for the test.

The navigating script

The shell is told nothing about which subtree it was rooted in, beyond a run index. The index keeps the names it creates distinct across runs that share one image. It tries to name one file that exists only in sub and one that exists only in other, and reports which it reached. So "two shells with different roots cannot name each other's files" is read off the pair of reports, not claimed by either. The two runs are each other's control.

Some steps carry a reason the code cannot show.

The two-tree script

The wiring is fs_service::start_granted_two_dirs. The first tree is the fixture's sub at slot 0, the second its sibling other at slot 1, and a report rendezvous sits at slot 2. The mount point, fixture::twotrees::MOUNT, is the witness's own, as the slot order is. Nothing tells an interactive shell where a second tree is mounted yet; that transport arrives with the first real second filesystem. The < probe goes through grant_plan::input_file_grant and open_source, the pipeline's own path. What is under test is the shell's resolver, walk and grant plumbing.

The globbing script

It shows that echo *.txt prints exactly the authority rm *.txt would transfer. Both halves run in a shell holding a real directory capability behind a real fs_subtree_caretaker. They share the expander, which is the point of there being one, and do not share the plumbing. echo goes from text to words, expansion and print. The grant goes from parse to positionals, expansion, program_table::plan, the grant's names and a rendering. So a planner that narrowed, reordered or added to a set shows up as a disagreement.

Three refusals stop the agreement from being vacuous the other way. One is a pattern that matched nothing. Another is a pattern where one cannot mean anything, in a leading path component. The last is a line with no pattern in it at all, which must come back byte for byte.