From 9fe7d10fcf73570767ba7b4eabaa95f65958821b Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 25 Feb 2026 19:10:58 -0800 Subject: feat: Add history author/intent metadata and v1 record version (#3205) ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing Adds `author` and `intent` to client history records and DB persistence, including migration/backfill and CLI/daemon propagation. Introduces V2 record-store history version `v1` while retaining read compatibility for legacy `v0` records. Adds `--author` and `--intent` flags to `atuin history start`, plus `{author}` and `{intent}` format keys for listing/history output. Updates shell-integration docs for `ATUIN_HISTORY_AUTHOR` and `ATUIN_HISTORY_INTENT`, and updates related tests/fixtures. Validated with `cargo test -p atuin-client --lib`, `cargo test -p atuin-daemon --tests`, `cargo test -p atuin search::inspector`, and `cargo fmt --check`. --- crates/atuin-client/src/encryption.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/atuin-client/src/encryption.rs') diff --git a/crates/atuin-client/src/encryption.rs b/crates/atuin-client/src/encryption.rs index a56dbd09..f2032482 100644 --- a/crates/atuin-client/src/encryption.rs +++ b/crates/atuin-client/src/encryption.rs @@ -253,6 +253,8 @@ fn decode(bytes: &[u8]) -> Result { cwd: cwd.to_owned(), session: session.to_owned(), hostname: hostname.to_owned(), + author: History::author_from_hostname(hostname), + intent: None, deleted_at: deleted_at .map(|t| OffsetDateTime::parse(t, &Rfc3339)) .transpose()?, @@ -287,6 +289,8 @@ mod test { .duration(1) .session("beep boop".into()) .hostname("booop".into()) + .author("booop".into()) + .intent(None) .deleted_at(None) .build() .into(); @@ -331,6 +335,8 @@ mod test { cwd: "/Users/conrad.ludgate/Documents/code/atuin".to_owned(), session: "b97d9a306f274473a203d2eba41f9457".to_owned(), hostname: "fvfg936c0kpf:conrad.ludgate".to_owned(), + author: "conrad.ludgate".to_owned(), + intent: None, deleted_at: None, }; @@ -352,6 +358,8 @@ mod test { cwd: "/Users/conrad.ludgate/Documents/code/atuin".to_owned(), session: "b97d9a306f274473a203d2eba41f9457".to_owned(), hostname: "fvfg936c0kpf:conrad.ludgate".to_owned(), + author: "conrad.ludgate".to_owned(), + intent: None, deleted_at: Some(datetime!(2023-05-28 18:35:40.633872 +00:00)), }; @@ -383,6 +391,8 @@ mod test { cwd: "/Users/conrad.ludgate/Documents/code/atuin".to_owned(), session: "b97d9a306f274473a203d2eba41f9457".to_owned(), hostname: "fvfg936c0kpf:conrad.ludgate".to_owned(), + author: "conrad.ludgate".to_owned(), + intent: None, deleted_at: None, }; -- cgit v1.3.1