From 075e15fd57dfc2e0fa1c6089ef8bd919f6f09208 Mon Sep 17 00:00:00 2001 From: Clancy Mendonca Date: Sat, 13 Jun 2026 22:09:04 +0530 Subject: [PATCH 1/3] fixup(docs): normalize VALIDATION_GATES formatting Remove broken double-spacing, repair the system-gate table, and document all system gate subsystems. --- docs/VALIDATION_GATES.md | 132 +++------------------------------------ 1 file changed, 7 insertions(+), 125 deletions(-) diff --git a/docs/VALIDATION_GATES.md b/docs/VALIDATION_GATES.md index 2297a50..6d9f8c0 100644 --- a/docs/VALIDATION_GATES.md +++ b/docs/VALIDATION_GATES.md @@ -1,234 +1,116 @@ # Clan OS Validation Gates - - ```yaml - status: authoritative - boot_gate_version: "1.0.0" - system_gate_version: "1.0.0" - kernel_modules: - boot: kernel/src/boot_gate.rs - system: kernel/src/system_gate.rs - scripts_package: scripts/gate/ - ``` - - -Runtime validation is **gate-based**. Boot no longer emits `numbered boot serial` serial lines. Two gate families run sequentially at boot: - - +Runtime validation is **gate-based**. Boot no longer emits per-scope numbered serial lines. Two gate families run sequentially at boot: 1. **Boot gate** (boot subsystems scope) → `ClanOS-BootGate: …` - 2. **System gate** (epochs 7–20 / M500 scope) → `ClanOS-Gate: …` + `ClanOS-SystemGate: …` - - ## Quick validation - - ```bash - cargo check -p kernel - python scripts/gate/host.py - python scripts/gate/boot.py --gate boot --timeout 360 - python scripts/gate/system.py --gate system --timeout 360 - python scripts/validation_matrix.py --smoke-timeout 180 - ``` - - -Legacy shims at `scripts/gate/boot.py` etc. forward to `scripts/gate/` and remain for older docs. - - +Legacy shims at `scripts/gate/boot.py` etc. forward to `scripts/gate/` and remain for older references. ## Boot gate subsystems - - | Gate | Legacy milestone (docs) | Serial line | - -|------|-------------|-------------| - +|------|-------------------------|-------------| | `shell_storage` | 6–8 | `ClanOS-BootGate: name=shell_storage ok=true` | - | `loader_security` | 9–13 | `ClanOS-BootGate: name=loader_security ok=true` | - | `memory_layout` | 14–16 | `ClanOS-BootGate: name=memory_layout ok=true` | - | `userspace_bootstrap` | 17–20 | `ClanOS-BootGate: name=userspace_bootstrap ok=true` | - | `hw_paging` | 21–30 | `ClanOS-BootGate: name=hw_paging ok=true` | - | `sched_userspace` | 31–40 | `ClanOS-BootGate: name=sched_userspace ok=true` | - | `dynamic_runtime` | 41–50 | `ClanOS-BootGate: name=dynamic_runtime ok=true` | - | `fd_mmap` | 51–60 | `ClanOS-BootGate: name=fd_mmap ok=true` | - | `vm_fork` | 61–70 | `ClanOS-BootGate: name=vm_fork ok=true` | - | `syscall_ring3` | 71–80 | `ClanOS-BootGate: name=syscall_ring3 ok=true` | - | `path_exec` | 81–90 | `ClanOS-BootGate: name=path_exec ok=true` | - | `smp_depth` | 91–100 | `ClanOS-BootGate: name=smp_depth ok=true` | - | `constitutional` | 110 | `ClanOS-BootGate: name=constitutional ok=true` | - | `capabilities` | 120 | `ClanOS-BootGate: name=capabilities ok=true` | - | `service_loader` | 121 | `ClanOS-BootGate: name=service_loader ok=true` | - | `platform_brokers` | 130 | `ClanOS-BootGate: name=platform_brokers ok=true` | - | `build_endpoints` | 131–140 | `ClanOS-BootGate: name=build_endpoints ok=true` | - | `virtio_blk` | 201 | `ClanOS-BootGate: name=virtio_blk ok=true` | - | `network_compat` | 404 | `ClanOS-BootGate: name=network_compat ok=true` | - | `scheduler_epoch` | 149 | `ClanOS-BootGate: name=scheduler_epoch ok=true` | - | `boundary` | 150 | `ClanOS-BootGate: name=boundary ok=true` | - | **boot** (summary) | all above | `ClanOS-BootGate: ok=true` | - - Historical scope indices map to gates via `scripts/gate/map.py` (`gate_for_scope`). Prefer `python scripts/gate/boot.py --gate ` or `python scripts/gate/system.py --gate `. - - ## System gate subsystems - - | Gate | Role | Serial line | - |------|------|-------------| - | `integrity` | Build integrity, audit, OOM | `ClanOS-Gate: name=integrity ok=true` | - | `scheduling` | Unified service scheduling | `ClanOS-Gate: name=scheduling ok=true` | - | `hardware` | Virtio + SDK path | `ClanOS-Gate: name=hardware ok=true` | - | `federation` | Federation + observability | `ClanOS-Gate: name=federation ok=true` | - | `release` | Checkpoint, scorecard | `ClanOS-Gate: name=release ok=true` | - | `desktop_preview` | Compositor preview | `ClanOS-Gate: name=desktop_preview ok=true` | - | `desktop` | Full desktop stack | `ClanOS-Gate: name=desktop ok=true` | - - - - - - - - - - | `compat_runtime` | Ring-3 clan-rt corpus | `ClanOS-Gate: name=compat_runtime ok=true` | | `compat_fd_vm` | FD / mmap / CoW | `ClanOS-Gate: name=compat_fd_vm ok=true` | | `compat_signal` | Signal skeleton + delivery | `ClanOS-Gate: name=compat_signal ok=true` | | `storage_depth` | Buddy / VFS / ext2 | `ClanOS-Gate: name=storage_depth ok=true` | | `posix_compat` | POSIX server skeleton | `ClanOS-Gate: name=posix_compat ok=true` | - - - - - - +| `functional` | Composite (includes compat) | `ClanOS-Gate: name=functional ok=true` | +| `ci` | Release CI hardening | `ClanOS-Gate: name=ci ok=true` | +| `production` | Production gate | `ClanOS-Gate: name=production ok=true` | +| `network` | Network stack gate | `ClanOS-Gate: name=network ok=true` | | **system** (summary) | all above | `ClanOS-SystemGate: ok=true` | - - Use `scripts/gate/system.py --gate ` for individual subsystems. - - ## Preemption validation - - Not part of boot/system gate serial lines. Kernel emits: - - - `ClanOS-Preemption: name=fairness T1=… T2=… T3=… T4=… score=…` - - `ClanOS-Preemption: name=latency ticks=… req=… est_ms=…` - - Requires `cargo run -p kernel --features preemption` (context lab; CI only). - - ```bash - python scripts/preemption/soak.py --boot-wait 90 --duration 30 - python scripts/preemption/latency.py --boot-wait 90 --duration 30 - ``` - - Or `scripts/validation_matrix.py` (`preemption-soak-check`, `preemption-latency-check`). - - ## Scope checklists (historical) - - Per-scope checklists under `docs/scope-*-checklist.md` record **implementation scope** for completed work. They are not the runtime validation surface. Use this document and `scripts/gate/` for CI and QEMU smokes. - - ## CI matrix entries - - | Check | Script | - |-------|--------| - | `gate-host-check` | `scripts/gate/host.py` | - | `boot-gate-host-check` | `scripts/gate/boot_host.py` | - | `boot-gate-check` | `scripts/gate/boot.py --gate boot` | - | `system-gate-host-check` | `scripts/gate/system_host.py` | - | `system-gate-check` | `scripts/gate/system.py --gate system` | - | `compat-subsystems-host-check` | `scripts/gate/compat_subsystems.py` | - | `preemption-soak-check` | `scripts/preemption/soak.py` | - | `preemption-latency-check` | `scripts/preemption/latency.py` | - - See also [`RELEASE_SCORECARD_M500.md`](RELEASE_SCORECARD_M500.md). - From e9731b6e120302dbca7eb017ba7c835edf497469 Mon Sep 17 00:00:00 2001 From: Clancy Mendonca Date: Sat, 13 Jun 2026 22:09:11 +0530 Subject: [PATCH 2/3] feat(clanos): align kernel wire identifiers with clan-* ABI Rename remaining ares-exec-v1, ares-info, clan-abi, and CLANFS wire tokens in kernel manifests, governance, and shell dispatch. --- kernel/src/build_integrity.rs | 8 ++++---- kernel/src/elf_reloc.rs | 4 ++-- kernel/src/governance.rs | 16 ++++++++-------- kernel/src/milestone150.rs | 2 +- kernel/src/native_manifest.rs | 2 +- kernel/src/storage.rs | 32 +++++++++++++++---------------- kernel/src/system_gate.rs | 2 +- kernel/src/task/keyboard.rs | 2 +- kernel/src/task/program_loader.rs | 18 ++++++++--------- kernel/src/task/userspace.rs | 6 +++--- kernel/src/user_copy.rs | 2 +- kernel/src/userland_install.rs | 8 ++++---- 12 files changed, 51 insertions(+), 51 deletions(-) diff --git a/kernel/src/build_integrity.rs b/kernel/src/build_integrity.rs index 5a33511..abf1170 100644 --- a/kernel/src/build_integrity.rs +++ b/kernel/src/build_integrity.rs @@ -9,7 +9,7 @@ static BOOT_VERIFIED: AtomicBool = AtomicBool::new(false); static REPRO_MATCHES: AtomicU64 = AtomicU64::new(0); static SIGNED_USER_ELF_VERIFIED: AtomicU64 = AtomicU64::new(0); -pub const KERNEL_IMAGE_TAG: &[u8] = b"aresos-kernel-epoch3"; +pub const KERNEL_IMAGE_TAG: &[u8] = b"clanos-kernel-epoch3"; pub fn system_image_epoch() -> u64 { IMAGE_EPOCH.load(Ordering::Relaxed) @@ -49,8 +49,8 @@ pub fn verify_reproducible_build() -> bool { /// : rollback smoke — prior epoch digest still verifiable. pub fn verify_rollback_anchor() -> bool { - let anchor = image_digest::sha256_hex(b"aresos-epoch-2-anchor"); - image_digest::verify_digest_hex(b"aresos-epoch-2-anchor", &anchor) + let anchor = image_digest::sha256_hex(b"clanos-epoch-2-anchor"); + image_digest::verify_digest_hex(b"clanos-epoch-2-anchor", &anchor) } pub fn smoke_image_identity() -> bool { @@ -67,7 +67,7 @@ pub fn smoke_rollback() -> bool { /// signed user ELF manifest corpus (BUILD_INTEGRITY production path). pub fn verify_signed_user_elf_corpus() -> bool { - let corpus = b"ares-rt demo:hello"; + let corpus = b"clan-rt demo:hello"; let digest = image_digest::sha256_hex(corpus); let manifest = alloc::format!("digest=sha256:{digest}\ntrust=system\n"); let expected = image_digest::parse_manifest_digest(&manifest).unwrap_or(""); diff --git a/kernel/src/elf_reloc.rs b/kernel/src/elf_reloc.rs index a4f9033..ecc974a 100644 --- a/kernel/src/elf_reloc.rs +++ b/kernel/src/elf_reloc.rs @@ -87,7 +87,7 @@ pub fn parse_dt_needed(image_bytes: &[u8]) -> Option<&str> { if image_bytes.windows(7).any(|w| w == b"DT_NEEDED") { return Some("libc_stub"); } - if image_bytes.len() >= 124 && &image_bytes[120..124] == b"ARES" { + if image_bytes.len() >= 124 && &image_bytes[120..124] == b"CLAN" { return Some("libc_stub"); } None @@ -126,7 +126,7 @@ pub struct StaticReloc { pub fn relocs_for_image(image_bytes: &[u8], load_base: u64) -> Vec { let mut relocs = Vec::new(); - if image_bytes.len() >= 124 && &image_bytes[120..124] == b"ARES" { + if image_bytes.len() >= 124 && &image_bytes[120..124] == b"CLAN" { relocs.push(StaticReloc { offset: load_base.saturating_add(120), kind: R_X86_64_RELATIVE, diff --git a/kernel/src/governance.rs b/kernel/src/governance.rs index f0348a8..eee65cd 100644 --- a/kernel/src/governance.rs +++ b/kernel/src/governance.rs @@ -3,11 +3,11 @@ /// Constitutional documentation ratified; gates G1-G5 defined in docs/AXIOMS.md. pub const CONSTITUTIONAL_FOUNDATION_RATIFIED: bool = true; -/// Compat syscall surface frozen as ares-abi-v1 (docs/ABI_SYSCALL.md). -pub const ARE_ABI_V1: bool = true; +/// Compat syscall surface frozen as clan-abi-v1 (docs/ABI_SYSCALL.md). +pub const CLAN_ABI_V1: bool = true; -/// Native semantic laws draft ratified as ares-semantics-v1 (docs/ABI_STABILITY.md). -pub const ARE_SEMANTICS_V1: bool = true; +/// Native semantic laws draft ratified as clan-semantics-v1 (docs/ABI_STABILITY.md). +pub const CLAN_SEMANTICS_V1: bool = true; /// Reserved native syscall ID range base (docs/ABI_SYSCALL.md). pub const NATIVE_SYSCALL_ID_BASE: u64 = 256; @@ -18,8 +18,8 @@ pub const IMMUTABLE_OBJECT_IDENTITY: bool = true; /// Returns true when constitutional foundation constants and HW allowlist are consistent. pub fn smoke_constitutional() -> bool { CONSTITUTIONAL_FOUNDATION_RATIFIED - && ARE_ABI_V1 - && ARE_SEMANTICS_V1 + && CLAN_ABI_V1 + && CLAN_SEMANTICS_V1 && IMMUTABLE_OBJECT_IDENTITY && !crate::user_syscall_hw::ALLOWED_HW_SYSCALLS.is_empty() && crate::user_syscall_hw::ALLOWED_HW_SYSCALLS.len() >= 24 @@ -40,8 +40,8 @@ pub fn smoke_cap_compat() -> bool { pub fn status() -> (bool, bool, bool, bool) { ( - ARE_ABI_V1, - ARE_SEMANTICS_V1, + CLAN_ABI_V1, + CLAN_SEMANTICS_V1, IMMUTABLE_OBJECT_IDENTITY, smoke_constitutional(), ) diff --git a/kernel/src/milestone150.rs b/kernel/src/milestone150.rs index 2c8a52b..8dbef66 100644 --- a/kernel/src/milestone150.rs +++ b/kernel/src/milestone150.rs @@ -2,7 +2,7 @@ /// Layer 1: kernel TCB pub const LAYER_KERNEL: bool = true; -/// Layer 2: ares-rt runtime +/// Layer 2: clan-rt runtime pub const LAYER_RUNTIME: bool = true; /// Layer 3: native services pub const LAYER_SERVICES: bool = true; diff --git a/kernel/src/native_manifest.rs b/kernel/src/native_manifest.rs index cac1512..a0ec434 100644 --- a/kernel/src/native_manifest.rs +++ b/kernel/src/native_manifest.rs @@ -1,4 +1,4 @@ -//! `ares-native-v1` manifest validation (scopes 128–129, G4). +//! `clan-native-v1` manifest validation (scopes 128–129, G4). use crate::kernel_object::Rights; diff --git a/kernel/src/storage.rs b/kernel/src/storage.rs index 9e41f5d..2ee7a2b 100644 --- a/kernel/src/storage.rs +++ b/kernel/src/storage.rs @@ -12,7 +12,7 @@ use spin::Mutex; pub const SECTOR_SIZE: usize = 512; pub const DEFAULT_SECTOR_COUNT: usize = 64; -const MAGIC: &[u8; 8] = b"ARESFS1\0"; +const MAGIC: &[u8; 8] = b"CLANFS1\0"; const VERSION: u32 = 1; const HEADER_SECTOR: usize = 0; const DIRECTORY_START_SECTOR: usize = 1; @@ -713,7 +713,7 @@ pub fn sample_elf_fixture_image() -> String { bytes[ph + 32..ph + 40].copy_from_slice(&4u64.to_le_bytes()); bytes[ph + 40..ph + 48].copy_from_slice(&0x1000u64.to_le_bytes()); bytes[ph + 48..ph + 56].copy_from_slice(&0x1000u64.to_le_bytes()); - bytes[120..124].copy_from_slice(b"ARES"); + bytes[120..124].copy_from_slice(b"CLAN"); String::from_utf8(bytes).unwrap_or_else(|_| String::new()) } @@ -723,60 +723,60 @@ fn seed_bootstrap_files(fs: &mut SimpleFs) -> Result<(), Stor ("/README.txt", "Clan OS persistent storage"), ( "/bin/echo", - "ares-exec-v1\nname=echo\nkind=builtin-alias\nentry=echo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Print arguments", + "clan-exec-v1\nname=echo\nkind=builtin-alias\nentry=echo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Print arguments", ), ( "/bin/time", - "ares-exec-v1\nname=time\nkind=builtin-alias\nentry=time\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show uptime", + "clan-exec-v1\nname=time\nkind=builtin-alias\nentry=time\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show uptime", ), ( "/bin/sysinfo", - "ares-exec-v1\nname=sysinfo\nkind=builtin-alias\nentry=sysinfo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show system metrics", + "clan-exec-v1\nname=sysinfo\nkind=builtin-alias\nentry=sysinfo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show system metrics", ), ( "/bin/fsinfo", - "ares-exec-v1\nname=fsinfo\nkind=builtin-alias\nentry=fsinfo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show filesystem status", + "clan-exec-v1\nname=fsinfo\nkind=builtin-alias\nentry=fsinfo\nrequires=execute\ntrust=system\nowner=admin\ndescription=Show filesystem status", ), ( "/bin/demo-hello", - "ares-exec-v1\nname=demo-hello\nkind=builtin-alias\nentry=demo-hello\ndescription=ares-rt demo\ntrust=system\nowner=admin\n", + "clan-exec-v1\nname=demo-hello\nkind=builtin-alias\nentry=demo-hello\ndescription=clan-rt demo\ntrust=system\nowner=admin\n", ), ( - "/bin/ares-info", - "ares-exec-v1\nname=ares-info\nkind=builtin-alias\nentry=ares-info\ndescription=System info\ntrust=system\nowner=admin\n", + "/bin/clan-info", + "clan-exec-v1\nname=clan-info\nkind=builtin-alias\nentry=clan-info\ndescription=System info\ntrust=system\nowner=admin\n", ), ( "/bin/hello", - "ares-exec-v1\nname=hello\nkind=elf64-image\nentry=0x400000\nimage=/bin/hello.elf\nrequires=execute\ntrust=user\nowner=user\ndescription=ELF image validation fixture", + "clan-exec-v1\nname=hello\nkind=elf64-image\nentry=0x400000\nimage=/bin/hello.elf\nrequires=execute\ntrust=user\nowner=user\ndescription=ELF image validation fixture", ), ("/bin/hello.elf", sample_elf.as_str()), ( "/bin/exit42", - "ares-exec-v1\nname=exit42\nkind=elf64-image\nentry=0x400000\nimage=/bin/exit42.elf\nrequires=execute\ntrust=user\nowner=user\ndescription=Exit code 42 fixture", + "clan-exec-v1\nname=exit42\nkind=elf64-image\nentry=0x400000\nimage=/bin/exit42.elf\nrequires=execute\ntrust=user\nowner=user\ndescription=Exit code 42 fixture", ), ("/bin/exit42.elf", sample_elf.as_str()), ( "/bin/tickprobe", - "ares-exec-v1\nname=tickprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/tickprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=Tick probe ELF fixture", + "clan-exec-v1\nname=tickprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/tickprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=Tick probe ELF fixture", ), ("/bin/tickprobe.elf", sample_elf.as_str()), ( "/bin/systrust", - "ares-exec-v1\nname=systrust\nkind=elf64-image\nentry=0x400000\nimage=/bin/tickprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=Trust-gated ELF fixture", + "clan-exec-v1\nname=systrust\nkind=elf64-image\nentry=0x400000\nimage=/bin/tickprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=Trust-gated ELF fixture", ), ( "/bin/syscallprobe", - "ares-exec-v1\nname=syscallprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/syscallprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW syscall probe ELF fixture", + "clan-exec-v1\nname=syscallprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/syscallprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW syscall probe ELF fixture", ), ("/bin/syscallprobe.elf", sample_elf.as_str()), ( "/bin/chdirprobe", - "ares-exec-v1\nname=chdirprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/chdirprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW chdir/getcwd probe ELF fixture", + "clan-exec-v1\nname=chdirprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/chdirprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW chdir/getcwd probe ELF fixture", ), ("/bin/chdirprobe.elf", sample_elf.as_str()), ( "/bin/pipeprobe", - "ares-exec-v1\nname=pipeprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/pipeprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW pipe probe ELF fixture", + "clan-exec-v1\nname=pipeprobe\nkind=elf64-image\nentry=0x400000\nimage=/bin/pipeprobe.elf\nrequires=execute\ntrust=system\nowner=admin\ndescription=HW pipe probe ELF fixture", ), ("/bin/pipeprobe.elf", sample_elf.as_str()), ("/bin/libc_stub.elf", sample_elf.as_str()), diff --git a/kernel/src/system_gate.rs b/kernel/src/system_gate.rs index de99bb3..82f9900 100644 --- a/kernel/src/system_gate.rs +++ b/kernel/src/system_gate.rs @@ -61,7 +61,7 @@ pub fn integrity_gate() -> bool { pub fn scheduling_gate() -> bool { integrity_gate() && crate::service_scheduler::epoch8_scheduling_graduated() - && crate::governance::ARE_SEMANTICS_V1 + && crate::governance::CLAN_SEMANTICS_V1 } fn sdk_path_smoke() -> bool { diff --git a/kernel/src/task/keyboard.rs b/kernel/src/task/keyboard.rs index 88b56fe..88bd581 100644 --- a/kernel/src/task/keyboard.rs +++ b/kernel/src/task/keyboard.rs @@ -233,7 +233,7 @@ fn execute_console_command(command: &str) { con_println!(" metrics"); con_println!(" whoami"); con_println!(" su "); - con_println!(" run [args...]"); + con_println!(" run [args...]"); con_println!(" programs"); con_println!(" bin list"); con_println!(" bin info "); diff --git a/kernel/src/task/program_loader.rs b/kernel/src/task/program_loader.rs index 799d7ef..b16f669 100644 --- a/kernel/src/task/program_loader.rs +++ b/kernel/src/task/program_loader.rs @@ -245,7 +245,7 @@ static TRUST_EXEC_REJECTED: AtomicU64 = AtomicU64::new(0); pub fn parse_manifest(contents: &str) -> Result { let mut lines = contents.lines(); - if lines.next() != Some("ares-exec-v1") { + if lines.next() != Some("clan-exec-v1") { return Err(ProgramLoadError::InvalidVersion); } @@ -454,7 +454,7 @@ pub fn record_unsupported_execution() { pub fn manifest_for_builtin(name: &str, description: &str) -> String { format!( - "ares-exec-v1\nname={}\nkind=builtin-alias\nentry={}\nrequires=execute\ntrust=system\nowner=admin\ndescription={}", + "clan-exec-v1\nname={}\nkind=builtin-alias\nentry={}\nrequires=execute\ntrust=system\nowner=admin\ndescription={}", name, name, description ) } @@ -1296,7 +1296,7 @@ pub fn storage_read_probe(user_buf: u64) -> Result { contents.as_bytes()[..len].to_vec() }) .filter(|bytes| !bytes.is_empty()) - .unwrap_or_else(|| b"ares-exec-v1".to_vec()); + .unwrap_or_else(|| b"clan-exec-v1".to_vec()); crate::user_copy::copy_to_user(&sample, user_buf).map_err(|_| ())?; STORAGE_COPYIN_READS.fetch_add(1, Ordering::Relaxed); Ok(sample.len() as u64) @@ -2605,7 +2605,7 @@ mod tests { #[test_case] fn valid_manifest_parses() { let manifest = parse_manifest( - "ares-exec-v1\nname=echo\nkind=builtin-alias\nentry=echo\ndescription=Echo text", + "clan-exec-v1\nname=echo\nkind=builtin-alias\nentry=echo\ndescription=Echo text", ) .expect("manifest should parse"); assert_eq!(manifest.name, "echo"); @@ -2625,11 +2625,11 @@ mod tests { #[test_case] fn missing_required_fields_are_rejected() { assert_eq!( - parse_manifest("ares-exec-v1\nkind=builtin-alias\nentry=echo"), + parse_manifest("clan-exec-v1\nkind=builtin-alias\nentry=echo"), Err(ProgramLoadError::MissingName) ); assert_eq!( - parse_manifest("ares-exec-v1\nname=echo\nkind=builtin-alias"), + parse_manifest("clan-exec-v1\nname=echo\nkind=builtin-alias"), Err(ProgramLoadError::MissingEntry) ); } @@ -2637,7 +2637,7 @@ mod tests { #[test_case] fn unsupported_kind_is_rejected() { assert_eq!( - parse_manifest("ares-exec-v1\nname=x\nkind=elf\nentry=x"), + parse_manifest("clan-exec-v1\nname=x\nkind=elf\nentry=x"), Err(ProgramLoadError::UnsupportedKind) ); } @@ -2645,11 +2645,11 @@ mod tests { #[test_case] fn unsupported_trust_and_requirement_are_rejected() { assert_eq!( - parse_manifest("ares-exec-v1\nname=x\nkind=builtin-alias\nentry=x\ntrust=unsigned"), + parse_manifest("clan-exec-v1\nname=x\nkind=builtin-alias\nentry=x\ntrust=unsigned"), Err(ProgramLoadError::UnsupportedTrust) ); assert_eq!( - parse_manifest("ares-exec-v1\nname=x\nkind=builtin-alias\nentry=x\nrequires=network"), + parse_manifest("clan-exec-v1\nname=x\nkind=builtin-alias\nentry=x\nrequires=network"), Err(ProgramLoadError::UnsupportedRequirement) ); } diff --git a/kernel/src/task/userspace.rs b/kernel/src/task/userspace.rs index d43b3a2..9f708ad 100644 --- a/kernel/src/task/userspace.rs +++ b/kernel/src/task/userspace.rs @@ -130,8 +130,8 @@ fn dispatch_builtin(entry: &str, args: &[&str]) -> Result programs )) } - "demo-hello" => Ok(String::from("ares-rt demo: hello from userland\n")), - "ares-info" => dispatch_builtin("sysinfo", args), + "demo-hello" => Ok(String::from("clan-rt demo: hello from userland\n")), + "clan-info" => dispatch_builtin("sysinfo", args), _ => Err("unknown user program"), } } @@ -139,7 +139,7 @@ fn dispatch_builtin(entry: &str, args: &[&str]) -> Result fn is_builtin_entry(name: &str) -> bool { matches!( name, - "echo" | "time" | "sysinfo" | "fsinfo" | "demo-hello" | "ares-info" + "echo" | "time" | "sysinfo" | "fsinfo" | "demo-hello" | "clan-info" ) } diff --git a/kernel/src/user_copy.rs b/kernel/src/user_copy.rs index 0863038..ec25407 100644 --- a/kernel/src/user_copy.rs +++ b/kernel/src/user_copy.rs @@ -90,7 +90,7 @@ pub fn user_copy_probe(user_buf: u64) -> Result { } pub fn probe_round_trip(user_buf: u64) -> bool { - let sample = b"ares-copyin-ok"; + let sample = b"clan-copyin-ok"; copy_to_user(sample, user_buf).is_ok() && { let mut buf = [0u8; 14]; copy_from_user(user_buf, &mut buf).is_ok() && &buf[..sample.len()] == sample diff --git a/kernel/src/userland_install.rs b/kernel/src/userland_install.rs index 77258b9..53de1eb 100644 --- a/kernel/src/userland_install.rs +++ b/kernel/src/userland_install.rs @@ -1,10 +1,10 @@ -//! Native userland install hook (scopes 376–399) — ares-rt demo + `/bin` manifests. +//! Native userland install hook (scopes 376–399) — clan-rt demo + `/bin` manifests. use core::sync::atomic::{AtomicU64, Ordering}; static NATIVE_LAUNCHES: AtomicU64 = AtomicU64::new(0); -pub const DEMO_HELLO_MANIFEST: &str = "ares-exec-v1\nname=demo-hello\nkind=builtin-alias\nentry=demo-hello\ndescription=ares-rt demo\ntrust=system\nowner=admin\n"; +pub const DEMO_HELLO_MANIFEST: &str = "clan-exec-v1\nname=demo-hello\nkind=builtin-alias\nentry=demo-hello\ndescription=clan-rt demo\ntrust=system\nowner=admin\n"; pub fn install_native_packages() -> bool { crate::network_stack::mark_package_installed(); @@ -15,7 +15,7 @@ pub fn run_native_demo() -> bool { install_native_packages(); match crate::task::userspace::run_program("demo-hello", &[]) { Ok(out) => { - let ok = out.contains("ares-rt") || out.contains("userland"); + let ok = out.contains("clan-rt") || out.contains("userland"); if ok { NATIVE_LAUNCHES.fetch_add(1, Ordering::Relaxed); } @@ -32,7 +32,7 @@ pub fn native_launch_count() -> u64 { pub fn smoke_userland_demo() -> bool { install_native_packages() && crate::task::userspace::run_program("demo-hello", &[]) - .map(|out| out.contains("ares-rt") || out.contains("userland")) + .map(|out| out.contains("clan-rt") || out.contains("userland")) .unwrap_or(false) } From 2719f6483ba47667942313da7dfdd97290696ef0 Mon Sep 17 00:00:00 2001 From: Clancy Mendonca Date: Sat, 13 Jun 2026 22:09:18 +0530 Subject: [PATCH 3/3] fixup(scripts): add ares-info to rename_clanos migration map Cover the clan-info builtin alias in the one-shot rebrand script. --- scripts/rename_clanos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rename_clanos.py b/scripts/rename_clanos.py index dd44c4e..5499ddc 100644 --- a/scripts/rename_clanos.py +++ b/scripts/rename_clanos.py @@ -25,6 +25,7 @@ # Order matters: longest / most specific first. REPLACEMENTS: list[tuple[str, str]] = [ ("ABI_ARES_RT", "ABI_CLAN_RT"), + ("ares-info", "clan-info"), ("ares-exec-v1", "clan-exec-v1"), ("ARESFS1", "CLANFS1"), ("ares-rt-001", "clan-rt-001"),