Skip to content

feat(core,cli): caller-supplied validity, remember/update --valid-from/--valid-until (#1598) - #1649

Merged
ajianaz merged 1 commit into
developfrom
feat/caller-validity-1598
Nov 3, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/caller-validity-1598

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

What

The additive part of #1598 (design: #1648, docs/plans/2026-11-03-time-travel-1598.md §5.1).

  • uteke remember --valid-from/--valid-until and uteke update --valid-from/--valid-until (RFC3339) write the valid_from/valid_until columns that recall --at and list --at read.
  • Core: memory::types::Validity, Uteke::set_validity (validated: the interval must start before it ends after the change is applied to the stored values; a deprecated memory is refused), RememberRequest::validity applied by run_remember after the write, like author/source.
  • Checked before anything is written. A new memory starts at the write time, so a past --valid-until without --valid-from is refused. On update the validity is written first, so a refusal leaves the other fields of the same call untouched.
  • All five deprecate statements keep a caller valid_until that is already in the past (CASE WHEN deprecated = 0 AND valid_until < now THEN valid_until ELSE now END). Every existing live row has valid_until IS NULL, so its deprecation is unchanged. Restore still clears valid_until (documented limitation).

Why

#1598 / Atlas finding 8: a caller could not say when a fact was true; valid_from was always the write time.

No CORE change. RememberRequest::decode does not fill validity, so POST /remember keeps storing the wire valid_from/valid_until as metadata (same as uteke-cloud). Moving those into the columns waits on the contract issue uteke-cloud#458 (Gitea). With a running server, remember with the new flags uses the local store, as other flags the HTTP body cannot carry do. No HTTP/MCP surface changes; cargo run -p docgen produces no diff.

Testing

  • remember_exec tests: the wire fields stay metadata only; caller validity reaches the columns; set_validity keeps the side that is not set and refuses empty or inverted intervals and deprecated memories; deprecation keeps an end that is already past, and cuts a future end to the deprecation time and leaves rows without a caller end unchanged.
  • crates/uteke-cli/tests/validity_flags.rs (real binary, local store): remember writes the interval and list --at honours it; bad intervals store nothing; a refused update does not apply the --importance from the same call.
  • cargo test -p uteke-core -p uteke-cli -p uteke-server -p uteke-mcp, cargo clippy --workspace --all-targets -D warnings and cargo fmt all pass locally.

@ajianaz
ajianaz force-pushed the feat/caller-validity-1598 branch from dccb0f0 to ad280d9 Compare November 3, 2026 00:50
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz force-pushed the feat/caller-validity-1598 branch from ad280d9 to f38e4d6 Compare November 3, 2026 00:56
@ajianaz
ajianaz merged commit d60d222 into develop Nov 3, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/caller-validity-1598 branch November 4, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant