Pi compared to our session event catalog
Part of Session Store Research. Produced by running RESEARCH_PROMPT_COMPARISON. Stage-one dossier: Pi. Compared against proto/trogonai/session/sessions/v1alpha1/ and ADR#0035 on 2026-08-04.
Store maturity: 7/12: evolution scars 2/3 (a real, traced two-hop schema migration, migrateV1ToV2/migrateV2ToV3 (packages/coding-agent/src/core/session-manager.ts:230-291), retrofits the tree structure onto flat entries and renames a field; it runs destructively and non-atomically on every load of an old file via _rewriteFile (packages/coding-agent/src/core/session-manager.ts:917-918,979-989); but the evolution is fragmented, not shared: the harness generation abandoned migration entirely for a hard version pin that rejects anything but version === 3 (packages/agent/src/harness/session/jsonl-repo.ts:88-93)), operational age 1/3 (one source-confirmed historical bugfix, packages/coding-agent/scripts/migrate-sessions.sh:1-6, repairing a real v0.30.0 session-misplacement bug, but with no corroborating issue thread establishing scope or severity, and no other operational-failure evidence anywhere in the source), exposure 1/3 (a real, MIT-licensed, vendor-shipped CLI/TUI, but confined to a single-host, single-process surface with no adoption-scale evidence cited, zero cross-process or multi-host coordination anywhere in the storage layer, and the one implementation with genuine transactional durability, the SQLite backend, is a dependency of nothing shipped), design independence 3/3 (no evidence the storage code was forked from another product; the tree-of-entries model and both concurrency primitives read as original to this codebase).
A score of 7/12 clears the "thin evidence" line of 6, so recommendations below are not blanket-labelled thin; individual sub-claims that go beyond what the dossier directly confirms are still flagged inline as inference.
The one structural difference everything else follows from
Pi stores a session as a tree of entries in one JSONL file, addressed by parentId (SessionEntryBase, packages/coding-agent/src/core/session-manager.ts:46-51; SessionTreeEntryBase, packages/agent/src/harness/types.ts:375-380), with a movable "leaf" pointer naming which branch is currently active. Physical append order and logical tree order are two different things: an entry's position in the file says only when it was written, not where it sits in the conversation. Our design (ADR#0035 decision 1) makes a session one linear stream; there is exactly one line, and SessionOrdinal (proto/trogonai/session/sessions/v1alpha1/session_ordinal.proto) is that line's own fold-derived position, never a place in a branching structure. Divergence always mints a new stream (decision 5), it never becomes a second branch inside the same one.
Everything else in this comparison is a consequence of that one choice. Because Pi's "current position" is a pointer into a tree rather than a stream's own tail, the pointer itself becomes a second, independently-durable piece of state that can drift from the entries it names: the CLI resolves it purely by physical last line on every reload (_buildIndex(), packages/coding-agent/src/core/session-manager.ts:958-977), so a branch() call that moves the pointer without a follow-up append is silently reverted the next time the file is read; the harness instead persists the pointer as a first-class LeafEntry{type: "leaf", targetId} (packages/agent/src/harness/types.ts:448-451), written through the same append path as everything else. Two implementations answering "where are we in this session" differently, from the same on-disk format, is the direct fallout of the tree model admitting more than one valid answer to that question in the first place. A linear stream has no equivalent failure mode: its tail is whatever the last successfully-appended event says it is, full stop.
The tree model also explains Pi's four independently-evolved fork mechanisms (/tree, createBranchedSession, SessionManager.forkFrom, and the harness's selection-based SessionRepository.fork()), each solving a differently-scoped version of "which part of the tree becomes the new thing," where our single SessionForked event (decision 5) has exactly one scope: the whole prefix up to context_prefix_boundary, always into a new stream.
Mapping
| Pi field / entry type | Our equivalent | Note |
|---|---|---|
uuidv7() session id, minted independently by CLI (session-manager.ts:208-210) and harness (packages/agent/src/harness/session/repository.ts:14-16) | Opaque session_id; one logical stream per session on session.sessions.events.<session_id> (ADR#0035 decision 1) | Same identity concept, but ours also doubles as the stream address; Pi's does not. |
Path-encoded identity: ~/.pi/agent/sessions/--<encoded-cwd>--/<timestamp>_<uuid>.jsonl, the encoding duplicated verbatim in two places (session-manager.ts:479-482, jsonl-repo.ts:186-188) | No equivalent; addressing is the opaque session_id alone, workspace is a recorded fact, never part of addressing | Ours, decisively: see recommendation 1 and the mismatch row below. |
SessionHeader{version, id, timestamp, cwd, parentSession} (session-manager.ts:30-38) | SessionStarted{session_id, execution_plan, checkout_ref} (session_started.proto) | Semantic mismatch: Pi's version is a mutable, in-place-upgraded format version bumped by a destructive migration; we have no per-session format-version field, because decision 2 forbids editing already-persisted events, so schema evolution is additive at the proto layer, not a migration of stored bytes. |
Entry envelope {type, id, parentId, timestamp} threaded into a tree by parentId (packages/coding-agent/src/core/session-manager.ts:46-51, packages/agent/src/harness/types.ts:375-380) | SessionOrdinal{value} (session_ordinal.proto), a strictly linear, 1-indexed fold-derived position; no event carries a parent-pointer field | Semantic mismatch, the deepest one here: Pi's "position" names a place in a tree with possibly many live branches; ours names a place on one line. This is the structural difference above. |
CLI's leafId, resolved purely by physical last line on reload; harness's persisted LeafEntry{type: "leaf", targetId} | No equivalent needed: a linear stream's current position is always its own tail | Ours, decisively. |
SessionManager.branch(entryId)/branchWithSummary ("rewind" as a leaf-pointer move, not durable until a follow-up append, session-manager.ts:1360-1365) | SessionRewound{session_id, keep_through, reason}, WRITE_PRECONDITION = At(current_position) (session_rewound.proto) | Semantic mismatch: both are called "rewind," but Pi's CLI rewind can be silently undone by a reload if nothing was appended afterward; ours is unconditionally durable the instant it is appended, because append is the only mutation primitive (decision 2). |
Fork, four mechanisms: /tree (no new identity), createBranchedSession for /clone//fork (copies only the active root-to-leaf path, session-manager.ts:1412-1512), SessionManager.forkFrom (copies the whole source file verbatim into a new cwd, session-manager.ts:1579-1630), harness SessionRepository.fork() (selection-based: all/through_entry/before_user_message, repository.ts:51-56) | SessionForked{session_id, source_session_id, context_prefix_boundary, reason}, second event in an atomic [SessionStarted, SessionForked] NoStream batch; inheritance by reference, never physical copy (decision 5) | Ours, decisively: one unambiguous operation with a closed ForkReason enum (MANUAL_BRANCH, COMPACTION_CONTINUATION, RETRY) versus four independently-evolved operations with overlapping names and different copy semantics. See recommendation 1 for the one use case (cross-workspace relocation) Pi's fourth mechanism names that ours does not yet address. |
CompactionEntry{summary, firstKeptEntryId, tokensBefore, details?, usage?, fromHook?}, required-vs-optional field divergence between CLI (packages/coding-agent/src/core/session-manager.ts:69-79) and harness (packages/agent/src/harness/types.ts:403-412, adds retainedTail) | Compacted{session_id, summary_id, summary_content, covers_from, covers_through, trigger, guidance, tokens_before, tokens_after, model, usage} (compacted.proto), one schema, WRITE_PRECONDITION = At | Ours, decisively. |
"Turn," informally defined the same way ours is, used only as a compaction cut-point rule, never stamped on any entry (packages/coding-agent/docs/compaction.md) | turn_id, stamped (never folded) on UserMessageRecorded, every AssistantMessage* event, and ToolCallRequested/ToolCallCompleted (user_message_recorded.proto:12-20, tool_call_completed.proto:22) | Ours, decisively: same concept, but Pi's is application logic, never a durable fact; ours survives compaction and re-identifies a turn's events without re-deriving message-role adjacency. |
Usage/tokensBefore on a compaction summary (packages/coding-agent/src/core/session-manager.ts:69-79), no finality marker | TokenUsage{input_tokens, output_tokens, cache_creation_tokens, cache_read_tokens, cost, completeness}, completeness is UsageCompleteness{FINAL, PARTIAL} (token_usage.proto) | Ours, decisively; the same gap the fx and Cline comparisons independently flagged. |
No claim-check/content-addressing concept anywhere; CompactionEntry.details is arbitrary inlined JSON | ArtifactRef{artifact_id, digest, size_bytes, mime, preview, truncated, untruncated_size_bytes} (artifact.proto), Digest{algorithm, value} (digest.proto) | Ours, decisively. |
Cumulative readFiles/modifiedFiles path lists carried in CompactionEntry.details, deduplicated across compactions | ResourceObservation{uri, content_digest|absent, range, complete} on ToolCallCompleted.observed (resource_observation.proto, tool_call_completed.proto:34) | Trade-off, not a plain win; see below. |
No operation-ledger concept beyond entry-id collision rejection at mint/append time (generateId(), 100-try loop, session-manager.ts:221-227; harness throws on a duplicate id already in its index, jsonl-repo.ts:270) | OperationReserved{session_id, operation_id, request_digest, operation_kind} / OperationOutcomeRecorded{oneof succeeded, failed, cancelled, unknown} / OperationCancellationRequested{session_id, operation_id, reason} | Ours, decisively: a typed, reconciled outcome ledger with a documented indeterminate state, versus Pi's much weaker guarantee. |
Zero subagent/child-session concept: zero grep matches for "subagent" outside documentation; the only appearance is an example extension under packages/coding-agent/examples/extensions/subagent/ | DelegationDispatched/ParentLinked/ParentTerminated/ParentHistoryInvalidated/DelegationDetached/ParentDetached/CascadePolicy (ADR#0035 decision 6) | Deliberate omission, not a defect; see "Subagent cascade" below. |
SessionManager.forkFrom's header parentSession field, used purely for lineage display in the picker's threaded sort mode, no reverse index, no lifecycle coupling (session-selector.ts:209-278) | Same fields as the row above, plus parent_dispatched_at/cross-stream SessionOrdinal reference (decision 2) | Not equivalents: Pi's field links two fully autonomous sessions for display; ours links a parent's live execution to a dependent child's lifecycle. Flagged so the two are not conflated. |
No TTL, no retention policy, no tombstone; deletion is a manual, human-initiated action that calls trash then falls back to unlink, fully removing the file (session-selector.ts:645-680) | SessionHidden{session_id, reason} (session_hidden.proto), a visibility tombstone that deletes no bytes, plus RedactionApplied/ArtifactErased (decision 7) | Ours, decisively; see "Retention on an unbounded log" below. |
SessionInfoEntry/appendSessionInfo, a rename expressed as a new tree entry, resolved by scanning entries in reverse for the latest one (session-manager.ts:1135-1160) | SessionRenamed{session_id, display_name}, a commuting fact, WRITE_PRECONDITION = Any | Equivalent design philosophy: both express a rename as an appended fact, not a header rewrite. One of the few places the two designs independently converged. |
| No archive/unarchive concept: a session either exists or is deleted | SessionArchived/SessionUnarchived, reversible organization state distinct from the terminal SessionHidden, WRITE_PRECONDITION = Any (session_archived.proto, session_unarchived.proto) | Looks incidental, not principled: the picker has sort/filter modes but no distinct archived state. |
Per-file summary read-model rebuilt from scratch on every list()/listAll() call, scanning every byte of every session file (buildSessionInfo, session-manager.ts:687-758); harness's list is header-only and cheap by contrast (jsonl-repo.ts:150-156) | Continuously maintained, incrementally checkpointed SessionProjection (decision 8); listing never re-scans the log | Ours, decisively. |
packages/storage/sqlite-node's real transactional backend and FTS5 search index, built and shipped in the monorepo but wired into nothing (packages/storage/sqlite-node/src/sqlite/search-backend.ts:38-52) | No equivalent concern; exactly one store implementation exists behind trogon-decider/trogon-decider-nats today | Reverse-direction note: Pi's abandoned-but-present SQLite backend is direct evidence for recommendation 2 below. |
| No file-state/environment checkpoint tied to a turn anywhere in the dossier | Checkpoint{reference, checkpoint_type, digest, implementation_version, checkpoint_id, producing_execution_attempt_id, covers_through, session_execution_plan_digest, effective_history_digest, capture_attestation_ref}, carried by CheckpointProduced/ExecutionAttemptStarted.restored_checkpoint | Ours, decisively; also not a false-friend risk, since Pi has nothing playing this role at all, only a plain gap. |
No TodoUpdated-equivalent found anywhere in the dossier | TodoUpdated{session_id, items, revision}, highest-revision-wins fold (todo_updated.proto) | Not established either way: the dossier does not report searching for a plan/task-list concept, so this is "no evidence found," not "confirmed absent." |
No system-notice-equivalent found; the closest is a generic custom entry type, an application-defined extension point (packages/coding-agent/src/core/messages.ts:69-77) | SystemNoticeRecorded{session_id, level, text, tool_call_id}, leveled via NoticeLevel (system_notice_recorded.proto) | Loose equivalent at best: Pi's escape hatch is untyped; ours is a typed, leveled fact. |
What we should consider changing
1. Decide explicitly whether SessionForked should ever cross a CheckoutRef
The change: either add a ForkReason value (or a new field) that names a workspace-relocation fork, or explicitly record in ADR#0035 that a session is never portable across checkout_id and any such move requires a brand-new SessionStarted, not a fork.
Evidence anchor: Pi, store maturity 7/12. SessionManager.forkFrom(sourcePath, targetCwd, ...) is a fourth, distinct fork mechanism whose entire purpose is moving a session's history into a different working directory (session-manager.ts:1579-1630), something none of Pi's other three fork mechanisms do. It exists because Pi's identity is partly path-encoded, so relocating a working directory is itself an operation worth naming. Our CheckoutRef states plainly that "a different checkout requires a new session or a fork" (proto/trogonai/session/sessions/v1alpha1/checkout.proto:11-12), which already anticipates the question but does not answer which of the two it is, or what happens to inherited context computed against the source workspace's uri.
Blast radius: additive if a new ForkReason enum value is the chosen answer; breaking the decision if the ADR owner instead wants to forbid cross-workspace fork outright, since that would need to be stated as an explicit constraint decision 5 does not currently carry.
Why: Pi shows this is a real, named use case in practice (moving a project directory, or handing a session to a teammate on a different machine), not a hypothetical. Leaving it unanswered means the first team to hit it will invent an ad hoc answer rather than a designed one.
Cost: small if additive (one enum value, a validation rule for what context_prefix_boundary means when the workspace changes); the harder cost is deciding what "inherited by reference" means when the referent (ResourceObservation.uri, workspace-relative ArtifactRef state) no longer resolves the same way in the new workspace, which is a real design question, not just a schema one.
2. Require a cross-implementation conformance suite before a second trogon-decider backend ships
The change: add an explicit prerequisite, in ADR#0035 or in the crate's own contribution guidelines, that any second implementation of the trogon-decider trait (an in-memory test double, an embedded/offline mode) must pass a shared conformance suite exercising every WRITE_PRECONDITION class and every commuting-fact fold rule before it ships, rather than relying on documentation and code review to keep it aligned with trogon-decider-nats.
Evidence anchor: Pi, store maturity 7/12. Pi's SessionRepository/SessionStorage interface has three concrete implementations (CLI's hand-rolled SessionManager, harness's JSONL/in-memory/SQLite backends), and two of them have already silently diverged on a single field: CompactionEntry.firstKeptEntryId is required in the CLI's type and optional in the harness's type, which additionally adds a field, retainedTail, that the CLI's type does not have at all (zero matches for retainedTail anywhere under packages/coding-agent/src, against five occurrences in packages/coding-agent/docs/session-format.md). The checked-in documentation then describes the harness-only retainedTail behavior as if it were the CLI's own, calling it "newer harness-generated compactions" (packages/coding-agent/docs/session-format.md:245), which means the divergence is now laundered into a doc that reads as authoritative for both.
Blast radius: additive; a test suite is new tooling, not a schema change, and today only trogon-decider-nats exists (ADR#0035 context, lines 37-38, 85), so there is no existing second implementation to reconcile.
Why: this is exactly the failure mode a shared, typed proto catalog and a single documented decision record are supposed to prevent, but a schema alone does not prevent it; only a suite that runs against every implementation does. Pi is direct evidence that "we have one interface and one reference implementation" degrades quickly into "we have one interface and several implementations that quietly disagree" the moment a second implementation exists, with nothing but prose holding them together.
Cost: engineering time to write and maintain the suite, and a new gate in the review process for any future backend; no cost to trogon-decider-nats today since it is the only implementation.
3. Decide whether a session with no real turn needs its own recorded fact
The change: either state explicitly that folding SessionStarted alone, with zero further events, is always sufficient to answer "was this session ever actually used," or add a distinguishing fact (or reuse SessionHidden's SESSION_HIDDEN_REASON_UNSPECIFIED-adjacent space) for a session that was created but never received a real conversational turn.
Evidence anchor: Pi, store maturity 7/12, inference. The dossier's own synthesis notes Pi's CLI defers the first disk write until the first real content exists (a flushed in-memory flag gates the initial file creation), specifically to avoid littering storage with empty session files from aborted starts. This is inference from the dossier's synthesis section, not a directly cited code path in this document, and is carried forward with that caveat.
Blast radius: additive if the answer is a new optional marker; a no-op (documentation only) if the answer is that SessionStarted alone is already sufficient, since decision 1 already treats stream existence as the only signal needed.
Why: our decision to always mint a real, addressable stream on CreateSession (rather than deferring the write) trades away Pi's "no empty files" property for a much simpler invariant: existence of a stream never needs a second signal to mean "used." That trade looks correct, but it has not been stated as a deliberate decision anywhere read for this comparison, only implied by decision 1's silence on the question.
Cost: low either way; the main cost is the discipline of writing the decision down so it is not re-litigated per-implementation later.
What our design already does better
- Server-enforced optimistic concurrency versus none at all: JetStream's
At(current_position)precondition, enforced via theNats-Expected-Last-Subject-Sequenceheader, rejects a stale writer at the broker (ADR#0035 decision 2). Pi has zero equivalent in either implementation; the dossier's own synthesis states that twoSessionManagerinstances opened on the same path "have no coordination whatsoever," and describes the harness'sKeyedOperationQueue(packages/agent/src/harness/session/keyed-operation-queue.ts:18-43) as pure in-process promise-chain serialization, worthless the moment two processes touch the same file. - Append-only-only mutation versus a destructive, non-atomic full-file rewrite as the migration mechanism: decision 2 makes rewind, revert, compaction, hide, and cancel all new appended events, "never an edit or a delete of stored messages. No command ever purges or trims the stream" (
docs/adr/0035-session-store-decider-aggregate.md:132-134). Pi's version migration truncates and rewrites the entire file in place the first time an old file loads (_rewriteFile,"w"flag, no temp file, no fsync,session-manager.ts:979-989), a confirmed crash-safety gap. - One compaction schema versus two incompatible ones under the same tag:
Compacted(compacted.proto) is a single schema with a single producer path; Pi'sCompactionEntryhas a required-vs-optional field split between its CLI and harness types, with the checked-in doc describing only the harness variant as if it were universal. - A continuously maintained projection versus a full-file rescan on every listing:
SessionProjection(decision 8) versusbuildSessionInfo's from-scratch, every-byte read-model rebuild on everylist()/listAll()call (session-manager.ts:687-758). - Typed, per-entity terminal-outcome resolution versus none described:
ToolCallCompleted/ToolCallFailedandAssistantMessageCompleted/AssistantMessageFailedresolve deterministically under first-terminal-outcome-wins (decision 2); the dossier describes no analogous competing-outcome concept anywhere in Pi. - Workspace binding as a required, immutable, recorded fact versus a plain mutable header field:
SessionStarted.checkout_ref(checkout.proto:11-12) versus Pi'scwd, which the dossier reports has "no reconciliation path... beyond the one historical bugfix script" if the underlying directory moves. - Redaction and erasure as named, typed events versus nothing at all:
RedactionApplied/ArtifactErased(decision 7); the dossier finds "no TTL or lifecycle policy... anywhere in the source" for Pi.
Trade-offs, not gaps
- Tree-of-entries-in-one-file, cheap in-place multi-branch navigation, versus one-fork-per-branch, an atomic, unambiguous new session per divergent branch. Pi's model lets a user cheaply explore many speculative branches from a single file with
/tree, at the cost of the leaf-durability and cross-implementation-position ambiguity documented above; our model costs a new stream per branch viaSessionForked, a cost ADR#0035's own alternatives-considered discussion weighed against physical-copy and shared-snapshot models close to Pi's tree, and rejected deliberately, not by oversight. - Cumulative, deduplicated file-touch bookkeeping (
readFiles/modifiedFiles) versus a per-callResourceObservationdigest. Pi's approach is cheaper to read as "every file this session has ever touched" from one field; ours is more precise, a verifiable digest per read, at the cost that the same "ever touched" view must be built as a fold over everyToolCallCompletedrather than read off a single running list. - Pi's deferred first write, avoiding empty session files from aborted starts, versus our immediate
SessionStartedon everyCreateSession. Pi's approach avoids on-disk clutter at the cost of an implicit, process-localflushedflag as the source of truth for "does this session exist yet"; ours never has an ambiguous "is this persisted" state, at the cost of always minting a real, addressable stream even for a session nobody used (see recommendation 3).
What not to copy
- The truncating, non-atomic, destructive-in-place migration rewrite (
_rewriteFile,"w"flag, no temp file, no fsync,session-manager.ts:979-989), invoked automatically the first time an old-format file is loaded. A crash mid-rewrite leaves a truncated file with no recovery path. - Letting a pluggable interface and its reference implementation diverge silently on required-vs-optional fields, then documenting only one of the two behaviors as if it were universal (
docs/session-format.md:245's description ofretainedTail). See recommendation 2. - Deriving "the current position" from physical append order (the CLI's
leafIdequals the last physical line) instead of recording it as an explicit fact; a non-durable pointer move that a reload can silently undo. - Zero cross-process write coordination in either implementation: no lock file, no CAS, no expected-version precondition on append. Real for a single process, worthless the moment two processes or hosts touch the same file, per the dossier's own synthesis.
- Cumulative, unbounded, recomputed-on-every-list summaries (
allMessagesText,buildSessionInfo) as the entire search story outside an unused SQLite backend: cost scales linearly with total bytes across every session file, on every picker open.
The two gaps the industry has not closed
Subagent cascade
ADR#0035 decision 6 already takes a position: a child session is its own logical stream linked by facts on each side (DelegationDispatched/ParentLinked), parent-first dispatch, acyclicity by construction, rewind-invalidation kept distinct from terminal cascade, and a two-fact detach saga. The question for this section is whether Pi's evidence validates, challenges, or refines that position, not whether we still need one.
What Pi does: nothing. A targeted grep for the literal string "subagent" across packages/coding-agent/src and packages/agent/src returns zero matches outside documentation; the only appearance anywhere is a catalog entry in packages/coding-agent/docs/extensions.md:2969 and an example extension under packages/coding-agent/examples/extensions/subagent/, explicitly sample code demonstrating how a third party could build subagent spawning on top of the public tool-registration API, not a shipped, store-level feature. There is consequently no durable parent-child link for subagents, no inheritance-versus-isolation answer, and no cascade, orphan, or reconcile behavior of any kind to report when a parent session is deleted, rewound, or crashes while a subagent-shaped child would be live, because no such child concept exists to crash or be orphaned. The one actually-implemented parent-child-shaped field, forkFrom's header parentSession, links two independent, fully autonomous sessions for lineage display in the picker's threaded sort mode, with no lifecycle coupling; it answers a different question, fork provenance, and the dossier is careful not to conflate the two.
Does this validate, challenge, or refine decision 6? Neither, cleanly, and that is itself the finding worth recording: Pi is not counter-evidence to decision 6's shape, since it has no cascade mechanism to compare against ours, but it is real evidence for an adjacent claim decision 6 does not currently weigh against, that a shipped, real coding-agent product can function with no store-level subagent concept at all, by leaving "spawn a subagent" entirely to the tool or extension layer, with the store never aware a delegation happened. Formalizing delegation at the store layer buys specific safety properties that only become necessary once a product actually tries to model subagents as sessions with independent lifecycles; Pi simply has not built the feature decision 6 hardens, so its zero-position status is one more data point that most of the corpus has not yet needed to pay this cost, not evidence that the cost is unnecessary.
Retention on an unbounded log
ADR#0035 decision 7 already takes a position: keep-forever, SessionHidden as a visibility tombstone rather than a delete, RedactionApplied for read-time masking, ArtifactErased for out-of-band artifact-byte destruction, and aggregate snapshots that bound replay cost rather than storage size, so resume cost tracks snapshot cadence, not transcript length, relying on decision 8's resume mechanism (load the newest snapshot, replay only the tail after it). The question is whether Pi's evidence validates that design or exposes a cost the ADR does not bound.
What Pi does: nothing bounds growth, and its exposure is structural on both the write and the read path. Appends are cheap, one appendFileSync call per entry (session-manager.ts:1021,1040), so Pi does not reproduce a whole-document-rewrite-per-turn cost. But every open of any session, on either implementation, is a full-file read into memory with no cursor and no size bound: loadEntriesFromFile (session-manager.ts:511-553) and the harness's fs.readTextFile(path) (jsonl-repo.ts:159-174) both buffer the entire file before any use, and there is no snapshot mechanism, no bounded-tail-replay path, and no size cap anywhere in either implementation. Deletion is the only bound on growth, and it is entirely manual, one session at a time, through the picker's deleteSessionFile() (session-selector.ts:645-680); there is no TTL, no scheduled cleanup, and no automatic eviction anywhere in the source. The dossier found no corroborating issue report of this becoming a user-visible problem, so the user-visible-harm half of this claim is source-confirmed only, not issue-confirmed; the structural exposure itself is not in question.
Does this validate, challenge, or refine decision 7? It validates the core design, more sharply than a product with even a partial bounded-replay mechanism would, because Pi has no analogue for one at all: every resume in Pi costs O(total file size), by construction, on every implementation, for every session, regardless of how much of that history still matters to the current turn. Our read path was built to avoid exactly this failure mode from the start. The one caveat, carried forward rather than invented fresh for Pi: decision 7's bound is on how far back model-visible-context compilation reads, bounded by the latest Compacted marker (decision 8), not on how much content accumulates between the last compaction and the current turn; a long uncompacted run has no stated bound on that specific cost. This is the same open edge already surfaced when comparing against other products in this corpus, not a new one Pi's evidence adds, and it remains an agent-loop or compaction-policy question, not a store defect.
Open questions for the ADR
- Should
SessionForked(or a newForkReasonvalue) address forking a session into a differentcheckout_idexplicitly, givenCheckoutRefstates that "a different checkout requires a new session or a fork" (checkout.proto:11-12), and if it is allowed, what happens to context inherited by reference (ResourceObservation.uri,ArtifactRef) that was computed against the source workspace? - If a second implementation is ever built behind
trogon-decider, should a cross-implementation conformance suite be a stated prerequisite before it ships, given how quickly Pi's own reference-and-pluggable split diverged on required-versus-optional fields with nothing but documentation holding them together? - Does the platform need an explicit, recorded fact for a session that never receives a real conversational turn, or is folding
SessionStartedalone, with no further events, always sufficient at the read-model layer to answer whether a session was ever really used? - Who is responsible for guaranteeing
Compactedmarkers are emitted often enough that model-visible-context compilation never has to walk an unboundedly long uncompacted tail: the agent loop's compaction-trigger policy, or a store-side backstop?
