generated from coulomb/repo-seed
Add profile-driven lifecycle rules
This commit is contained in:
118
workplans/PMEM-WP-0009-profile-driven-lifecycle-rules.md
Normal file
118
workplans/PMEM-WP-0009-profile-driven-lifecycle-rules.md
Normal file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
id: PMEM-WP-0009
|
||||
type: workplan
|
||||
title: "Profile-Driven Lifecycle Rules"
|
||||
domain: markitect
|
||||
repo: phase-memory
|
||||
status: finished
|
||||
owner: codex
|
||||
topic_slug: phase-memory
|
||||
created: "2026-05-18"
|
||||
updated: "2026-05-18"
|
||||
---
|
||||
|
||||
# PMEM-WP-0009: Profile-Driven Lifecycle Rules
|
||||
|
||||
## Goal
|
||||
|
||||
Let Markitect-compatible memory profiles drive lifecycle planning directly,
|
||||
instead of requiring every retention, refresh, compaction, and transition
|
||||
parameter to be passed by hand.
|
||||
|
||||
This moves the phase domain model and lifecycle planning rows toward their
|
||||
target maturity by turning profile policy into executable dry-run behavior.
|
||||
|
||||
## Current Evidence
|
||||
|
||||
PMEM-WP-0008 added profile-derived runtime configuration. Lifecycle planning
|
||||
still depended on explicit CLI/runtime parameters for stale/delete thresholds,
|
||||
refresh digests, and compaction targets.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Mutate durable lifecycle state automatically.
|
||||
- Add physical delete behavior.
|
||||
- Replace review gates for stabilization, rigid promotion, refresh, or
|
||||
compaction.
|
||||
- Build a profile migration engine.
|
||||
|
||||
## Implementation Update - 2026-05-18
|
||||
|
||||
Implemented the first profile-driven lifecycle rules slice:
|
||||
|
||||
- Added `LifecycleRuleConfig` with retention, transition, refresh, and
|
||||
compaction rule extraction from `ProfileIntent` or mappings.
|
||||
- Added profile-derived retention planning.
|
||||
- Added profile metadata phase transition rules.
|
||||
- Added `plan_lifecycle_from_profile(...)`.
|
||||
- Added `PhaseMemoryRuntime.plan_lifecycle_with_profile(...)`.
|
||||
- Added CLI `graph lifecycle --profile`.
|
||||
- Added local service runner support for profile-driven lifecycle planning.
|
||||
- Added docs, README examples, and regression tests.
|
||||
|
||||
## T01 - Add lifecycle rule config
|
||||
|
||||
```task
|
||||
id: PMEM-WP-0009-T01
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Derive retention, transition, refresh, and compaction rule settings from a
|
||||
profile.
|
||||
|
||||
## T02 - Plan retention from profile rules
|
||||
|
||||
```task
|
||||
id: PMEM-WP-0009-T02
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Support default retention rules and node-kind-specific retention rules.
|
||||
|
||||
## T03 - Plan phase transitions from profile metadata
|
||||
|
||||
```task
|
||||
id: PMEM-WP-0009-T03
|
||||
status: done
|
||||
priority: medium
|
||||
```
|
||||
|
||||
Support first-slice metadata transition rules with node kind, source phase,
|
||||
target phase, minimum age, and review-gated transition actions.
|
||||
|
||||
## T04 - Wire runtime and CLI profile lifecycle planning
|
||||
|
||||
```task
|
||||
id: PMEM-WP-0009-T04
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Expose profile-driven lifecycle planning through the runtime facade and CLI.
|
||||
Include local service runner handling for the same contract.
|
||||
|
||||
## T05 - Document and test the rule path
|
||||
|
||||
```task
|
||||
id: PMEM-WP-0009-T05
|
||||
status: done
|
||||
priority: medium
|
||||
```
|
||||
|
||||
Add lifecycle rule docs, README examples, fixture coverage, transition rule
|
||||
coverage, and CLI regression coverage.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- Profile retention rules can produce lifecycle actions.
|
||||
- Profile transition metadata can produce review-gated phase transitions.
|
||||
- Refresh and compaction remain deliberate caller/profile inputs.
|
||||
- Runtime and CLI envelopes expose the derived rule config.
|
||||
- Tests cover fixture-derived rules and explicit transition rules.
|
||||
|
||||
## Closure Review - 2026-05-18
|
||||
|
||||
Closed after adding executable profile lifecycle rules, runtime/CLI support,
|
||||
documentation, and deterministic regression tests.
|
||||
Reference in New Issue
Block a user