Skip to content

SCA-2323: ci(platform): enable the Firestore TTL policy for the capture lifecycle ledger - #25325

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/lifecycle-ledger-ttl
Nov 15, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/lifecycle-ledger-ttl

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

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 sync
ledger TTL": after it enables and verifies the TTL policy on sync_content_ledger, it does the same for the
pipeline_ledger collection group (expires_at). Thirteen added lines in an existing composite action. No
new workflow, no change to triggers, permissions, secrets or inputs; the step keeps its name and its
condition (mode == 'platform' and provision_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 after
a 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_ledger whose expires_at has passed. Rows written before #25304 that are not
terminal have expires_at unset and are not touched by the policy. Nothing outside that collection group is
affected. 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 are
derived 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

View guided diff Turn on auto-fix

…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]>
@Git-on-my-level Git-on-my-level self-assigned this Nov 14, 2026
@Git-on-my-level Git-on-my-level changed the title ci(platform): enable the Firestore TTL policy for the capture lifecycle ledger SCA-2323: ci(platform): enable the Firestore TTL policy for the capture lifecycle ledger Nov 14, 2026
@Git-on-my-level
Git-on-my-level merged commit 1209ca2 into main Nov 15, 2026
71 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/lifecycle-ledger-ttl branch November 15, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant