Skip to content

feat(storage): define data retention contract#928

Closed
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/data-retention-contract
Closed

feat(storage): define data retention contract#928
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/data-retention-contract

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Problem

Kun has log-only retention settings, but storage cleanup also needs a consistent policy for threads, attachments, checkpoints, worktrees, diagnostics, extension logs, and model caches.

Scope

Adds a shared category allowlist and strict retention policy normalizer. Categories accept bounded day counts or null for keep-forever. Age checks revalidate untrusted policies and retain data on invalid/future timestamps.

Non-goals

No automatic deletion, disk scanner, backup integration, quota UI, or settings migration is included; those are separate PRs.

Tests

  • npm.cmd exec vitest run src/shared/data-retention.test.ts (9 passed)
  • npm.cmd run typecheck
  • npm.cmd --prefix kun run typecheck
  • npm.cmd run lint
  • npm.cmd run build
  • git diff --check

Review

Completed functional, data integrity, security, cross-platform, compatibility, and scope review. No package smoke is claimed because this PR is a shared contract-only change.

Issue

Part of #885

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

The Windows packaged check is failing before this storage-only change reaches any behavior: the smoke waits for the packaged Extension guest target and times out. This is the same shared guest-target selector issue fixed independently in #915, so I am keeping that CI fix out of this storage contract PR to preserve scope. Once #915 is merged, this check should be rerun.

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

Superseded by #944, which consolidates storage usage reporting, safe cleanup decisions, and data-retention validation into one reviewed PR. Closing this split PR to avoid duplicate review.

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

Closed in favor of #944.

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