Skip to content

feat: Lifecycle UI — status, cycle, orphans, restore - #236

Open
ajianaz wants to merge 3 commits into
developfrom
feat/lifecycle-ui-227
Open

feat: Lifecycle UI — status, cycle, orphans, restore#236
ajianaz wants to merge 3 commits into
developfrom
feat/lifecycle-ui-227

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implementasi Phase 1 Lifecycle UI untuk Corin — full 5-layer stack dari Rust client sampai Svelte view.

Changes

Layer 0: uteke_client.rs

  • LifecycleStatus struct: active, deprecated, pruned counts
  • LifecycleCycleResult struct: deprecated, pruned, skipped counts
  • OrphanMemory struct: id, content, tags, namespace, importance, created_at
  • 5 client methods:
    • lifecycle_status() → GET /lifecycle/status
    • lifecycle_cycle() → POST /lifecycle/cycle
    • lifecycle_promote() → POST /lifecycle/promote
    • find_orphans() → POST /orphans
    • consolidate() → POST /consolidate (always dry_run from Corin)

Layer 1: commands.rs + lib.rs

  • 5 Tauri commands dengan pattern yang konsisten dengan existing commands
  • All registered in generate_handler![]

Layer 2: types.ts + ipc.ts

  • 3 TypeScript interfaces matching Rust structs
  • 5 IPC wrapper functions

Layer 3: LifecycleView.svelte (751 lines)

  • Status cards: Active / Deprecated / Pruned dengan color-coded icons
  • Memory health bar: visual ratio active vs deprecated
  • Run Cycle button dengan confirmation modal (menampilkan count deprecated yang akan affected)
  • Orphaned memories list: cards dengan content preview, tags, importance, restore button
  • Graceful 404 handling: jika uteke < 0.13.0 tidak support lifecycle, tampilan tetap menampilkan placeholder zeros + pesan informatif

Layer 4: Sidebar + App routing

  • HeartPulse icon dari lucide-svelte
  • View type extended: 'lifecycle' added
  • View switch di App.svelte

Testing

  • Static verification: semua type names, method signatures, invoke command names konsisten across 5 layers
  • Svelte 5 syntax verified (event handlers, $state, $effect, $props)
  • cargo check — blocked oleh missing libglib2.0-dev di server ini (desktop build dependency)
  • pnpm check — blocked oleh Tauri build dep chain
  • Manual UI testing

Notes

Closes #227

Layer 0 (uteke_client.rs):
- LifecycleStatus, LifecycleCycleResult, OrphanMemory structs
- lifecycle_status() → GET /lifecycle/status
- lifecycle_cycle() → POST /lifecycle/cycle
- lifecycle_promote() → POST /lifecycle/promote
- find_orphans() → POST /orphans
- consolidate() → POST /consolidate (dry_run only)

Layer 1 (commands.rs + lib.rs):
- 5 Tauri commands: lifecycle_status, lifecycle_cycle,
  lifecycle_promote, find_orphans, consolidate_memories
- All registered in generate_handler![]

Layer 2 (types.ts + ipc.ts):
- LifecycleStatus, LifecycleCycleResult, OrphanMemory interfaces
- 5 IPC wrapper functions

Layer 3 (LifecycleView.svelte):
- Status cards: Active / Deprecated / Pruned counts
- Memory health bar (active vs deprecated ratio)
- Run Cycle with confirmation modal
- Orphaned memories list with restore button
- Graceful 404 handling for older uteke versions

Layer 4 (App.svelte + Sidebar.svelte):
- HeartPulse nav icon added to sidebar
- View switch routing to LifecycleView
- View type extended with lifecycle

Closes #227 (partial — consolidate preview in #230)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
loading = false;
}
}

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

- cargo fmt reformatted lifecycle method signatures
- class:spinning directive is invalid on Svelte components
  (lucide-svelte icons) — wrap in <span class:spinning> instead

Fixes CI: Rust Format + Frontend Build failures on PR #236
Cora Review caught double loadData() call: onMount + $effect
both fired on component init, causing race condition.

Removed onMount, kept $effect which covers both init + namespace change.
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.

feat: Lifecycle status + deprecated list — read-only MVP

2 participants