Skip to content

Commit ee0eb5a

Browse files
committed
fix(gossip): meta-gossip analytics consistency and viral-fact identity
- Encode the original predicate in the gossip source_file so viral_facts can group by the source fact identity instead of the destination predicate. - Use one reference timestamp for all as_of metrics (active and expired). - Format the default reference as canonical UTC to satisfy KG validation. Refs #2249
1 parent 0bc860b commit ee0eb5a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mempalace/gossip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ def _parse_original_predicate(source_file: Optional[str]) -> Optional[str]:
733733

734734
def _active_triples(self, as_of: str = None) -> list[dict]:
735735
"""Return gossip triples active at ``as_of`` (or now)."""
736-
reference = as_of or datetime.now(timezone.utc).isoformat()
736+
reference = as_of or datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
737737
triples = self.kg.query_gossip_triples(as_of=reference)
738738
return [
739739
t
@@ -797,7 +797,7 @@ def network_health(
797797
self, chatter_nodes: list[ChatterNode], config: dict[str, Any], as_of: str = None
798798
) -> dict[str, Any]:
799799
"""Return gossip network health metrics as of one reference timestamp."""
800-
reference = as_of or datetime.now(timezone.utc).isoformat()
800+
reference = as_of or datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
801801
triples = self._active_triples(as_of=reference)
802802
total = len(triples)
803803
expired = [

0 commit comments

Comments
 (0)