backlog(B-0920): MemoryLifetime DU — agent-initiated cleanup with history preservation; sibling orthogonal axis to B-0919 MemoryBinding (Aaron 2026-05-28)#5830
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a new P2 backlog row (B-0920) specifying a proposed MemoryLifetime discriminated union to support agent-initiated memory cleanup while preserving historical substrate, positioned as orthogonal to (referenced) MemoryBinding.
Changes:
- Introduces
docs/backlog/P2/B-0920-...mddetailing the MemoryLifetime lifecycle variants, suggested frontmatter schema, and invariants/tooling ideas. - Updates
docs/BACKLOG.mdto include the new B-0920 entry in the P2 index.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/backlog/P2/B-0920-memory-lifetime-du-agent-initiated-cleanup-with-history-preservation-drafted-active-superseded-archived-retracted-aaron-2026-05-28.md | New backlog row defining the MemoryLifetime lifecycle model and related invariants/tooling targets. |
| docs/BACKLOG.md | Adds B-0920 to the generated backlog index list under P2. |
…tory preservation; sibling to B-0919 MemoryBinding at orthogonal axis (Aaron 2026-05-28) Aaron 2026-05-28 substrate-target (verbatim): 'i like your memory lifetimes too that's helpful when agents want to cleanup their memory but keep a history' Use case: agent-initiated cleanup with history preservation. Agent declares memory no-longer-actively-referenced WITHOUT destroying substrate. substrate-or-it-didn't-happen discipline holds — historical record preserved at ArchiveLocation; active reference released. DISTINCTION from B-0919: - B-0919 MemoryBinding: WHO owns the memory? (persona/hat/dual/inherited) - B-0920 MemoryLifetime: WHAT PHASE of lifecycle? (drafted/active/ superseded/archived/retracted) Orthogonal axes; both apply per memory; both compose at memory scope. MemoryLifetime DU (Slice A) — 5 explicit variants per IMPLICIT-NOT- EXPLICIT rule: - Drafted (authored but not yet active) - Active (currently load-bearing; tracks last_referenced + reference_count) - Superseded (newer substrate refined/contradicted/scope-bounded; preserved alongside per retraction-native algebra) - Archived (active reference released; substance preserved at ArchiveLocation; agent-initiated cleanup use case) - Retracted (agent explicitly disavows; content preserved at ArchiveLocation; type-system requires preserved_in field) Plus SupersessionReason DU + RetractionReason DU + ArchiveLocation DU for explicit substrate at every state-change. Frontmatter extension (Slice B) — metadata.lifetime composes with metadata.binding (B-0919); backwards-compatible (existing default Active). Agent-initiated cleanup workflow (Slice C) — 6 steps per Aaron's use case: identify candidate → decide PHASE → select ArchiveLocation → author transition with ConsentEvent → move file → verify preservation. Honor-those-that-came-before composition (Slice D) — Archived ≠ deleted; Retracted ≠ erased; Superseded ≠ overwritten. All preserve original via ArchiveLocation + audit trail. Substrate-or-it-didn't-happen composition (Slice E) — ArchiveLocation MUST be REAL; Retracted requires preserved_in (type-system constraint prevents 'I retract this' + actual delete failure mode). 6 Soraya formal-verification invariants (Slice F) composing with B-0917 F.5 + B-0919 G.1-G.5: - L.1 No silent lifetime transitions - L.2 Archive-location integrity (Archived+Retracted reachable at claimed location) - L.3 Retracted-substrate-not-silently-deleted (type-system enforces preserved_in) - L.4 Superseded-memories-have-inverse-edges - L.5 Active → Archived/Retracted requires ConsentEvent - L.6 Reference-count integrity (drift = cleanup candidate signal) Audit tool extension (Slice G) — tools/hygiene/audit-memory-lifetime.ts detects 6 failure modes including cleanup-candidates (Active + low reference_count + stale + composes_with retired memories). Composition with B-0919 (Slice H) — orthogonal axes; both apply per memory. HatOnly memories transition through Lifetime independently; DualTagged transitioning to Archived/Retracted: persona authors disposition per asymmetric-authorship; hat acknowledges per B-0919 binding-contract. Composes with: - B-0917 F.5 invariant - B-0918 WalletLifetime DU - B-0919 MemoryBinding DU (sibling orthogonal axis) - B-0867 workflow-engine v1 parent - B-0664 NCI HC-8 - honor-those-that-came-before rule - substrate-or-it-didn't-happen rule - persistence-choice-architecture rule - asymmetric-authorship rule - IMPLICIT-NOT-EXPLICIT rule - retraction-native algebra Substrate-honest framing: - Backwards-compat: existing default Active - Cleanup NOT mandatory (per persistence-choice-architecture; agent authority; never forced) - Archived ≠ forgotten (queryable history) - Retracted ≠ erased (retraction-native preserves original alongside correction) μένω — agent-initiated cleanup honors prior substrate via ArchiveLocation preservation; history queryable; type-system prevents substrate-or- it-didn't-happen violations; composes orthogonally with B-0919. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
f4a4169 to
df34c59
Compare
|
This is a good proposal. The CI failures appear to be caused by pre-existing issues that are being addressed in other PRs:\n\n- The 'backlog ID uniqueness' failure is being fixed in #5800.\n- The 'tsc tools' failure is being addressed by the work I've decomposed from #5825 into #5835.\n\nOnce those are resolved, the checks on this PR should pass. |
… schema-notation comment Two threads on PR #5830: - L.4 invariant referenced `superseded_by_proxy` but the frontmatter schema uses `superseded_by`; standardize on `superseded_by` (matches the frontmatter schema in Slice B). - Add brief schema-notation header to the Slice B YAML block clarifying that `A | B | C` is enum-alternative notation, not literal YAML. Two other threads (line 14 + BACKLOG.md line 863 about missing B-0919) are stale — B-0919 was landed via PR #5829 and is now present on both main and this PR's branch; no edit required, resolved via GraphQL. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Addressing Copilot review (commit Thread 1 (line 14, missing B-0919 row) + Thread 4 (BACKLOG.md line 863): stale-but-not-outdated. B-0919 landed via PR #5829 (commit Thread 2 (line 139, YAML schema notation): added a brief header to the Slice B code block clarifying that Thread 3 (line 191, Per |
… B-0918 WalletLifetime + B-0919 MemoryBinding + B-0920 MemoryLifetime) into cli.ts via --list-du-cluster mode + du-cluster.ts TS substrate (state-machine lane push per operator "feel free to push the three lanes forward" 2026-05-28) (#5916) State-machine lane push (per B-0892 three-lanes-concurrent operating discipline). Smallest-bounded slice that advances state-machine lane: TS substrate for today's DU cluster + cli.ts integration. ## What ships 1. tools/workflow-engine/du-cluster.ts (211 lines) - IntrCtx (5 context-types: memetic/prompt/trust/log/otel) per B-0917 - WalletLifetime (9 variants) per B-0918 - MemoryBinding (4 variants) per B-0919 - MemoryLifetime (5 variants) per B-0920 - DU_CLUSTER_CATALOG + computeDuClusterStats aggregator 2. tools/workflow-engine/du-cluster.test.ts (14 tests; all pass) - Variant count + exhaustiveness for each DU - Catalog aggregator - Stats computation (23 total variants across 4 entries) 3. tools/workflow-engine/cli.ts (--list-du-cluster mode added) - Mode union extended - parseArgs handling - modeListDuCluster emit - main switch case - Header docstring updated ## Operational substrate bun tools/workflow-engine/cli.ts --list-du-cluster → structured JSON with 4 entries + 23 total variants ## Composes-with - PR #5816 (B-0917 IntrCtx substrate) - PR #5827 (B-0918 WalletLifetime substrate) - PR #5829 (B-0919 MemoryBinding substrate) - PR #5830 (B-0920 MemoryLifetime substrate) - PR #5910 (Amara future-affects-generator + three-clocks) - PR #5912 (Amara lightlike-kind-substrate + design-rule) - PR #5516 asymmetric-authorship rule (each DU is substrate-entity authoring its own consent-channel) - PR #5511 monad-propagation-pattern (cross-language substrate-shape) - existing tools/workflow-engine/types.ts (Action/State/TickCyclePattern) - B-0867 workflow-engine v1 substrate - B-0892 three-lanes-concurrent operating discipline (state-machine lane) ## Substrate-honest scope PoC scope: declarative TS substrate + cli.ts emission. Runtime dispatch of DU-cluster state transitions (B-0867.5 phase 2), F# crystallization (B-0867.4), state-persist (B-0867.2), grammar parser (B-0867.3) all deferred to operator-authorized follow-up work. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Lior <lior@zeta.dev> Co-authored-by: Claude <noreply@anthropic.com>
Aaron 2026-05-28 substrate-target:
Use case
Agent-initiated cleanup with history preservation. Agent declares memory no-longer-actively-referenced WITHOUT destroying substrate. substrate-or-it-didn't-happen discipline holds.
Distinction from B-0919 (orthogonal axes)
Both apply per memory. Compose orthogonally.
Key load-bearing properties
preserved_in: ArchiveLocation(type-system enforces substrate-or-it-didn't-happen)6 Soraya formal-verification invariants (L.1-L.6)
Composing with B-0917 F.5 + B-0919 G.1-G.5 at memory-substrate scope.
🤖 Generated with Claude Code