Skip to content

M-8: Delete Universe #20

@spuentesp

Description

@spuentesp

Category: manage | Epic: 1 | Priority: medium

Summary

Soft-delete a Universe and all its contents by setting canon_level to
'retconned'. Requires confirmation and displays impact warning.
Hard delete available with --hard flag for admin use.

Acceptance Criteria

  • Impact warning shows accurate counts
  • Confirmation requires typing exact universe name
  • Soft delete sets canon_level = 'retconned' on universe
  • Soft delete cascades to all child nodes (entities, facts, stories)
  • deleted_at timestamp set on all affected nodes
  • Soft-deleted universes excluded from normal queries
  • Hard delete (--hard) permanently removes nodes (admin only)
  • Hard delete requires double confirmation

Dependencies

This use case depends on:

  • DL-1
  • M-6

Implementation

Layer: 3

Files to modify:

  • packages/cli/src/monitor_cli/commands/manage/universe.py

NEO4J Operations:

  • neo4j_get_universe_stats (authority: *)
  • neo4j_soft_delete_universe (authority: CanonKeeper)
  • neo4j_hard_delete_universe (authority: CanonKeeper)

Notes:

  • Soft delete is reversible (set canon_level back to 'canon')
  • Consider adding neo4j_restore_universe for undo
  • Hard delete should be rare and logged

Testing Requirements

Minimum coverage: 80%

Unit tests:

  • test_soft_delete_universe: sets retconned status
  • test_soft_delete_cascades: child nodes also retconned
  • test_delete_confirmation_required: fails without confirm
  • test_hard_delete: permanently removes nodes
  • test_delete_not_found: 404 handled gracefully

Integration tests:

  • test_delete_universe_cli: CLI confirmation flow works
  • test_deleted_universe_hidden: excluded from queries

References

Documentation:


Generated from /home/sebas/monitor2/docs/use-cases/manage/M-8.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked by unfinished dependenciesmanageWorld administration (M-*)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions