From 2da37ce7f1769b5116a1f0b706c2c68d8f940feb Mon Sep 17 00:00:00 2001 From: "bunny.fae.mom" Date: Mon, 16 Nov 2026 03:23:24 -0500 Subject: [PATCH] fix(lint): use tree-local rules and permit extension size values chore(lint): let extensions name size values Strategies size requests and rows through compaction.Sizing, whose answers are albedo/harness/size values: Size, Total and their sources. An extension that reads one has to name the module, as it names compaction. The extension import boundary now allows albedo/harness/size beside albedo/harness/compaction. fix(lint): check with the lint rules of the tree being checked test/gleam-lint.sh ran the albedo-lint on PATH, which the dev shell built from tools/lint when the shell was made. A dev shell that is reused after tools/lint changed (albedo's nix shim keeps one until its nix files change) kept checking against the old rules, so a rule change looked broken. The script now builds the current tree's albedo-lint with nix when nix is available, and uses the one on PATH otherwise. --- test/gleam-lint.sh | 11 +++++++++-- .../albedo_lint/rules/extension_harness_import.gleam | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/gleam-lint.sh b/test/gleam-lint.sh index ea3c579aa..3ce754fdd 100755 --- a/test/gleam-lint.sh +++ b/test/gleam-lint.sh @@ -24,7 +24,14 @@ if [[ -n $profile ]]; then ln -s "$root/src" "$project/src" ln -s "$root/test" "$project/test" fi +# A dev shell reused after tools/lint changed carries the old rules, so the +# tree being checked builds its own linter when nix can. +lint=albedo-lint +if command -v nix >/dev/null 2>&1 && + built="$(nix build --no-link --print-out-paths "$root#albedo-lint" 2>/dev/null)"; then + lint="$built/bin/albedo-lint" +fi # glinter reads only Gleam. This checks SDK and extension Erlang sources for # process-wide registrations outside the reviewed allow-list. -albedo-lint --erlang-registrations --project "$root" -albedo-lint --project "$project" "$@" +"$lint" --erlang-registrations --project "$root" +"$lint" --project "$project" "$@" diff --git a/tools/lint/src/albedo_lint/rules/extension_harness_import.gleam b/tools/lint/src/albedo_lint/rules/extension_harness_import.gleam index 16d1a49bd..c6f445565 100644 --- a/tools/lint/src/albedo_lint/rules/extension_harness_import.gleam +++ b/tools/lint/src/albedo_lint/rules/extension_harness_import.gleam @@ -16,6 +16,7 @@ const allowed = [ "albedo/harness/ssh", "albedo/harness/worktree", "albedo/harness/compaction", + "albedo/harness/size", "albedo/harness/cache_ttl", "albedo/harness/capabilities", "albedo/harness/project_files", -- knotmirror 0.0.1