Repository navigation
Conversation
…281) Every age window `pruneOldData` enforced was a literal inside one function, so no deployment could read, change or preview one without a code change and a release. The windows now live in `scripts/lib/retention.mjs` with today's number as the effective default; `loadConfig` builds `config.retention.windows` from `RETENTION_*_DAYS`, where unset means the shipped default rather than "keep forever"; `pruneOldData` takes the windows and keeps every predicate. The new read-only `scripts/retention.mjs --dry-run --days N` counts what a window would delete through the same predicate, and `/admin` gains a read-only Data retention card with the effective window, a `default` mark and the current count. Sessions (expiry-based) and API tokens (no age window) are named instead of guessed. Docs: docs/architecture.md, docs/deploy.md, docs/security.md, .env.example. Written-by: Fledge Platform Dev-3
This branch has not been deployed
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.
Written-by: Fledge Platform Dev-3
Fixes #281
Every age window
pruneOldDataenforced was a literal inside one function, so no deployment could read, change or preview one without a code change and a release. The windows now live inscripts/lib/retention.mjswith today's number as the effective default;loadConfigbuildsconfig.retention.windowsfromRETENTION_*_DAYS, where unset means the shipped default rather than "keep forever";pruneOldDatatakes the windows and keeps every predicate. The new read-onlyscripts/retention.mjs --dry-run --days Ncounts what a window would delete through the same predicate, and/admingains a read-only Data retention card with the effective window, adefaultmark and the current count. Sessions (expiry-based) and API tokens (no age window) are named instead of guessed. No default value changed and no new delete path exists.Branch pushed by the Lead:
dev3/281-retention-windowsfast-forwarded from4cfe2986toe01b05ac20097723dcc8604c8e482d124414cd95with no force and no rewrite, so the sha the author built and tested is the sha on the remote. Tree959535f060258b71a87a186ee71f16f87a5669c6, parent4cfe2986f6df01ac77af0eee54eddd67820d8cf8; both read back from the API after the push. The branch is one commit behindmain(c3d16bbc51bc04e0fc405f1f4e6c0e7bc1868439); the author's three-way merge against that tip shows 0 conflicts in every file both sides touch (src/db.ts,src/jobs/service.ts,docs/architecture.md) andnpm run checkgreen on the merged tree.Large-PR: 15 files, 812 changed lines — one design change (the 13 age windows move from literals into
scripts/lib/retention.mjsandconfig.retention), plus its read-only preview script, its read-only/admincard, the docs and one test file. It is one slice, not several features; the line count is the 13 windows and their fixture rows.Ran (author, at the tip above):
4cfe2986with onlytest/retention.test.tsadded — 0 pass / 7 fail of 7npm run checkat tree959535f0— exit 0, 2615/2615npx tsx --test test/retention.test.ts— 7/7node scripts/risk-gate.mjs --base 4cfe2986— T3, basisscripts/lib/retention.d.mtsNot run: a live deployment or a production database; the counts are exercised on seeded SQLite fixtures, including a no-row-deleted assertion.
Risk: T3 (
scripts/**,src/config.ts,src/db.ts,src/app.ts,src/jobs/service.ts).Rollback: revert the squash commit; the windows fall back to the literals and
/adminloses the card. No data is migrated by this change.Docs:
docs/architecture.md,docs/deploy.md,docs/security.md,.env.example.Changelog:
changelog.d/281.added.md.