Design: reset and replay from the CloudTrail log - #54
Merged
Conversation
Treats CloudTrail as the transaction log and TrailTool's DynamoDB tables as a derived, disposable projection. Two primitives: replay (re-ingest historical S3 objects through the existing Lambda path) and reset (drop the projection so it can be rebuilt cleanly). Part of #49 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 tasks
Drop the scripts/ fallback; reset and replay ship as trailtool reset and trailtool replay, with a combined --reset rebuild path. Part of #49 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 26, 2026
Removes overstated safety claims and scopes v1 to a correct offline rebuild: - The ingestor marker is a sequential-redelivery guard, not general idempotency (racy read-then-unconditional-write). Drop "idempotency comes for free"; overlap with live delivery is a non-goal needing an atomic claim (deferred). - Replay is sequential. Cross-file attribution is order-sensitive and never repaired, so concurrency is deferred until aggregation is order-independent. No worker pool, no reorder window. - Day-only ranges; no sub-day instants that would silently replay whole boundary days into the projection. - No persistent resume cursor in v1 (the earlier one survived reset yet did not survive a kill). A generation-bound checkpoint is a follow-up. - Reset is explicitly offline; cross-table truncation is not atomic. An ingestion fence is the principled fix (deferred). --yes skips the count query. - Note that raw-key order is chronological only within one account/region prefix. Part of #49 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Amended after review. The doc now describes a correct offline-rebuild v1 rather than overstating what the reused Lambda path gives for free:
|
Rewrites the doc to lead with what gets built (two CLI commands) in plain terms. The transaction-log/projection idea is now a single line of inspiration, not the vocabulary. - Removes the "why invoke the Lambda vs. re-ingest locally" section: it argued against an option no one proposed. - Replaces the "offline rebuild / no overlap / atomic claim required" framing with the actual rule: replay past (closed) days, whose objects are disjoint from live delivery, so replay and live ingestion can run concurrently without double-counting. - Reset simply asks that live delivery be quiet (infrequent, deliberate action); drops the labored cross-table-atomicity argument. Part of #49 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Simplified the framing:
Command help on #55 and #56 updated to match. Issue #49 rewritten in the same plain terms. |
--bucket is optional; replay reads the bucket name from the ingestor CloudFormation stack (CloudTrailBucketName output, parameter fallback) rather than making the operator retype what the deployment knows. Part of #49 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Design doc for #49.
Frames CloudTrail as the transaction log and TrailTool's DynamoDB tables as a derived, disposable projection.