Skip to content

v0.13.0

Choose a tag to compare

@laurentftech laurentftech released this 23 Aug 13:33
· 100 commits to main since this release
v0.13.0
613fd55

Diagrams that can leave the conversation

A structured-exchange diagram could be looked at, and that was all. It lived inside a
reply, and anything you wanted to do with it elsewhere — put it in a report, open it
again tomorrow, hand it to someone who was not in the session — meant a screenshot.

Two ways out of the transcript now.

As a file the agent writes. write_structure_figure performs, for the agent, the
act a reader performs by hand: read a document through the confined read path, narrow it
to the part that matters, and write one .svg through the same confinement as every
other agent write — then reference it from Markdown like any other image. A report the
agent is authoring can carry its own figures.

As a document the viewer draws. Open a structured-exchange document from the
workspace and you get the rendering, the narrowing and the export a reader gets in a
conversation. It is recognised by the schema it declares, never by its extension: any
other JSON keeps the display it had.

What makes those two the same picture is that the rendering core moved to shared/ and
now computes the drawing as data — a list of shapes with the attributes they are drawn
with. React maps a shape to an element; serializeFigure maps the same shape to a
string. Neither decides anything, so a figure in a report and the diagram it came from
cannot drift apart. A seam test compares the two shape for shape, in document order, for
a graph, a proposal, a sequence and a narrowing.

The edges are where the care went:

  • A document that declares the contract and fails it is named as such, carrying the
    reference validator's diagnosis. The browser's own check is a verdict without a
    reason, deliberately — and the reader is the one person able to tell the producer what
    is wrong.
  • An unsupported version falls back to text rather than being validated against a
    contract it never claimed.
  • figureForDocument validates before it draws and refuses with the reason. No partial
    figure, and a narrowing that selects nothing is reported rather than written as an
    empty canvas.
  • Nothing that exists only for pointing travels: the transparent hit shapes a browser
    adds are marked data-hit, and the reader's own download strips them too.
  • A narrowed figure carries its own statement of how much of the document it shows, so a
    figure separated from its source is never mistaken for the whole.

Editing beside the rendering

Revising a structured-exchange document by hand meant toggling: type, switch, look,
switch back, having lost your place in the text. Now both are on screen, and the
rendering follows what is typed, not what was last saved — someone who has saved
nothing has still changed the model in front of them.

The viewer's source/rendered boolean became one mode — rendered, split, source — so
"raw and split" can no longer be represented at all. The split is offered for any file
with a rendering: structured-exchange documents, and Markdown, which gives up its own
two-state toggle for the same three-way control.

Text under revision does not parse for most of the keystrokes that produce it, so a
diagram that vanished on each one would be unusable. The last rendering that validated
stays, marked as no longer matching the editor, with the reason beside it — and those
reasons now distinguish text that is not parseable JSON from text that no longer
declares a schema. Different situations for someone editing, and the commoner one used
to say nothing at all.

The editing itself is the editing that already existed: one textarea, one save, the same
mtime guard, the same confirmation. Cancelling in the split discards the draft and keeps
the mode — discarding an edit is not a request to stop looking at the document.

Both places that render Markdown call one renderer, so a figure referenced from a report
resolves the same in the split as at full width.


Upgrading: nothing to change. write_structure_figure is new, the document viewer
and the split appear on their own, and no existing file changes meaning. Running
pi-outpost from npm needs Node ≥ 24; the executables attached below require Node ≥ 26
to build.