ReviewOS

home-lang/home-os

Fix 23 kernel modules importing paths that don't resolve

#11
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Context

Audit (2026-05-01) of 404 kernel modules found 23 modules importing paths that point at files that don't exist. The compiler reports `Module '...' not found` and the importing module fails to parse.

A separate but related issue: 25 imports omit the `.home` extension (e.g. `import "../../../core/types"`) and the resolver appears to require it strictly. Those should be normalized too — could be folded into this issue or split.

Examples of paths that don't resolve

(Partial list from audit data; full set in the TSV.)

  • `network.home`
  • `network/network.home`
  • `crypto/chacha20.home`
  • `crypto/rsa.home` (file exists at `kernel/src/crypto/rsa.home` but the import path resolves elsewhere — likely a relative-path-from bug)
  • `net/netdev.home`
  • `net/tls.home`
  • `core/scheduler.home`
  • `core/foundation.home` (wrong relative — file exists at the canonical path)
  • `mm/memory.home`
  • `drivers/usb/usb.home`

Proposal

For each dangling import, decide one of:

  1. Wrong path → fix the import to point at the real file
  2. Missing file is a real gap → either create a stub with a TODO, or delete the dependent module (likely if the dependent is also stub-tier)
  3. Path conventions are inconsistent (relative vs absolute-from-src) → standardize on one convention, lint-enforce going forward

For the 25 extension-less imports, just append `.home`.

Approach

  • Pull the 23 dangling-import rows from `~/Desktop/home-os-kernel-audit-2026-05-01.tsv` (filter: `first_error` contains `Module '` and `not found`)
  • For each: `grep -r "import.*<missing>_path>" kernel/` to find the importer; cross-reference with `find kernel -name "<basename>"` to see whether the file exists elsewhere
  • Apply fix per category above
  • After this is done, re-running the audit should drop the parse-failure bucket meaningfully (combined with the Rust-array-syntax codemod issue)

Why this matters

Dangling imports prevent the importing module from even reaching typecheck. Many are in central files (e.g. `core/foundation.home` chain), so a fix here cascades through the dependency graph.

Caveat

Audit data may be incomplete — `home ast` hangs after the first parse error in a file, so a module with a dangling import + something else broken may be classified by the dangling import only. Real count after a parser-hang fix could be higher.

Sign in to comment on this issue.