glam/.opencode/rules/no-deletion-from-slot-fixes.md

1.5 KiB

Rule: Do Not Delete From slot_fixes.yaml

Identifier: no-deletion-from-slot-fixes Severity: CRITICAL

Core Directive

NEVER delete entries from slot_fixes.yaml.

The slot_fixes.yaml file serves as the historical record and audit trail for all schema migrations. Removing entries destroys this history and violates the project's data integrity principles.

Workflow

When processing a migration:

  1. Do NOT Remove: Never delete the entry for the slot you are working on.
  2. Update processed: Instead, update the processed block:
    • Set status: true.
    • Set date to the current date (YYYY-MM-DD).
    • Add a detailed notes string explaining what was done (e.g., "Fully migrated to [new_slot] + [Class] (Rule 53). [File].yaml updated. Slot archived.").
  3. Preserve History: The entry must remain in the file permanently as a record of the migration.

Rationale

  • Audit Trail: We need to know what was migrated, when, and how.
  • Reversibility: If a migration introduces a bug, the record helps us understand the original state.
  • Completeness: The file tracks the total progress of the schema refactoring project.

Example

WRONG (Deletion):

# DELETED from file
# - original_slot_id: ...

CORRECT (Update):

- original_slot_id: https://nde.nl/ontology/hc/slot/has_some_slot
  processed:
    status: true
    date: '2026-01-27'
    notes: Fully migrated to has_or_had_new_slot + NewClass (Rule 53).
  revision:
    ...