commit 57ad3d798f7f218dc8bc53a1db77f6601e8b567f
parent 82a47e7f750e064b23e126514895609f6108cdde
Author: triesap <tyson@radroots.org>
Date: Fri, 16 Oct 2026 05:21:50 +0000
xtask: share private source-lock field models
- Extract archive, artifact and SQLite metadata into one private module.
- Retain codec-owned bounds, validation, diagnostics and canonical bytes.
- Preserve historical contracts and all retained fixture purposes.
- Pass 603 tests, strict checks, architecture and catalog validation.
Diffstat:
3 files changed, 48 insertions(+), 40 deletions(-)
diff --git a/tools/xtask/src/main.rs b/tools/xtask/src/main.rs
@@ -56,6 +56,7 @@ mod service_release_artifacts;
mod service_repro_install;
mod service_source_lock;
mod service_source_lock_command;
+mod service_source_lock_parts;
mod service_source_lock_v3;
#[cfg_attr(coverage_nightly, coverage(off))]
mod supply_chain_qualification;
diff --git a/tools/xtask/src/service_source_lock_parts.rs b/tools/xtask/src/service_source_lock_parts.rs
@@ -0,0 +1,44 @@
+//! Shared field models for versioned service source-lock codecs.
+//! Each codec owns validation and canonical byte encoding.
+
+use serde::Deserialize;
+
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
+#[serde(deny_unknown_fields)]
+pub(super) struct RawSourceArchiveContract {
+ pub(super) binding: String,
+ pub(super) format: String,
+ pub(super) compression: String,
+ pub(super) compression_timestamp: String,
+ pub(super) entry_order: String,
+ pub(super) path_prefix: String,
+ pub(super) file_mode: String,
+ pub(super) uid: u32,
+ pub(super) gid: u32,
+ pub(super) uname: String,
+ pub(super) gname: String,
+ pub(super) mtime: String,
+ pub(super) pax_headers: String,
+ pub(super) directory_entries: String,
+ pub(super) symlinks: String,
+ pub(super) hardlinks: String,
+ pub(super) submodules: String,
+ pub(super) trailer: String,
+}
+
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
+#[serde(deny_unknown_fields)]
+pub(super) struct RawArtifactContract {
+ pub(super) path: String,
+ pub(super) sha256: String,
+ pub(super) binding: String,
+}
+
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
+#[serde(deny_unknown_fields)]
+pub(super) struct RawSqliteContract {
+ pub(super) high_level_authority: String,
+ pub(super) second_pool_connection_query_transaction_migration_authority: String,
+ pub(super) incremental_backup_adapter: String,
+ pub(super) native_linkage_count: u32,
+}
diff --git a/tools/xtask/src/service_source_lock_v3.rs b/tools/xtask/src/service_source_lock_v3.rs
@@ -3,6 +3,9 @@ use std::fmt;
use serde::Deserialize;
use crate::service_source_lock::{ContractVersions, LIB_REPOSITORY};
+use crate::service_source_lock_parts::{
+ RawArtifactContract, RawSourceArchiveContract, RawSqliteContract,
+};
pub(crate) const LOCK_FILENAME: &str = "radroots.service.source-lock.v3.toml";
pub(crate) const PREDECESSOR_LOCK_FILENAME: &str = "radroots.service.source-lock.v2.toml";
@@ -14,29 +17,6 @@ const HOST_FEATURE_PROFILE: &str = "service-host";
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
#[serde(deny_unknown_fields)]
-struct RawSourceArchiveContract {
- binding: String,
- format: String,
- compression: String,
- compression_timestamp: String,
- entry_order: String,
- path_prefix: String,
- file_mode: String,
- uid: u32,
- gid: u32,
- uname: String,
- gname: String,
- mtime: String,
- pax_headers: String,
- directory_entries: String,
- symlinks: String,
- hardlinks: String,
- submodules: String,
- trailer: String,
-}
-
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
-#[serde(deny_unknown_fields)]
struct RawPublicInputLock {
path: String,
sha256: String,
@@ -65,23 +45,6 @@ struct RawQualifiedNix {
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
#[serde(deny_unknown_fields)]
-struct RawArtifactContract {
- path: String,
- sha256: String,
- binding: String,
-}
-
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
-#[serde(deny_unknown_fields)]
-struct RawSqliteContract {
- high_level_authority: String,
- second_pool_connection_query_transaction_migration_authority: String,
- incremental_backup_adapter: String,
- native_linkage_count: u32,
-}
-
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
-#[serde(deny_unknown_fields)]
struct RawServiceSourceLockV3 {
schema: String,
contract_version: u32,