treewide: Fix PACKAGE_DIRECTORY_MATCH rule exception

Change-Id: I8c4061f8d147a4708167b0674abfa23784a7f40d
Reviewed-on: https://review.monogon.dev/c/monogon/+/3801
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/metropolis/node/core/abloader/main.rs b/metropolis/node/core/abloader/main.rs
index 0068f95..905c3ca 100644
--- a/metropolis/node/core/abloader/main.rs
+++ b/metropolis/node/core/abloader/main.rs
@@ -15,7 +15,7 @@
 use uefi::{prelude::*, CStr16};
 use uefi_services::println;
 
-use abloader_proto::monogon::metropolis::node::core::abloader;
+use abloader_proto::metropolis::node::core::abloader::spec::*;
 
 const A_LOADER_PATH: &CStr16 = cstr16!("\\EFI\\metropolis\\boot-a.efi");
 const B_LOADER_PATH: &CStr16 = cstr16!("\\EFI\\metropolis\\boot-b.efi");
@@ -58,9 +58,9 @@
     }
 }
 
-fn read_loader_state(fs: &mut FileSystem) -> Result<abloader::AbLoaderData, ReadLoaderStateError> {
+fn read_loader_state(fs: &mut FileSystem) -> Result<AbLoaderData, ReadLoaderStateError> {
     let state_raw = fs.read(&LOADER_STATE_PATH).map_err(|e| ReadLoaderStateError::FSReadError(e))?;
-    abloader::AbLoaderData::decode(state_raw.as_slice()).map_err(|e| ReadLoaderStateError::DecodeError(e))
+    AbLoaderData::decode(state_raw.as_slice()).map_err(|e| ReadLoaderStateError::DecodeError(e))
 }
 
 fn load_slot_image(slot: &ValidSlot, boot_services: &BootServices) -> uefi::Result<Handle> {
@@ -117,9 +117,9 @@
             Ok(d) => d, 
             Err(e) => {
                 println!("Unable to load A/B loader state, using default slot A: {}", e);
-                abloader::AbLoaderData {
-                    active_slot: abloader::Slot::A.into(),
-                    next_slot: abloader::Slot::None.into(),
+                AbLoaderData {
+                    active_slot: Slot::A.into(),
+                    next_slot: Slot::None.into(),
                 }
             }
         };
@@ -127,9 +127,9 @@
         // If next_slot is set, use it as slot to boot but clear it in the
         // state file as the next boot should not use it again. If it should
         // be permanently activated, it is the OS's job to put it into 
-        if loader_data.next_slot != abloader::Slot::None.into() {
+        if loader_data.next_slot != Slot::None.into() {
             let next_slot = loader_data.next_slot;
-            loader_data.next_slot = abloader::Slot::None.into();
+            loader_data.next_slot = Slot::None.into();
             let new_loader_data = loader_data.encode_to_vec();
             esp_fs
                 .write(&LOADER_STATE_PATH, new_loader_data)
@@ -140,9 +140,9 @@
         }
     };
 
-    let boot_slot = match abloader::Slot::try_from(boot_slot_raw) {
-        Ok(abloader::Slot::A) => ValidSlot::A,
-        Ok(abloader::Slot::B) => ValidSlot::B,
+    let boot_slot = match Slot::try_from(boot_slot_raw) {
+        Ok(Slot::A) => ValidSlot::A,
+        Ok(Slot::B) => ValidSlot::B,
         _ => {
             println!("Invalid slot ({}) active, falling back to A", boot_slot_raw);
             ValidSlot::A
diff --git a/metropolis/node/core/abloader/spec/BUILD.bazel b/metropolis/node/core/abloader/spec/BUILD.bazel
index afaa250..035dc4d 100644
--- a/metropolis/node/core/abloader/spec/BUILD.bazel
+++ b/metropolis/node/core/abloader/spec/BUILD.bazel
@@ -10,7 +10,6 @@
         "PACKAGE_VERSION_SUFFIX",
         "ENUM_VALUE_PREFIX",  # TODO: evaluate correctness
         "ENUM_ZERO_VALUE_SUFFIX",  # TODO: evaluate correctness
-        "PACKAGE_DIRECTORY_MATCH",  # TODO: evaluate correctness
     ],
     protos = [":abloader_proto"],
     use_rules = [
diff --git a/metropolis/node/core/abloader/spec/abloader.proto b/metropolis/node/core/abloader/spec/abloader.proto
index aeaacd5..d38b558 100644
--- a/metropolis/node/core/abloader/spec/abloader.proto
+++ b/metropolis/node/core/abloader/spec/abloader.proto
@@ -1,6 +1,6 @@
 syntax = "proto3";
 
-package monogon.metropolis.node.core.abloader;
+package metropolis.node.core.abloader.spec;
 
 enum Slot {
     NONE = 0;
diff --git a/metropolis/proto/api/management.proto b/metropolis/proto/api/management.proto
index 30f41c1..8275f43 100644
--- a/metropolis/proto/api/management.proto
+++ b/metropolis/proto/api/management.proto
@@ -452,11 +452,11 @@
 message GetLogsResponse {
   // Entries from the requested historical entries (via WithBackLog). They will
   // all be served before the first stream_entries are served (if any).
-  repeated osbase.pkg.logtree.proto.LogEntry backlog_entries = 1;
+  repeated osbase.logtree.proto.LogEntry backlog_entries = 1;
   // Entries streamed as they arrive. Currently no server-side buffering is
   // enabled, instead every line is served as early as it arrives. However, this
   // might change in the future, so this behaviour cannot be depended upon.
-  repeated osbase.pkg.logtree.proto.LogEntry stream_entries = 2;
+  repeated osbase.logtree.proto.LogEntry stream_entries = 2;
 }
 
 enum ActivationMode {
diff --git a/metropolis/proto/common/common.proto b/metropolis/proto/common/common.proto
index d922a56..4580ef2 100644
--- a/metropolis/proto/common/common.proto
+++ b/metropolis/proto/common/common.proto
@@ -255,7 +255,7 @@
     // If leveled logs are returned, all entries at severity lower than `minimum`
     // will be discarded.
     message LeveledWithMinimumSeverity {
-        osbase.pkg.logtree.proto.LeveledLogSeverity minimum = 1;
+        osbase.logtree.proto.LeveledLogSeverity minimum = 1;
     }
     oneof filter {
         WithChildren with_children = 1;
diff --git a/metropolis/test/localregistry/spec/BUILD.bazel b/metropolis/test/localregistry/spec/BUILD.bazel
index f926b7a..0d059e3 100644
--- a/metropolis/test/localregistry/spec/BUILD.bazel
+++ b/metropolis/test/localregistry/spec/BUILD.bazel
@@ -7,7 +7,6 @@
     name = "spec_proto_lint_test",
     except_rules = [
         "PACKAGE_VERSION_SUFFIX",
-        "PACKAGE_DIRECTORY_MATCH",  # TODO: evaluate correctness
     ],
     protos = [":spec_proto"],
     use_rules = [
diff --git a/metropolis/test/localregistry/spec/manifest.proto b/metropolis/test/localregistry/spec/manifest.proto
index bb53581..d9cbeab 100644
--- a/metropolis/test/localregistry/spec/manifest.proto
+++ b/metropolis/test/localregistry/spec/manifest.proto
@@ -1,6 +1,6 @@
 syntax = "proto3";
 
-package monogon.metropolis.pkg.localregistry;
+package metropolis.test.localregistry.spec;
 
 option go_package = "source.monogon.dev/metropolis/test/localregistry/spec";