Skip to content
Merged
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 decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,8 @@ exists only in the structured valid-time fields. If the document has no absolute
fields empty rather than guessing. D32's text-membership gate remains unchanged: it checks added claim
text, not these structured fields. Evidence payloads, including `claims_verbatim` and `explain`, now
surface `claim_valid_from` and `claim_valid_until`, so an answer agent can use the extracted time.
The same rule applies when the relative expression is inside a preserved direct quotation or
attributed claim.

---

Expand Down
23 changes: 12 additions & 11 deletions src/rememberstack/workers/e1.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,19 @@
07b pins temperature=0.0 — generation parameters are part of provenance.
07c adds D79's bounded current-generation section-summary orientation."""

E2_EXTRACTOR_VERSION: Final = f"e2-extract-2026.07i:token-union-grounding-1:temporal-anchor-1:{SECTION_ORIENTATION_VERSION}"
E2_EXTRACTOR_VERSION: Final = f"e2-extract-2026.07j:token-union-grounding-1:temporal-anchor-2:{SECTION_ORIENTATION_VERSION}"
"""The extractor generation baked into extraction_input_hash (D56); the E2
stage (WP-1.3) binds its handler to this same constant. 07i makes D32 layer-2
union grounding token-tolerant for closed functional scaffolding while keeping
every content and numeric token source-bound; 07h requires relative temporal
expressions to resolve against an in-document absolute anchor into structured
D41 valid-time while claim text keeps the source wording (#158); 07g makes D32
layer-2 grounding union-based across source-derived bundle texts with advisory
source tags; 07f adds D79 summary orientation to the bundle without making
summaries hash or grounding inputs; 07e ledgers Claimify omissions and
grounding-gate rejections on the D33 transcript (#161); 07d pinned
temperature=0.0 on the Selection call (Claimify already carried it)."""
stage (WP-1.3) binds its handler to this same constant. 07j extends the temporal
rule to quoted and attributed claim forms (#158 follow-up); 07i makes D32
layer-2 union grounding token-tolerant for closed functional scaffolding while
keeping every content and numeric token source-bound; 07h requires relative
temporal expressions to resolve against an in-document absolute anchor into
structured D41 valid-time while claim text keeps the source wording (#158);
07g makes D32 layer-2 grounding union-based across source-derived bundle texts
with advisory source tags; 07f adds D79 summary orientation to the bundle
without making summaries hash or grounding inputs; 07e ledgers Claimify
omissions and grounding-gate rejections on the D33 transcript (#161); 07d
pinned temperature=0.0 on the Selection call (Claimify already carried it)."""

_PREFIX_PROMPT_TEMPLATE: Final = (
"In one sentence, state where this passage sits in the document — "
Expand Down
27 changes: 17 additions & 10 deletions src/rememberstack/workers/e2.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,19 @@
return entailment_self_verdict (does chunk+bundle entail the claim) and
is_attributed.

TEMPORAL RESOLUTION IS REQUIRED. Whenever the source utterance contains a
relative temporal expression ("yesterday", "last Saturday", "last year",
"this morning", "a few weeks ago", and similar) AND the DOCUMENT HEADER
provides an absolute date or timestamp, you MUST resolve the expression against
that anchor and emit valid_kind, valid_from_iso, valid_until_iso, and
valid_precision. Put the computed absolute time ONLY in those structured
valid-time fields. The claim_text MUST stay faithful to the source: keep the
relative phrase as spoken and never replace it with the computed date.
TEMPORAL RESOLUTION IS REQUIRED regardless of claim form. This applies equally
when claim_text preserves a direct quotation or attributed speech:
a relative expression inside quoted or attributed text is never exempt.
Whenever the source utterance contains a relative temporal expression
("yesterday", "last Saturday", "last year", "this morning", "a few weeks ago",
and similar) AND the DOCUMENT HEADER provides an absolute date or timestamp,
you MUST resolve the expression against that anchor and emit valid_kind,
valid_from_iso, valid_until_iso, and valid_precision.
Put the computed absolute time ONLY in those structured valid-time fields. The
claim_text MUST stay faithful to the source: keep the relative phrase as spoken
and never replace it with the computed date. When claim_text preserves a direct
quotation, the quoted text itself stays verbatim; its resolution goes only to
the valid-time fields.

Use ISO-8601 dates (YYYY-MM-DD) or datetimes WITH an explicit offset or Z;
never emit a datetime without an offset. Calendar-day expressions use
Expand All @@ -186,10 +191,12 @@
invent an anchor or a date.

Examples (DOCUMENT HEADER date → structured output):
- date 2023-05-08; "went to the support group yesterday" →
claim_text="went to the support group yesterday",
- date 2023-05-08;
claim_text="Caroline said: I went to a support group yesterday"
valid_kind=event_time, valid_from_iso=2023-05-07,
valid_until_iso=2023-05-07, valid_precision=day.
Note the quote form: the relative word stays inside the quoted claim_text;
the resolution goes only to the valid_* fields.
- date 2023-05-08; "painted a lake sunrise last year" →
claim_text="painted a lake sunrise last year", valid_kind=event_time,
valid_from_iso=2022-01-01, valid_until_iso=2022-12-31,
Expand Down
4 changes: 4 additions & 0 deletions src/tests/workers/test_claim_valid_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ def test_rendered_claimify_prompt_requires_anchored_temporal_resolution() -> Non
)

assert "TEMPORAL RESOLUTION IS REQUIRED" in rendered
assert "regardless of claim form" in rendered
assert "relative expression inside quoted or attributed text" in rendered
assert "you MUST resolve the expression" in rendered
assert "computed absolute time ONLY in those structured" in rendered
assert "valid-time fields" in rendered
assert 'claim_text="Caroline said: I went to a support group yesterday"' in rendered
assert "the relative word stays inside the quoted claim_text" in rendered
assert 'claim_text="painted a lake sunrise last year"' in rendered
assert "valid_from_iso=2022-01-01" in rendered
assert "valid_until_iso=2022-12-31" in rendered
Expand Down
Loading