compile error Soul pass 8 proved the FrozenSymlinkFs port (R-I14) was an honour system one level up from the counter it replaced: restoring the S5-1 cubic bug as `candidate.canonicalize()?` in resolve_frozen_source_symlink's Normal arm left all 193 tests green, and open_frozen_symlink_frame was still calling fs::read_link directly, proving the convention leaks. - Add `read_link` to FrozenSymlinkFs and route open_frozen_symlink_frame and validate_frozen_source_symlink's root resolution through it. - Move every function the resolver can reach into a `frozen_symlink_port` submodule with `#![deny(clippy::disallowed_methods)]`; drivers.rs blanket-allows the lint at the top of the file since most of the crate has legitimate, unrelated reasons to call these methods (host.rs and provisioning.rs get the same blanket allow). Everything the module exports is re-exported so every existing caller and test keeps its bare name. - Add clippy.toml listing Path::canonicalize, fs::canonicalize, fs::symlink_metadata and fs::read_link as disallowed, each with a reason pointing at the port. - Add .github/workflows/lint.yml: this repo had no CI surface at all before this batch, so "denied in CI" had nowhere to attach. - Update validate_frozen_source_symlinks_resolves_a_long_component_chain_ with_a_linear_call_count's formula and doc: read_link and the now-ported root canonicalize add two calls per resolution (components + 4, not + 2), and the doc no longer claims the count can't catch its own regression -- R-I23 is what catches it now (R-I24). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
25 lines
2.1 KiB
TOML
25 lines
2.1 KiB
TOML
# R-I23 (Self's ruling, Cut 1's eighth fix batch, F1): these four methods are
|
|
# how the frozen-symlink resolver's authority leaks. Soul pass 8 proved it by
|
|
# existence -- `open_frozen_symlink_frame` called `fs::read_link` directly
|
|
# while everything else in the resolver went through `FrozenSymlinkFs`, and
|
|
# restoring the pass-7 cubic bug as `candidate.canonicalize()?` (or
|
|
# `fs::canonicalize(&candidate)?`) at `resolve_frozen_source_symlink`'s
|
|
# `Normal` arm passed all 193 tests green, because nothing stopped the
|
|
# resolver from reaching past the port.
|
|
#
|
|
# This list is crate-wide because `disallowed-methods` has no per-module
|
|
# scope of its own. `src/drivers.rs` blanket-allows the lint at the top of
|
|
# the file (most of the crate has a legitimate reason to call these methods
|
|
# directly -- deployment staging, host executable-identity checks, artifact
|
|
# digesting, and so on are not part of frozen-symlink resolution) and the
|
|
# `frozen_symlink_port` submodule inside it re-denies the lint for its own
|
|
# scope, which is the only place these calls must not appear outside the
|
|
# port. A future edit that adds a bypass inside that module fails
|
|
# `cargo clippy` with this list's reason text; a call anywhere else in the
|
|
# crate is unaffected, exactly as before this batch.
|
|
disallowed-methods = [
|
|
{ path = "std::path::Path::canonicalize", reason = "frozen-symlink resolution must go through FrozenSymlinkFs::canonicalize (src/drivers.rs, frozen_symlink_port); this method is blanket-allowed outside that module" },
|
|
{ path = "std::fs::canonicalize", reason = "frozen-symlink resolution must go through FrozenSymlinkFs::canonicalize (src/drivers.rs, frozen_symlink_port); this function is blanket-allowed outside that module" },
|
|
{ path = "std::fs::symlink_metadata", reason = "frozen-symlink resolution must go through FrozenSymlinkFs::symlink_metadata (src/drivers.rs, frozen_symlink_port); this function is blanket-allowed outside that module" },
|
|
{ path = "std::fs::read_link", reason = "frozen-symlink resolution must go through FrozenSymlinkFs::read_link (src/drivers.rs, frozen_symlink_port); this function is blanket-allowed outside that module" },
|
|
]
|