Repository navigation
SCA-2323: ci(platform): enable the Firestore TTL policy for the capture lifecycle ledger - #25325
Merged
Merged
Conversation
…le ledger The existing platform step that provisions and verifies the sync ledger TTL now does the same for the pipeline_ledger collection group. Ledger rows are content-free, derived, one per capture, and carry their own expires_at; without the policy nothing removes them. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Enable the Firestore TTL policy for the capture lifecycle ledger
Split out of #25304 on purpose. Tracking: SCA-1760. Should merge after #25304, which adds the writers whose
rows this expires; merging it earlier is harmless.
Failure-Class: none
What changed
.github/actions/sync-backfill-lifecycle/action.yml, the existing platform step "Provision and verify syncledger TTL": after it enables and verifies the TTL policy on
sync_content_ledger, it does the same for thepipeline_ledgercollection group (expires_at). Thirteen added lines in an existing composite action. Nonew workflow, no change to triggers, permissions, secrets or inputs; the step keeps its name and its
condition (
mode == 'platform'andprovision_sync_ledger_ttl == 'true').Why
Ledger rows are one small, content-free document per capture: stage, deadlines, bounded reasons and
timestamps. They are derived state, never user content. Each row carries its own
expires_at(26 hours aftera terminal; 7 days after the last transition for a nonterminal row, added in #25304). Without the TTL policy
that field does nothing and the collection grows by one row per capture forever.
What it deletes, exactly
Only documents in
pipeline_ledgerwhoseexpires_athas passed. Rows written before #25304 that are notterminal have
expires_atunset and are not touched by the policy. Nothing outside that collection group isaffected. Raw audio and conversations are not involved. Conversation deletion and account erasure already
remove ledger rows directly, with or without this.
Approval basis
Standing approval from the owner (2026-11-15): expiry on derived, content-free collections with the
retention stated, and edits to existing
.github/actions that add no workflow and change no triggers,permissions or secrets, are covered by a test and are called out here.
Rollback
Revert this PR, then disable the policy once:
gcloud firestore fields ttls update expires_at --collection-group=pipeline_ledger --disable-ttl. Documents already expired are not restored; they arederived and are rewritten by the next transition of a live capture.
Tests
backend/tests/unit/test_sync_two_lane.py: the step enables and then verifies the policy for both ledgers,enables exactly two, and contains no delete or disable.
🤖 Generated with Claude Code