Repository navigation
Proc
The read-only virtual /proc directory (T54, the Unix design principle): which files it has, what they hold, that nothing under it can be changed, and that the shell, the agent tools and WASI programs read it through the same fs.rs path layer.
The system SHALL serve a virtual directory /proc with the files cpuinfo, meminfo, uptime, version, devices, kmsg, mounts, judge and bus/pci/devices (directories bus and bus/pci), generated when read, and SHALL list proc/ in the root directory.
Source: kernel/src/procfs.rs ENTRIES, entry, list, read; kernel/src/fs.rs list, mount_of
-
WHEN the user types
!ls /proc - THEN the shell lists bus/, cpuinfo, devices, judge, kmsg, meminfo, mounts, uptime and version with their sizes
- WHEN a program opens /proc/nope
- THEN it gets not found (WASI ENOENT)
cpuinfo SHALL hold one block per core (processor, model name, cpu MHz, cpu cores, role) with the CPUID flags under their Linux names in processor 0 only, the other blocks saying flags: as processor 0; meminfo SHALL hold MemTotal, MemFree, MemAvailable, ModelWeights, SnapshotPool and KernelHeap in kB; version SHALL start with ringzero version and the package version.
Source: kernel/src/procfs.rs cpuinfo, flags, meminfo, read
-
WHEN the user types
!cat /proc/meminfo -
THEN the lines
MemTotal:,MemFree:andMemAvailable:show kB values
- WHEN the CPU has AVX2, FMA and F16C
-
THEN the flags line of processor 0 in /proc/cpuinfo contains avx2, fma and f16c and the other blocks say
flags: as processor 0
devices SHALL list the active drivers (serial, keyboard, framebuffer, block, filesystem), and bus/pci/devices SHALL list every function on PCI bus 0 as bus:dev.fn vendor:device class (code), driver.
Source: kernel/src/procfs.rs devices, pci, pci_scan, class; kernel/src/blk.rs location; kernel/src/console.rs devices
- WHEN the system booted with a virtio-blk disk
-
THEN /proc/devices has a
block virtio-blk: PCI 00:DD.F, N MiBline and /proc/bus/pci/devices marks that functionvirtio-blk
Every change under /proc (write, append, truncate, mkdir, rm, rename, create) SHALL fail with read-only file system, and a WASI program SHALL get EROFS (69) for an open with write rights, a create, mkdir, unlink or rename there.
Source: kernel/src/fs.rs ROFS, mount_of, check_rw; kernel/src/wasm.rs data_ro, ROFS
-
WHEN the user types
!write /proc/version x -
THEN the shell prints an error with
read-only file systemand nothing changes
- WHEN python3 opens /proc/uptime for writing
- THEN the open fails with EROFS
The shell (!ls, !cat), the agent's ls and cat tools and WASI programs SHALL read /proc through the same fs.rs functions; a WASI open of a /proc file SHALL generate the content once and serve read, seek and fstat from those bytes.
Source: kernel/src/fs.rs read, ls, entry, list, virt_read, tree_entry, tree_list; kernel/src/wasm.rs path_open, fd_read, fd_seek, OpenFile
-
WHEN the user types
!run cat /proc/cpuinfo -
THEN cat prints the same blocks as
!cat /proc/cpuinfo
- WHEN the model calls cat with path /proc/devices
- THEN the tool result is the driver list
/proc/kmsg SHALL hold the kernel log ring, oldest line first, as a snapshot taken at read time; /proc/mounts SHALL list one line per mount: /dev/vda / vfat rw, proc /proc proc ro, sysfs /sys sysfs ro and devfs /dev devfs rw (the first line only when a disk is mounted).
Source: kernel/src/procfs.rs ENTRIES, read; kernel/src/log.rs
-
WHEN the user types
!cat /proc/mountson a machine with a disk -
THEN the output has the four lines, the first one
/dev/vda / vfat rw
-
WHEN the user types
!run rg disk /proc/kmsg -
THEN rg prints the kernel log lines that contain
disk
/proc/uptime SHALL start with the seconds since boot as a decimal number, followed by seconds (H h M min S s).
Source: kernel/src/procfs.rs read
-
WHEN python3 runs
float(open('/proc/uptime').read().split()[0]) - THEN it gets the seconds since boot
/proc/judge SHALL hold the goal judge's switch (judge: on|off), its model (decider-0.8b (T103 tune), Q8_0 or not loaded), the threshold, the counts of turns judged done, judged not done and skipped since boot, and the last 64 verdict lines, oldest first; each verdict line is the [judge] line the console printed.
Source: kernel/src/judge.rs proc, record; kernel/src/procfs.rs ENTRIES, read
-
WHEN judge is on, a turn with tool calls ends and the user types
!cat /proc/judge -
THEN the last line starts with
[judge] P(goal reached)and names the verdict and the request
Source of this page: openspec/specs/proc/spec.md
Generated from openspec/specs at 0221909 by tools/wiki_gen.py. Do not edit here: change the spec and regenerate.