Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

docs(sessions): specify native session deduplication

vastsa530b6dbb91c8
diff --git a/docs/spec/03-runtime/04-data-storage.md b/docs/spec/03-runtime/04-data-storage.md
index bcb12e6c0..e9bc11c0b 100644
--- a/docs/spec/03-runtime/04-data-storage.md
+++ b/docs/spec/03-runtime/04-data-storage.md
@@ -1700,6 +1700,11 @@ source-discriminated transcript authority owned by the Node agent sidecar. They
are never inserted into SQLite and never copied to the Desktop transcript
directory. `session.list` merges their projections with Rust-owned
Desktop summaries, and `session.get` routes by the opaque `native-pi:` id.
+Discovery deduplicates native files that share the same JSONL `header.id`,
+keeping the projection with the newest transcript `updatedAt`. The selected
+file retains its path-derived opaque session id; duplicate files are not
+rewritten or deleted, and their paths are omitted from the in-memory lookup
+map for the current scan.
Detail reads take an immutable byte snapshot, parse it into an in-memory
`SessionManager`, and follow the current native branch. They must not call
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index bd4b51612..7bae4144e 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -15440,6 +15440,19 @@ plugin-form fixtures in an isolated temporary directory at runtime.
- **Specs:** IPC native routing; runtime §12; storage §12; security §12.
- **Status:** Documented; run after integration into main.
+### E2E-SESSION-native-pi-duplicate-id-collapses
+
+- **Preconditions:** An isolated Pi agent directory contains a valid native v3
+ session and a copied JSONL file under a nested directory with the same
+ `header.id`.
+- **Steps:** Start PI-Desktop with the fixture-only agent directory, refresh the
+ session list, open the listed native session, and search its transcript.
+- **Expected:** The list contains one row for that native id. Detail and search
+ resolve through the selected file; duplicate files remain byte-identical and
+ are not rewritten or deleted.
+- **Specs:** runtime §12; storage §12; ADR 0254.
+- **Status:** Source-regression covered; full Desktop journey Draft.
+
### E2E-SUBAGENT-ordered-model-fallback-preserves-work