Skip to content

Read and write decisions blocks in documents and posts - #165

Merged
robertlemke merged 1 commit into
mainfrom
task/decisions-blocks
Nov 23, 2026
Merged

robertlemke merged 1 commit into
mainfrom
task/decisions-blocks

Conversation

@robertlemke

Copy link
Copy Markdown
Member

A decisions block, Minka's stored query for a list of decisions, comes to the command line in documents and posts (Minka #1014).

Writing: a block is a marker on a line of its own, in the style of the markers for link tiles and variables:

<!-- minka:decisions tool="…" label="…" status="…" decided-in="…" applies-to="…" -->

tool is required and every filter is optional; the values are identifiers. A malformed marker is refused before anything is sent (exit 1), with a hint that shows the form and where the identifiers come from. Minka's decisionBlockInvalid exits 9 with its message, which names the attribute, and a hint to decisions tools, decisions statuses, labels list, events and cards. documentLocked, for an edit and now also for restoring a version, gets a hint to unlock the document on the web.

Reading: the element turns back into the same marker, so a text read, edited and written back keeps its blocks unchanged. In docs show, posts show and the document a 409 prints, the decisions a block shows are read out under ## Decisions blocks (N) after the body, never inside it. A text sent as Markdown that contains these read-out rows is refused. The new flag --body on docs show and posts show prints exactly the editable body, which the skill uses for an edit with --expect. --json passes decisionBlocks through unchanged.

Export: an exported page carries the marker and the rows. A page with a block is always fetched again, because its rows change without the page.

Register: C-197 to C-201; the rules are in docs/stable/rich-text.md. Checked against Minka's code and tests and the fake, not live yet. Two review rounds, with every finding fixed; among them, the first design dropped the rows from a body sent back, which could silently swallow text written after them. Each safeguard has a test and a sabotage proof.

Resolves: https://minka.flownative.com/go/card/MNK-VX

A decisions block in a document or a post now reads as a marker line,
<!-- minka:decisions tool="…" … -->, and the same line written in
Markdown becomes Minka's <minka-decisions> element again, its
attributes in one order. docs show and posts show keep the marker alone
in the body and print each block's rows in a section after it, named by
the block's position and attributes. --body prints the body alone, as
the edit takes it back. --json passes decisionBlocks through.

Minka stores only the query of a block and lists the rows afresh on
every reading, so the rows must never travel back as text. Dropping
them on the way back would fail silently both ways: a line joined to
the quote would go with it, and rows away from their marker would be
sent. The rows therefore stand outside the editable body, as a quote
that opens with read-out words, and a text that holds such a quote is
refused before anything is sent. The text view cannot be cut at the
next heading either, as a body may have its own; --body is the one
output that is exactly the editable body.

A marker that cannot be a block, such as one with an unknown attribute,
no tool, text after its end or a value that is no identifier, is
refused before anything is sent. Sent on, it would stand in the
document as visible source. Whether the identifiers name a tool, label,
status, event or card of the project stays Minka's to say:
decisionBlockInvalid keeps Minka's message and gets a hint naming the
commands the identifiers come from. documentLocked gets a hint that the
document is unlocked on the web, since the CLI has no command for it.

An exported page carries the marker and right below it the rows,
because an export is read as files and a hidden marker alone shows
nothing. Such a page is read again on every run, as its rows change
without the page.

The fake mirrors the contract as Minka's code has it: decisionBlocks on
every answer with a document or a post, the tool null where the reader
cannot see it, the copies of a lock, at most 20 blocks, and only the
five attributes kept. A write checks the length of the text first and
the blocks only on a document that is not locked, where a block the
stored text holds passes unchecked; a locked document answers
documentLocked later, from the edit, and so does restoring one of its
versions.

Resolves: https://minka.flownative.com/go/card/MNK-VX
@robertlemke
robertlemke merged commit 89e4456 into main Nov 23, 2026
2 checks passed
@robertlemke
robertlemke deleted the task/decisions-blocks branch November 23, 2026 22:52
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.

1 participant