Skip to content

Harden mid-session Rule delivery and recovery #60

Description

@frap129

Parent

#38

What to build

Make mid-session Durable delivery race-safe and recoverable so persistence failures, concurrent matches, resume, message removal, and compaction cannot lose or duplicate guidance.

Acceptance criteria

  • RuleDelivery remains the sole owner of per-session serialization, Rule-identity coalescing, activation transitions, retry state, and ledger acknowledgement.
  • Durable activation follows monotonic unmatched-to-pending-to-delivered transitions and is acknowledged only after persistence succeeds.
  • Persistence failure cannot fail a successful tool event; pending guidance remains available to the applicable dispatch and retries on later dispatches.
  • One Rule persistence failure does not block another, and concurrent admissions deliver each Rule identity at most once.
  • Resume trusts existing durable delivery identity without replaying tool events; unpersisted pending activation remains memory-only and may be lost across restart.
  • Message removal and compaction rebuild delivery evidence from the history ledger and re-append missing current guidance without treating summary text as evidence.
  • Later non-matching observations do not retract or re-arm a Matched rule.
  • Matched-rule state refreshes immediately when a Durable Rule is admitted mid-session.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions