Problem
The parser drops the unsafe keyword and keeps the body as a plain block, so raw pointer dereferences and FFI calls are allowed anywhere. packages/safety/src/unsafe_blocks.zig would enforce this, but it imports a non-existent ../ast/ast.zig, uses the old ArrayList API and is not in build.zig.
Evidence (origin/main @ d4b219507)
Scope
- Keep an
UnsafeBlocknode (or flag) in the AST. - Checker: raw-pointer deref, pointer arithmetic, FFI/extern calls and
unsafe fncalls are errors outsideunsafe. - Port or delete
packages/safety/src/unsafe_blocks.zig.
Acceptance criteria
- Deref of a raw pointer outside
unsafeis an error; inside it is accepted. - The kernel corpus builds (with
unsafeadded or an explicit allowlist).