Skip to content

v0.17.1 -- Tier 3 Technical Debt Remediation

Choose a tag to compare

@doublegate doublegate released this 06 Mar 22:20
· 697 commits to main since this release

VeridianOS v0.17.1 -- Tier 3 Technical Debt Remediation

Release Date: 2026-03-06
Commit: d6e723f
Previous Version: v0.17.0


Summary

v0.17.1 completes the three-tier technical debt remediation plan with Tier 3 focused on type-safe error handling, encapsulation hardening, and deep nesting cleanup. This release eliminates 50 Result<T, String> instances across 5 modules, converts 833 public items to pub(crate) visibility across 65 files, and resolves misleading indentation metrics in 2 modules.

Combined with v0.16.4 (Tier 1) and v0.17.0 (Tier 2), the full remediation addressed all 10 categories identified in the technical debt audit.


Changes

Type-Safe Error Handling (P3 -- String Error Types)

Replaced Result<T, String> with proper error enums in 5 modules, eliminating 50 stringly-typed error paths:

Module Error Type Variants Instances Replaced
pkg/format/compression.rs CompressionError 12 11
pkg/resolver.rs ResolverError 7 12
services/shell/script.rs ScriptError 4 14
browser/js_vm.rs JsVmError 9 9
browser/tab_isolation.rs TabError 7 6

All error enums use &'static str context fields to avoid heap allocation in kernel space. Each variant maps to a specific failure mode (e.g., CompressionError::InvalidHeader, ResolverError::CyclicDependency, JsVmError::StackOverflow).

Encapsulation Audit (P3 -- Visibility)

Converted 833 items from pub to pub(crate) across 65 files, reducing the kernel's external API surface. Changes concentrated in:

  • perf/ (7 files): Counters, benchmarks, tracepoints, profiler, flame graphs
  • power/ (4 files): ACPI, CPU frequency, thermal, battery
  • debug/ (3 files): Kernel debug, panic handler, stack unwinding
  • devtools/ (7 files): GDB stub, git client, build system, IDE, CI runner, profiler
  • video/ (3 files): DRM/KMS, GPU acceleration, display manager
  • crypto/ (6 files): AES-GCM, ChaCha20, Ed25519, X25519, ML-KEM, ML-DSA
  • timer/ (2 files): HPET, PIT/APIC timer
  • stdlib.rs: Standard library port internals

11 modules required #![allow(dead_code)] additions where pub(crate) visibility exposed previously-hidden unused items (expected for Phase 8 stub code).

Deep Nesting Cleanup (P3 -- Complexity)

File Before After Method
desktop/systray.rs 68 spaces (17 indent levels) 24 spaces (6 levels) Comment repositioning
process/wait.rs 70 spaces (17+ indent levels) 20 spaces (5 levels) Comment repositioning

Investigation revealed the high indentation metrics were caused by rustfmt continuation-indent on long comments inside nested blocks, not actual control flow nesting. Real code nesting was already within acceptable limits (<=6 levels). Comments were repositioned to reduce misleading complexity metrics.


Cumulative Tech Debt Metrics (v0.16.3 -> v0.17.1)

Metric v0.16.3 v0.17.1 Delta
God objects (>2,900 LOC) 3 0 -3 (split into 18 submodules)
#[allow(dead_code)] 781 ~107 -674 (module-level consolidation)
Result<T, String> 50 0 -50 (5 proper error enums)
pub / pub(crate) ratio 5,290 / 89 ~4,457 / 922 +833 pub(crate)
Max indentation (spaces) 70 24 -46
Test count 3,993 4,095 +102 (error, bootstrap, userland, IRQ)
Clippy warnings 0 0 maintained
CI pipeline 11/11 11/11 maintained

Files Changed

  • 72 files changed, 1,468 insertions, 1,117 deletions
  • 5 new error types created (52 total variants)
  • 65 files received pub -> pub(crate) conversions
  • 2 files received nesting/comment cleanup
  • 4 version files bumped to v0.17.1

Build & Test

Check Status
cargo fmt --all PASS (0 violations)
cargo clippy (x86_64-veridian bare metal) PASS (0 warnings)
cargo clippy (aarch64-unknown-none) PASS (0 warnings)
cargo clippy (riscv64gc-unknown-none-elf) PASS (0 warnings)
./build-kernel.sh all dev PASS (all 3 architectures)
Host-target unit tests 4,095 passing
QEMU boot (all 3 archs) Stage 6 BOOTOK, 29/29 tests

Full Tech Debt Remediation Summary (3 Tiers)

Tier Version Focus Key Changes
1 v0.16.4 P0-P1: Structural + Robustness 3 god object splits (9K LOC -> 18 modules), 40 new tests, boot static encapsulation
2 v0.17.0 P1-P2: Architecture + Coverage CipherSuite trait, AudioDevice trait, 17 IRQ tests, dead_code 781->96
3 v0.17.1 P2-P3: Type Safety + Encapsulation 5 error enums, 833 pub->pub(crate), nesting cleanup

Full Changelog: v0.17.0...v0.17.1