Skip to content

Add diff module: message-level dialog diffing by id and facet - #16

Closed
erikgaas wants to merge 1 commit into
mainfrom
dialog-diff
Closed

Add diff module: message-level dialog diffing by id and facet#16
erikgaas wants to merge 1 commit into
mainfrom
dialog-diff

Conversation

@erikgaas

@erikgaas erikgaas commented Aug 3, 2026

Copy link
Copy Markdown

diff_dlgs(old, new) returns a DlgDiff of what changed between two versions of a dialog, exact by message id: added and moved as (prev_id, msg) pairs in new-dialog order, removed messages, and changed mapping id to {facet: old value} across content/output/meta/attachments, so consumers update only what a change touched. Volatile output fields (execution_count, transient) are ignored, moves are the minimal set from aligning surviving-id sequences, and a DlgDiff is falsy when nothing changed. Pure function on the model, stdlib only.

@erikgaas
erikgaas marked this pull request as draft August 3, 2026 20:04
@erikgaas
erikgaas marked this pull request as ready for review August 5, 2026 00:51
@erikgaas
erikgaas requested a review from jph00 August 5, 2026 00:51
@erikgaas

erikgaas commented Aug 5, 2026

Copy link
Copy Markdown
Author

@jph00 My main concern about this PR is that it adds a bunch of code. But I thought it would be useful in multiple places so I thought it could be good. Lmk if you think there is a better way of doing it.

@jph00

jph00 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

I don't really know what any of this means, tbh, or why it's useful. I can't find a way to make headway on reviewing this. Any suggestions on how we can get a "meeting of minds" here?

In general, maybe we should start with a Discord chat of "here's a problem I want to solve, and an idea for solving it" - starting with a PR may be getting things backwards - especially now that code is cheap, but ideas are where the value is? (I'm not saying this as a strong opinion - just exploring possibilities).

BTW nbdev already has quite an interesting nb-level diffing algo/api, in case that helps you.

@jph00
jph00 marked this pull request as draft August 5, 2026 04:46
@erikgaas

erikgaas commented Aug 5, 2026

Copy link
Copy Markdown
Author

I don't really know what any of this means, tbh, or why it's useful. I can't find a way to make headway on reviewing this. Any suggestions on how we can get a "meeting of minds" here?

In general, maybe we should start with a Discord chat of "here's a problem I want to solve, and an idea for solving it" - starting with a PR may be getting things backwards - especially now that code is cheap, but ideas are where the value is? (I'm not saying this as a strong opinion - just exploring possibilities).

BTW nbdev already has quite an interesting nb-level diffing algo/api, in case that helps you.

Nice I didn't know about nbdev's diffing. I made this PR because I was investigating the diff-watcher idea you had for solveit. But regarding your point on best ways to contribute to AAI im going to close this and some other PRs and try the new approach.

@erikgaas erikgaas closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants