entity_facts takes a before instant - #432
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #416, the follow-up to #373.
changesprints each event's exact record instant; the prompt then asked the model to callentity_factswithas_ofone microsecond earlier, doing the fractional-second arithmetic itself — with a borrow across the second when the fraction is zero. A slip there returns the state after the correction, silently, which is the #351 failure with the arithmetic moved into the model.entity_factsnow takesbefore: the event's timestamp, pasted as printed. The server reads the base as it stood strictly before that change. The implementation is one line, because the ledger's clock is microseconds: strictly before T is at-or-before T − 1 µs, soheld_atfrom 0019 is unchanged —recorded_at <= T−1µsis exactlyrecorded_at < T, andinvalidated_at > T−1µsis exactlyinvalidated_at >= T. The summary line saysas recorded before <T>with the instant the person asked about, not the shifted one.beforeoverridesas_of.The
changesdescription and the system prompt now say: copy the timestamp intobefore; never compute an earlieras_of. Theatdescription also stops sayingYYYY-MM-DDonly, since #414 made it accept any precision.Tests: the microsecond shift including the borrow across a whole second, and the summary wording. Floating-Y's same-second test from #373 already pins that
as_of = T − 1µsreturns the retracted row andas_of = Tthe correction.🤖 Generated with Claude Code