Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/design/management-operation-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ preserves Unicode, case, order, repetition, punctuation and internal whitespace.
paths, weights and bookkeeping timestamps do not establish semantic identity. The oldest
duplicate remains active, with name breaking creation-time ties; other copies retain their
files and point to it. Similarity alone belongs to the reviewed proposal path.

The implicit fact date selects the latest cited instant by parsed timestamp rather than string order. Evidence using different UTC offsets retains its actual chronological meaning.
3 changes: 2 additions & 1 deletion packages/core/src/agent_memory/core/reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import json
import re

from . import timestamp
from .config import Config
from .errors import FieldError
from .paths import StoreLayout
Expand Down Expand Up @@ -228,7 +229,7 @@ def _latest_cited_time(pointers: list[Pointer], sheet: Sheet) -> str:
for pointer in pointers
)
]
return max(stamps) if stamps else ""
return max(stamps, key=timestamp.parse) if stamps else ""


def _provenance(raw: object, sheet: Sheet) -> list[Pointer]:
Expand Down
18 changes: 18 additions & 0 deletions tests/unit/test_regression_evidence_time_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from agent_memory.core import reconcile, sessions


def test_default_fact_date_uses_latest_instant_not_lexical_zone_order(store):
pointer = store.archive.append_session(
"zoned",
[
{"text": "Earlier evidence", "at": "2026-01-05T10:00:00+02:00"},
{"text": "Later evidence", "at": "2026-01-05T09:00:00Z"},
],
)
messages = sessions.resolve(store.layout, pointer)
sheet = reconcile.build(store, "zoned", messages)
spec = reconcile.to_record_spec(
{"op": "new", "type": "fact", "fields": {"subject": "zone"}, "abstract": "Time fixture"},
sheet,
)
assert spec["valid_from"] == "2026-01-05T09:00:00Z"