fix(release): restore canonical local gate

req: public_api/001

req: v1_release/007
This commit is contained in:
slhx agent
2026-07-14 01:24:31 +02:00
parent 90e8c3ced5
commit 025d9c1563
10 changed files with 33 additions and 23 deletions
+10 -6
View File
@@ -1,4 +1,4 @@
use hemx_core::{Atom, Effect, EffectBatch, IntoEffect};
use hemx_core::{Atom, BuildFingerprint, Effect, EffectBatch, IntoEffect};
use serde::{de, Deserialize, Deserializer, Serialize};
use std::{
collections::{HashMap, HashSet},
@@ -421,8 +421,13 @@ impl SyncEffect {
/// Apply an optimistic projection now and carry the same ordinary batch in
/// the durable patch event so the framework sync runtime can replay it
/// after reload before acknowledgement.
pub fn durable(patch: FlatPatch, projection: EffectBatch) -> Self {
pub fn durable(
patch: FlatPatch,
projection: impl IntoEffect,
fingerprint: BuildFingerprint,
) -> Self {
patch.validate().expect("FlatPatch must remain valid");
let projection = projection.into_batch(fingerprint);
let projection_wire = projection
.to_wire()
.iter()
@@ -459,10 +464,9 @@ mod tests {
let projection = Effect::Emit {
name: "projected".into(),
payload: "card:1".into(),
}
.into_batch(hemx_core::BuildFingerprint(7));
let batch =
SyncEffect::durable(patch, projection).into_batch(hemx_core::BuildFingerprint(7));
};
let batch = SyncEffect::durable(patch, projection, hemx_core::BuildFingerprint(7))
.into_batch(hemx_core::BuildFingerprint(7));
assert_eq!(batch.ops.len(), 2);
assert!(matches!(&batch.ops[0], Effect::Emit { name, .. } if name == "projected"));
assert!(