Skip to content

[proposal] Structural patches for artifacts #36

@Tiendil

Description

@Tiendil

This task is a proposal for discussion and a container for ideas. We'll decide to implement it or not after Donna achieves some maturity and we collect enough experience and use cases.

This proposal is coupled with the Markdown artifacts as a "true tree" proposal.

Currently, Donna can only update artifacts by replacing them completely. While this approach is simple and effective, it has obvious downsides:

  • Agents forced to perform a series of complex operations (fetch->read->edit->upload) to implement a simple change in an artifact.
  • Agents use much more context space to perform simple edits than they would need if they could just apply a patch.

To address these issues, we could introduce commands for structural editing of Markdown artifacts.

Here are some examples of possible commands:

  • Add/remove/update a section.
  • Add/remove/update a list item.
  • Add/remove/update a paragraph or any other block.

To implement this, we need a way to reference specific parts of a Markdown document. That can be done in several ways:

  1. By section IDs, like it works now.
  2. By inline ids intro blocks, like {{ donna.lib.id("some-unique-id") }}.
  3. By inline ids via Markdown syntax, like [some-unique-id] or via HTML <span id="some-unique-id"/>.
  4. By content, so the agent can use the full content of the block to reference it.

Most likely, we will need to support all of these methods to provide maximum flexibility. For example, having IDs for each block is great, but we definitely don't want to overflow documents with IDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions