You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Specify earliest-dispatch delivery for every newly matched rule #45
What implementation-ready delivery contract and integration design ensures every rule newly matched from any supported session-context change is available at the earliest provider dispatch OpenCode v1.x permits? Define initial-dispatch and mid-session timing, preserve durable versus transient lifetime, keep RuleDelivery authoritative for serialization, identity deduplication, history reconciliation, and ledger acknowledgement, and specify pending visibility during persistence failure, retry behavior, concurrent-match grouping and ordering, tool-failure isolation, synthetic-message recursion suppression, and the later migration boundary with feat: deliver rules at the earliest OpenCode v2 hook. This ticket resolves a specification decision; it does not implement the runtime change.
One universal v1.x delivery contract for every newly matched rule, resolved HITL and grounded in the current seams (onMessagesTransform, onChatMessage, RuleDelivery):
Seam: context-producing hooks update session state only. Every pre-dispatch transform re-evaluates all rule lifetimes against freshest state (Q1), making the transform the single completeness gate for durable and transient rules.
Initial durable delivery: unchanged append-to-user-message framing; later matches use synthetic messages (Q2).
Mid-session durable matches: the transform await-persists a no-reply synthetic message; equivalent pending content is also placed in the current in-memory dispatch (Q3).
Stop conditions: durable rules are not re-delivered once their delivery key is acknowledged; transient re-evaluation uses current context and expires after one dispatch (Q4). Resume after stop relies on history reconstruction, preserving existing behavior; replaying historical events is NOT required.
Failure handling: transform re-evaluation failure is logged but does not break dispatch (Q7); ledger acknowledgement occurs only after successful persistence, so a failed no-reply append leaves the rule pending and retried at the next transform.
Sidebar state: per-session matched-rule state is refreshed when mid-session durable rules are admitted, not only on initial user messages (Q8).
Extension seam: one internal submission interface (delivery coordinator) owns ledger serialization, identity deduplication, and history reconciliation, so context producers never touch ledger internals (Q9). File-observation producers will submit matches through this seam when the feature lands.
No file-observation-specific decisions were embedded: the ticket concerns the universal delivery contract only. Newly matched rules from Read, Write, Apply Patch, and LSP use still-pending tickets for their observation semantics.
Activity
frap129 commentedon Aug 28, 2026
Resolution
One universal v1.x delivery contract for every newly matched rule, resolved HITL and grounded in the current seams (
onMessagesTransform,onChatMessage,RuleDelivery):tool.execute.afterpersistence ordering andexperimental.chat.messages.transforminsertion as established by Determine whether OpenCode v1.x supports next-dispatch durable delivery.No file-observation-specific decisions were embedded: the ticket concerns the universal delivery contract only. Newly matched rules from Read, Write, Apply Patch, and LSP use still-pending tickets for their observation semantics.
feat(rules): fileContains matching with observation-time admission