Added deterministic function layer

This commit is contained in:
2026-05-04 19:26:25 +02:00
parent 3840ff4617
commit 1197b39a76
11 changed files with 1305 additions and 16 deletions

View File

@@ -3,10 +3,10 @@ id: MKTT-WP-0012
type: workplan
title: "Document Function Layer"
domain: markitect
status: todo
status: done
owner: markitect-tool
topic_slug: markitect
planning_priority: P3
planning_priority: complete
planning_order: 85
depends_on_workplans:
- MKTT-WP-0004
@@ -34,6 +34,29 @@ This layer should let authors and agents express reusable document operations
as named functions over Markdown content, structured data, references,
processors, contracts, workflows, and eventually assisted generation.
## Implementation Summary
Implemented the first deterministic document function layer:
- `DocumentFunctionDescriptor`, `DocumentFunctionParameter`,
`DocumentFunctionCall`, `DocumentFunctionRegistry`, run/evaluation result
envelopes, diagnostics, provenance, and trace output.
- Conservative inline syntax: `{{mkt:function.name ...}}`.
- Conservative fenced syntax: `mkt-function function.name ...`.
- Pipeline chaining with `|`, where the previous result becomes the next
function's first argument.
- `ProcessingContext.variables` bindings through `${name}` values.
- Built-in deterministic functions for text operations, Markdown headings,
bold text, links, code blocks, and context value lookup.
- `mkt function list`, `mkt function check`, and `mkt function render`.
- Built-in extension descriptor `document.function`.
- Documentation and examples in `docs/document-functions.md` and
`examples/functions/basic-functions.md`.
Assisted, filesystem, network, external-process, render/export, and live policy
service functions remain future optional extensions gated by local capability
and policy metadata.
## Background
Quarkdown demonstrates that document authoring can benefit from a compact
@@ -102,7 +125,7 @@ a second workflow engine or a dependency on flex-auth.
```task
id: MKTT-WP-0012-T001
status: todo
status: done
priority: high
state_hub_task_id: "13ddfdbb-8fc1-4570-915d-038d40d489e1"
```
@@ -125,7 +148,7 @@ Output: design note, schema, and small examples.
```task
id: MKTT-WP-0012-T002
status: todo
status: done
priority: high
state_hub_task_id: "58166792-457a-4844-96a7-27baf50c1d7e"
```
@@ -150,7 +173,7 @@ Output: syntax proposal with accepted/rejected examples and parser impact.
```task
id: MKTT-WP-0012-T003
status: todo
status: done
priority: high
state_hub_task_id: "06196bde-cc10-464e-9d1a-6b8acc616c06"
```
@@ -172,7 +195,7 @@ Output: registry API, adapter protocol, and tests with fake functions.
```task
id: MKTT-WP-0012-T004
status: todo
status: done
priority: high
state_hub_task_id: "986121f0-f824-46eb-af59-65ebf2389f34"
```
@@ -193,7 +216,7 @@ Output: minimal evaluator and CLI/library tests.
```task
id: MKTT-WP-0012-T005
status: todo
status: done
priority: medium
state_hub_task_id: "94bb131c-cb4e-4391-8453-bb9de4f3834c"
```
@@ -210,7 +233,7 @@ Output: chaining rules, data binding rules, and diagnostic examples.
```task
id: MKTT-WP-0012-T006
status: todo
status: done
priority: medium
state_hub_task_id: "899d361f-8eaa-4098-97d9-0fd33afc3304"
```
@@ -233,7 +256,7 @@ Output: contract integration and actionable diagnostics.
```task
id: MKTT-WP-0012-T007
status: todo
status: done
priority: medium
state_hub_task_id: "2a51b42c-b46b-42cd-ba33-ab504100e653"
```
@@ -252,7 +275,7 @@ Output: permission model, blocked-operation diagnostics, and policy examples.
```task
id: MKTT-WP-0012-T008
status: todo
status: done
priority: medium
state_hub_task_id: "30358902-5564-48a2-b1e3-e400bfbe7d1a"
```