Skip to content

fix(prime): retain refinement notices in transcript continuity #550

Description

@rynfar

Follow-up from the September 14 adversarial/integration review of #548. That PR fixes refinement_outcome; the current managed Prime source also emits a separate refinement_notice after applying edits.

At Prime product commit 65d9c027, _recordRefinementNotice calls _appendDurableRefineMessage. That method appends the message to native history and emits both message events. The constructor uses role custom, customType refinement_notice, display false, string content and private details.

Confirmed against the Pylon decoder after #548: a synthetic message with this shape and valid session attribution / null promptCorrelationId decodes to CorrelatedProtocolViolation. Snapshot decoding also has no representation for this message, so its native count cannot match the filtered transcript. This can recreate the continuity failure after an applied refinement. No live session was mutated in this review.

Acceptance:

  • Retain exact, private continuity identity for refinement_notice in live events, snapshots and restart proofs; preserve the separate refinement_outcome identity.
  • Test actual outcome-plus-notice ordering with valid session and prompt attribution, later tool snapshots, resume, and altered-history rejection.
  • Keep private refinement content out of client projection.
  • Audit the other built-in native message kinds for the same counting failure, explicitly distinguishing supported behavior from intentionally unsupported behavior. Do not silently accept arbitrary custom messages or weaken recovery proof.

This is a Pylon adapter gap in the already shipped Prime build, not a dependency upgrade. Track under #114; fix before undertaking the next broad Prime upstream integration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions