Deploy reviewed Windows sync alignment with schema 20 server
Rust development slice / linux (push) Failing after 7s

Bind the administrative connection-205 review to original signed history and preserve closed readiness. Include the qualified server dependency closure, UI review, native ARM64 build provenance, and guarded deployment evidence. Migration, API/gateway replacement and TLS checks passed with unchanged job authority, protected mounts and time/database services; native Windows receipt application remains separate.
This commit is contained in:
2026-11-16 13:30:31 +01:00
parent 7b320b932e
commit cafd13bca9
34 changed files with 3865 additions and 43 deletions
+82 -9
View File
@@ -244,20 +244,14 @@ impl LocalUpdatePolicy {
return false;
};
let names: Vec<_> = self.services.iter().map(|v| v.unit.as_str()).collect();
self.schema_version == 1
let linux = self.schema_version == 1
&& self.profile == "linux_general_full_v1"
&& !self.tenant_id.is_nil()
&& !self.asset_id.is_nil()
&& !self.agent_id.is_nil()
&& self.enrollment_generation > 0
&& self.assignment_version > 0
&& self.ledger_path == "/var/lib/rmm-helper/consumption.sqlite"
&& self.lock_path == "/var/lib/rmm-helper/executor.lock"
&& self.installed_record_path == "/var/lib/rmm-agent-updater/installed-record.json"
&& self.keyring_path == "/etc/rmm-agent-updater/keyring.json"
&& self.health_pin_path == "/etc/rmm-agent-updater/health-key.json"
&& self.registry_path == "/etc/rmm-agent-updater/reader-registry.json"
&& digest(&self.reader_registry_sha256)
&& (names == SERVICES
|| names
== [
@@ -266,11 +260,30 @@ impl LocalUpdatePolicy {
SERVICES[2],
"rmm-apt-helper.service",
])
&& self.services.iter().all(|v| digest(&v.unit_sha256))
&& self.updater_service.unit == "rmm-agent-updater.service"
&& baseline.record.platform == Platform::LinuxX64;
let windows = self.schema_version == 2
&& self.profile == "windows_code_pair_clock_v1"
&& self.ledger_path == r"C:\ProgramData\RustDiscoverySystem\state\ledger.sqlite"
&& self.lock_path == r"C:\ProgramData\RustDiscoverySystem\state\executor.lock"
&& self.installed_record_path
== r"C:\ProgramData\RustDiscoveryUpdater\installed-record.json"
&& self.keyring_path == r"C:\ProgramData\RustDiscoveryUpdater\keyring.json"
&& self.health_pin_path == r"C:\ProgramData\RustDiscoveryUpdater\health-key.json"
&& self.registry_path == r"C:\ProgramData\RustDiscoveryUpdater\reader-registry.json"
&& names == ["RmmDiscoveryWindows", "RmmDiscoverySystemHelper"]
&& self.updater_service.unit == "RmmDiscoveryUpdater"
&& baseline.record.platform == Platform::WindowsX64;
(linux || windows)
&& !self.tenant_id.is_nil()
&& !self.asset_id.is_nil()
&& !self.agent_id.is_nil()
&& self.enrollment_generation > 0
&& self.assignment_version > 0
&& digest(&self.reader_registry_sha256)
&& self.services.iter().all(|v| digest(&v.unit_sha256))
&& digest(&self.updater_service.unit_sha256)
&& digest(&self.updater_binary_sha256)
&& baseline.record.platform == Platform::LinuxX64
&& self.initial_record_sha256 == hash(&baseline.payload_bytes)
&& self.initial_manifest_sha256 == baseline.record.manifest_sha256
&& self.initial_activation_floor == baseline.record.activation_floor
@@ -288,3 +301,63 @@ impl LocalUpdatePolicy {
Ok((policy, hash(raw)))
}
}
/// Deterministic PUBLIC record metadata only. This does not authenticate an
/// original, a release, Health or policy, and grants no namespace/ledger access.
/// Each native private BuiltRecord constructor must first verify its actual
/// Original and signed Health independently, then retain its own effect guard.
pub fn assemble_updated_record(
update: &crate::agent_update::ResolvedAgentUpdate,
prior_raw: &[u8],
handoff_sha256: &str,
signed: &rmm_updater_handoff::SignedHealth,
receipt: &rmm_updater_handoff::HealthReceipt,
) -> Result<InstalledReleaseRecord, &'static str> {
if !update.validate()
|| !digest(handoff_sha256)
|| receipt.handoff_sha256 != handoff_sha256
|| receipt.ready
|| signed.signature.len() != 64
|| serde_json::to_vec(receipt).map_err(|_| "UPDATE_RECORD_RECEIPT_CODEC")? != signed.payload
{
return Err("UPDATE_RECORD_INPUT");
}
let prior = InstalledReleaseRecord::from_bytes(prior_raw)?;
let parent = prior.release_envelope.decode()?;
let target = update.manifest()?;
let old_sha256 = hash(prior_raw);
if prior.rolled_back
|| old_sha256 != update.predecessor.installed_record_sha256
|| prior.manifest_sha256 != update.predecessor.manifest_sha256
|| parent.manifest.release_id != update.predecessor.release_id
|| parent.manifest.release_sequence != update.predecessor.release_sequence
|| parent.manifest.artifacts[0].sha256 != update.predecessor.agent_sha256
|| parent.manifest.artifacts[1].sha256 != update.predecessor.helper_sha256
|| prior.platform != target.platform
|| target.release_sequence <= prior.activation_floor
|| receipt.issued_at < prior.activated_at
{
return Err("UPDATE_RECORD_PREDECESSOR_OR_FLOOR");
}
let record = InstalledReleaseRecord {
schema_version: 1,
profile: "decoder_compatible_handoff_v1".into(),
platform: target.platform,
release_envelope: update.release_envelope.clone(),
manifest_sha256: update.manifest_sha256.clone(),
activation_floor: target.release_sequence,
activated_at: receipt.issued_at,
previous_record_sha256: Some(old_sha256.clone()),
activation_evidence: ActivationEvidence::Updated {
handoff_sha256: handoff_sha256.into(),
signed_health_sha256: hash(
&serde_json::to_vec(signed).map_err(|_| "UPDATE_RECORD_HEALTH_CODEC")?,
),
},
rolled_back: false,
};
if hash(&record.bytes()?) == old_sha256 {
return Err("UPDATE_RECORD_SAME_BYTES");
}
Ok(record)
}