simplify(sessions): delete the test-only transcript upsert port - #2752
Merged
Merged
Conversation
Production transcript ingest only advances cursors through TranscriptWriteBatch::advance_offset; session and message rows arrive through observation admission and projection. The Upsert write kind and its global-db/session-store chain (upsert_transcript_batch, persist_transcript_batch_result, the Git-evidence variant, batch message staging, write-time timestamp normalization) were reachable only from tests. Delete that chain, the unreachable TranscriptStoreError variants and their ingest failure codes, TranscriptBatch, and TranscriptGitEvidence. TranscriptWriteBatch now carries only the offset pair. Fixture helpers seed session rows plus raw LCM messages through the existing upsert_session and lcm_ingest_raw_message primitives and return typed errors instead of a swallowed false. Tests that only protected the Upsert write (restart/replay, rollback, identity validation, full-batch CAS, write-time microsecond normalization) are removed; the profile-scope Git-evidence refusal now exercises the production span writer.
|
ScriptedAlchemy
deleted the
fleet/legacy-api-sweep-transcript-upsert
branch
September 30, 2026 07:57
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.
What
Production transcript ingest only advances cursors through
TranscriptWriteBatch::advance_offset; session and message rows arrive through observation admission and projection (since #2748/#2730). The whole Upsert write side was reachable only from tests, i.e. a test-only production port. This deletes it and migrates every test caller.Deleted (no non-test callers, confirmed with rg plus an all-targets clippy build):
TranscriptWriteBatch::upsert/upsert_with_cursor,TranscriptWriteKind(the batch now carries only the offset pair), and their unit testsGlobalDbTranscriptStore::persist_batchRegisteredGlobalDb::{upsert_transcript_batch, persist_transcript_batch_result, persist_transcript_batch_with_git_evidence_result}and theSessionStoreAccesschain behind them (upsert_transcript_batches_inner, batch message staging, write-time timestamp normalization, in-batch Codex goal reconciliation),TranscriptGitEvidence,TranscriptBatchTranscriptStoreError::{InvalidTranscriptPath, MissingTranscriptPath, MessageIdentityMismatch}and their ingest failure codes (only Upsert could produce them)upsert_transcript_batch_for_test(project test_support, dashboard test runtime), the unused global-db harnessupsert_session_message_for_test, andset_parse_offset_insert_failure_for_testmerge_session_metadatacommentMigration
Fixture seeding goes through the existing primitives
upsert_session+lcm_ingest_raw_message(no new port):seed_session_messages_for_test(scope, session, messages) -> Result<Vec<i64>>replacesupsert_transcript_batch_for_test(the dropped cursor key/offset args were never read back by any caller)upsert_session_message_for_testnow returnsResult<()>instead ofOk(false)on a swallowed write failureRegisteredGlobalDbcallers (session-runtimelcm_effects, retained profile, temporal worker, daemon retention, automation fixtures) ingest raw messages directlyTests deleted because they only protected the Upsert write: six
session_suite::transcript_storefull-batch tests (restart/replay, rollback, invalid batch, stale CAS, concurrent full batches, summary metadata survive-persist), the store-crate Upsert validation tests, the staging-attribution unit test, and thelcm_dagre-seed that asserted write-time microsecond-to-second normalization. The threeadvance_offsettests stay. The profile-scope Git-evidence refusal test now exercises the production span writer (record_span_observation) instead of the deleted transcript Git-evidence path.Proof
This is a behavior-preserving deletion (
simplify). It adds no behavior, so there is no new test that fails on master; the evidence is that every suite covering the remaining path passes.Tests (non-zero counts):
cargo clippy -p tracedecay-store -p tracedecay-sessions -p tracedecay-global-db -p tracedecay-session-memory -p tracedecay-project -p tracedecay-session-runtime -p tracedecay -p tracedecay-cli --all-targets --features ... -- -D warnings: cleancargo fmt --all -- --check: cleancargo check --workspace --all-targets --target x86_64-pc-windows-gnu --features tracedecay/test-transport,tracedecay/test-helpers,tracedecay-cli/test-transport: 0 errors (warnings are pre-existing cfg(windows) ones in untouched crates)Pre-existing, not caused by this PR:
tracedecay-global-db observation_collision_tests::vibe_jsonl_eof_refusal_survives_retention_generation_and_restart_without_reworkfails identically on origin/master 411312b (same panic at observation_collision_tests.rs:2730), tracked in #2740.Runtime journey on the built debug CLI (isolated HOME/TRACEDECAY_DATA_DIR, one daemon under
systemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G, a Claude transcript bound to a scratch git project):Ripwire:
--quality-deltaexit 0 (remaining rows are small constructor/wrapper shape clones and churn, no gating finding caused by this change);--edit-checkonTranscriptWriteBatch,TranscriptWriteBatch::into_parts,TranscriptStoreError,persist_batch,upsert_session_message_for_test,seed_session_messages_for_test: incompatible=0.