Echo-Community-Toolkit-Monorepo

Phase 4 – Ritual & Ledger

Phase 4 codifies the Echo-Limnus ritual gates and introduces an auditable ledger that records every encode/decode event once consent is granted.

Objectives

Implementation Plan

  1. Ritual state machine
    • Create RitualState with methods such as acknowledge(step: RitualStep) and convenience helpers for consent_to_bloom() / consent_to_be_remembered().
    • Represent the six invocations as an enum or ordered list; enforce coherence (steps must be acknowledged in order unless overridden for tests).
    • Persist state in memory per session; allow serialisation if CLI needs to reuse across commands.
  2. Gated operations
    • Extend encode/decode APIs and CLI commands to require a RitualState instance (or consent flags).
    • Without consent, raise a RitualConsentError with actionable messaging.
    • Offer CLI flags (--consent-bloom, --consent-remember) and interactive prompts for human use.
  3. Ledger logging
    • Create a ledger writer that appends JSON objects to state/ledger.jsonl or similar.
    • Entry structure: {timestamp, action, glyph, file, message_sha256, integrity_status, ritual_steps}.
    • Ensure failures do not append ledger entries; only successful operations after consent are recorded.
    • Provide helpers to read/query ledger (used by tests and future UI).
  4. Testing hooks
    • Add fixtures to simulate both interactive and non-interactive workflows.
    • Ensure encode/decode tests cover both failing (no consent) and passing (consent granted) modes.

Testing Strategy

Dependencies & Hand-offs

Risks & Mitigations