T-9Q4A-deliveryrecord-signature-keyed-idempotent-delivery-log
State: closed/done · Impact: medium · Complexity: medium
pr classify’s cursor advances on every call regardless of outcome, so the Router
cannot reuse it to track what feedback has already been delivered — a failed
delivery would silently lose the comment. simple-dispatch-interfaces.html’s “Why
the router keeps its own delivery record” section designs a separate,
signature-keyed record for exactly this.
Approach
Section titled “Approach”- Define
DeliveryRecord(version,subject, adeliveredmap keyed by item signature, anattemptslog,heldSince) per simple-dispatch-interfaces.html. - Derive a stable signature per feedback item: comments/reviews from
Activity.kind+id+editedAt ?? at(T-DVLT’sActivitytype carries these); pr-update conflicts from the PR + base head SHA + paths, sourced from T-4AQN’s conflict JSON output (AC-3 there reports the base head SHA specifically so this signature has something to key on). - Store one record per subject under this project’s
.sdlc/runtime-state convention (the design doc’s.sdlc/dispatch/deliveries/layout, adapted). - Wire the Router (
T-BT9H) to consult the record before sending and to append an attempt after every delivery outcome. - Reuse
classify.ts’sentrySurvivesfilter so bot/self comments never mint a signature.
| Area | Note |
|---|---|
solutions/ontological/lib/services/dispatch/ | New: DeliveryRecord |
solutions/ontological/lib/services/pr/ops/classify.ts | entrySurvives reused, read-only |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: The same unedited comment is never delivered twice across ticks.
- AC-2: An edited comment gets a new signature and is delivered again.
- AC-3: A pr-update conflict’s signature changes when the base head moves, so a stale conflict is not re-sent forever.
Out of scope
Section titled “Out of scope”- the delivery chain itself (
T-BT9H)
Dependencies
Section titled “Dependencies”T-BT9HT-DVLT—Activity.id/editedAtare the comment/review half of the signatureT-4AQN— AC-3’s base-head-SHA field is the conflict half of the signature
Depends on
Section titled “Depends on”T-BT9H, T-DVLT, T-4AQN