feat(capture): pending-transaction garbage collection (#215) - #247
Merged
Conversation
Pending files written by prepare accumulate without bound because no pipeline step removes them. This adds gcPending(cwd) which removes files when now > expires_at and phase is not staged/applied, removes consumed files past a 24h retention window, and skips any file whose age or phase cannot be determined. Wired as commitlore capture gc. Limit: src/core/pending-gc.ts -- gc must never remove a staged or applied file regardless of expiry; T-1018 post-commit may still finalise them Record-Id: r-c44a1edb
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (52)
Ruled out (95)
Warnings (39)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
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.
Summary
Closes #215 (T-1019). Independent audit finding — P1 operational hygiene, not a gate row.
preparewrites a pending file on every capture attempt, including attempts whose verification returns nothing, and nothing removes them. This addsgcPending(cwd)and thecommitlore capture gcsubcommand.Behaviour
now > expires_atANDphaseis neitherstagednorappliedconsumed: truefile older than 24h retention windowstaged/appliedfiles — T-1018's post-commit may still finalise themWhat was tested
tsc -p tsconfig.json --noEmitandtsc -p bench/tsconfig.json --noEmitexit 0dist/committed from clean buildFiles changed
src/core/pending-gc.ts(new) — gc logicsrc/commands/capture.ts— addedgcsubcommand onlytest/pending-gc.test.ts(new) — 17 tests including 4 mutation oraclesdist/— rebuilt