Skip to content

feat: CLI lifecycle commands — status, deprecate, promote, cycle, prune #935

Closed

Description

@ajianaz

Overview

Tambahkan subcommand uteke lifecycle untuk kontrol manual memory lifecycle. User bisa lihat status, soft-delete, restore, run cycle, dan prune.

Commands

# Status overview
uteke lifecycle status
# Output: active=990, deprecated=10, pinned=5, total=1005
#         next_cycle: in 3d 4h
#         deprecated_oldest: 2024-01-15 (25 days until TTL prune)

# Manual soft-delete
uteke lifecycle deprecate <id> [--reason "manual cleanup"]
# Output: ✓ Memory abc123 deprecated (reason: manual cleanup)
#         Use `uteke lifecycle promote abc123` to restore

# Restore deprecated → active
uteke lifecycle promote <id>
# Output: ✓ Memory abc123 promoted back to active

# Run lifecycle cycle now (deprecate cold + prune expired)
uteke lifecycle cycle [--dry-run]
# Output: Lifecycle cycle complete
#         deprecated=10 (cap 1% of 1000)
#         pruned=3 (deprecated >30d)
#         candidates_remaining=15

# Hard-delete expired deprecated (manual prune)
uteke lifecycle prune [--dry-run] [--ttl 30]
# Output: Pruned 3 memories (deprecated >30 days, expired)
#         These memories are permanently deleted.

# List deprecated memories pending review
uteke lifecycle pending [--limit 20]
# Output: 10 deprecated memories pending review:
#         abc123 | "User prefers..." | deprecated 5d ago | TTL in 25d
#         def456 | "Old config..." | deprecated 12d ago | TTL in 18d

Implementation

// crates/uteke-cli/src/main.rs — add Lifecycle subcommand
#[derive(Subcommand)]
enum LifecycleCmd {
    Status,
    Deprecate { id: String, #[arg(long)] reason: Option<String> },
    Promote { id: String },
    Cycle { #[arg(long)] dry_run: bool },
    Prune { #[arg(long)] dry_run: bool, #[arg(long)] ttl: Option<u32> },
    Pending { #[arg(long)] limit: Option<usize> },
}

Files Changed

File Change
crates/uteke-cli/src/main.rs Add Lifecycle subcommand enum + handler
crates/uteke-cli/src/config.rs Wire lifecycle config to CLI startup

Acceptance Criteria

  • lifecycle status shows counts + next cycle estimate
  • lifecycle deprecate soft-deletes with optional reason
  • lifecycle promote restores deprecated memory
  • lifecycle cycle --dry-run previews without modifying
  • lifecycle prune hard-deletes only expired deprecated
  • lifecycle pending lists deprecated with TTL countdown
  • All commands respect lifecycle config
  • Clear output formatting (tables or structured text)

Dependencies

Activity

  1. added this to the milestone on Aug 8, 2026
  2. added
    enhancement
    scope:cli
    rust
    epic:memory-lifecycle
    lifecycle
    on Aug 8, 2026
  3. modified the milestones: , v0.13.0 on Aug 8, 2026
  4. ajianaz commented on Aug 8, 2026

    @ajianaz
    CollaboratorAuthor

    Implemented in PR #938 (merged). Closing as completed.

  5. added 2 commits that reference this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:memory-lifecyclelifecyclepriority:mediumrustscope:cli

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions