donna 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- donna/__init__.py +1 -0
- donna/artifacts/__init__.py +0 -0
- donna/artifacts/usage/__init__.py +0 -0
- donna/artifacts/usage/artifacts.md +224 -0
- donna/artifacts/usage/cli.md +117 -0
- donna/artifacts/usage/worlds.md +36 -0
- donna/artifacts/work/__init__.py +0 -0
- donna/artifacts/work/do_it.md +142 -0
- donna/artifacts/work/do_it_fast.md +98 -0
- donna/artifacts/work/planning.md +245 -0
- donna/cli/__init__.py +0 -0
- donna/cli/__main__.py +6 -0
- donna/cli/application.py +17 -0
- donna/cli/commands/__init__.py +0 -0
- donna/cli/commands/artifacts.py +110 -0
- donna/cli/commands/projects.py +49 -0
- donna/cli/commands/sessions.py +77 -0
- donna/cli/types.py +138 -0
- donna/cli/utils.py +53 -0
- donna/core/__init__.py +0 -0
- donna/core/entities.py +27 -0
- donna/core/errors.py +126 -0
- donna/core/result.py +99 -0
- donna/core/utils.py +37 -0
- donna/domain/__init__.py +0 -0
- donna/domain/errors.py +47 -0
- donna/domain/ids.py +497 -0
- donna/lib/__init__.py +21 -0
- donna/lib/sources.py +5 -0
- donna/lib/worlds.py +7 -0
- donna/machine/__init__.py +0 -0
- donna/machine/action_requests.py +50 -0
- donna/machine/artifacts.py +200 -0
- donna/machine/changes.py +91 -0
- donna/machine/errors.py +122 -0
- donna/machine/operations.py +31 -0
- donna/machine/primitives.py +77 -0
- donna/machine/sessions.py +215 -0
- donna/machine/state.py +244 -0
- donna/machine/tasks.py +89 -0
- donna/machine/templates.py +83 -0
- donna/primitives/__init__.py +1 -0
- donna/primitives/artifacts/__init__.py +0 -0
- donna/primitives/artifacts/specification.py +20 -0
- donna/primitives/artifacts/workflow.py +195 -0
- donna/primitives/directives/__init__.py +0 -0
- donna/primitives/directives/goto.py +44 -0
- donna/primitives/directives/task_variable.py +73 -0
- donna/primitives/directives/view.py +45 -0
- donna/primitives/operations/__init__.py +0 -0
- donna/primitives/operations/finish_workflow.py +37 -0
- donna/primitives/operations/request_action.py +89 -0
- donna/primitives/operations/run_script.py +250 -0
- donna/protocol/__init__.py +0 -0
- donna/protocol/cell_shortcuts.py +9 -0
- donna/protocol/cells.py +44 -0
- donna/protocol/errors.py +17 -0
- donna/protocol/formatters/__init__.py +0 -0
- donna/protocol/formatters/automation.py +25 -0
- donna/protocol/formatters/base.py +15 -0
- donna/protocol/formatters/human.py +36 -0
- donna/protocol/formatters/llm.py +39 -0
- donna/protocol/modes.py +40 -0
- donna/protocol/nodes.py +59 -0
- donna/world/__init__.py +0 -0
- donna/world/artifacts.py +122 -0
- donna/world/artifacts_discovery.py +90 -0
- donna/world/config.py +198 -0
- donna/world/errors.py +232 -0
- donna/world/initialization.py +42 -0
- donna/world/markdown.py +267 -0
- donna/world/sources/__init__.py +1 -0
- donna/world/sources/base.py +62 -0
- donna/world/sources/markdown.py +260 -0
- donna/world/templates.py +181 -0
- donna/world/tmp.py +33 -0
- donna/world/worlds/__init__.py +0 -0
- donna/world/worlds/base.py +68 -0
- donna/world/worlds/filesystem.py +189 -0
- donna/world/worlds/python.py +196 -0
- donna-0.2.0.dist-info/METADATA +44 -0
- donna-0.2.0.dist-info/RECORD +85 -0
- donna-0.2.0.dist-info/WHEEL +4 -0
- donna-0.2.0.dist-info/entry_points.txt +3 -0
- donna-0.2.0.dist-info/licenses/LICENSE +28 -0
donna/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
donna_artifacts_root = "donna.artifacts"
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Default Text Artifacts Behavior
|
|
2
|
+
|
|
3
|
+
```toml donna
|
|
4
|
+
kind = "donna.lib.specification"
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
This document describes the default format and behavior of Donna's text artifacts.
|
|
8
|
+
This format and behavior is what should be expected by default from an artifact if not specified otherwise.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
An artifact is any text or binary document that Donna manages in its worlds. For example, via CLI commands `donna -p <protocol> artifacts …`.
|
|
13
|
+
|
|
14
|
+
The text artifact has a source and one or more rendered representations, produced in specific rendering modes.
|
|
15
|
+
|
|
16
|
+
— The source is the raw text content of the artifact as it is stored on disk or in remote storage.
|
|
17
|
+
- The representation is the rendered version of the artifact for a specific rendering mode. In practice, the same source is rendered in `view` mode for CLI display, `execute` mode for workflow execution, and `analysis` mode for internal parsing and validation (see "Rendering artifacts").
|
|
18
|
+
|
|
19
|
+
To change the artifact, developers and agents edit its source.
|
|
20
|
+
|
|
21
|
+
To get information from the artifact, developers, agents and Donna view one of its representations (typically via the view rendering mode).
|
|
22
|
+
|
|
23
|
+
**If you need an information from the artifact, you MUST view its representation**. Artifact sources are only for editing.
|
|
24
|
+
|
|
25
|
+
Read the specification `{{ donna.lib.view("donna:usage:cli") }}` to learn how to work with artifacts via Donna CLI.
|
|
26
|
+
|
|
27
|
+
## Source Format and Rendering
|
|
28
|
+
|
|
29
|
+
The source of the text artifact is a Jinja2-template of Markdown document.
|
|
30
|
+
|
|
31
|
+
When rendering the artifact, Donna processes the Jinja2 template with a predefined context (at minimum `render_mode` and `artifact_id`, and optionally `current_task`/`current_work_unit` during workflow execution), then renders the resulting Markdown content into the desired representation based on the selected rendering mode.
|
|
32
|
+
|
|
33
|
+
**Artifact source should not use Jinja2 inheretance features** like `{{ "{% extends %}" }}` and `{{ "{% block %}" }}`.
|
|
34
|
+
|
|
35
|
+
Donna provides a set of special directives that can and MUST be used in the artifact source to enhance its behavior. Some of these directives are valid for all artifacts, some are valid only for specific section kinds.
|
|
36
|
+
|
|
37
|
+
Here are some examples:
|
|
38
|
+
|
|
39
|
+
- `{{ "{{ donna.lib.view(<artifact-id>) }}" }}` — references another artifact. In `view`/`execute` modes it renders an exact CLI command to view the artifact; in `analysis` mode it renders a `$$donna ... $$` marker used for internal parsing.
|
|
40
|
+
- `{{ "{{ donna.lib.goto(<workflow-operation-id>) }}" }}` — references the next workflow operation to execute. In `view`/`execute` modes it renders an exact CLI command to advance the workflow; in `analysis` mode it renders a `$$donna goto ... $$` marker used to extract workflow transitions.
|
|
41
|
+
|
|
42
|
+
## Rendering artifacts
|
|
43
|
+
|
|
44
|
+
Donna renders the same artifact source into different representations depending on the rendering mode. The mode is internal to Donna (users do not select it directly) and controls how directives are expanded and which metadata is included.
|
|
45
|
+
|
|
46
|
+
- `view` — default representation used when the CLI loads artifacts for display (`artifacts view`, `artifacts list`, `artifacts validate`). This is the human/agent-facing output.
|
|
47
|
+
- `execute` — representation used when Donna executes workflow operations (`sessions run`). It renders directives with task/work-unit context so the resulting text is actionable for the agent.
|
|
48
|
+
- `analysis` — internal representation used during parsing and validation. It emits `$$donna ... $$` markers so Donna can extract workflow transitions and other structured signals.
|
|
49
|
+
|
|
50
|
+
## Structure of a Text Artifact
|
|
51
|
+
|
|
52
|
+
Technically, any valid Markdown document is a valid text artifact.
|
|
53
|
+
|
|
54
|
+
However, Donna assignes special meaning to some elements of the Markdown document to provide enhanced behavior and capabilities.
|
|
55
|
+
|
|
56
|
+
### Sections
|
|
57
|
+
|
|
58
|
+
Artifact is devided into multiple sections:
|
|
59
|
+
|
|
60
|
+
- H1 header and all text till the first H2 header is considered the `head section` of the artifact.
|
|
61
|
+
- Each H2 header and all text till the next H2 header (or end of document) is considered a `tail section` of the artifact.
|
|
62
|
+
|
|
63
|
+
Head section provides a description of the artifact and its purpose and MUST contain a configuration block of the artifact. The head section is also the artifact's `primary section` and is used when Donna needs to show a brief summary of the artifact, for example, when listing artifacts or when an operation targets the artifact without specifying a section.
|
|
64
|
+
|
|
65
|
+
Tail sections describes one of the components of the artifact and CAN contain configuration blocks as well. Configuration blocks placed in subsections (h3 and below) count as part of the parent tail section.
|
|
66
|
+
|
|
67
|
+
The content of the header (text after `#` or `##`) is considered the section title.
|
|
68
|
+
|
|
69
|
+
Donna always interprets the head section as a general description of the artifact and treats it as the primary section.
|
|
70
|
+
|
|
71
|
+
Donna interprets a tail section according to the primary section kind and configuration blocks in that section.
|
|
72
|
+
|
|
73
|
+
### Configuration Blocks
|
|
74
|
+
|
|
75
|
+
Configuration blocks are fenced code blocks with specified primary format, followed by the `donna` keyword and, optionally, list of properties.
|
|
76
|
+
|
|
77
|
+
The supported primary formats are: TOML, JSON, YAML. **You MUST prefer TOML for configuration blocks**.
|
|
78
|
+
|
|
79
|
+
The configuration block properties format is `property1 property2=value2 property3=value3"`, which will be parsed into a dictionary like:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
{
|
|
83
|
+
"property1": True,
|
|
84
|
+
"property2": "value2",
|
|
85
|
+
"property3": "value3",
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The content of the block is parsed according to the primary format and interpreted according its properties.
|
|
90
|
+
|
|
91
|
+
Configuration blocks are parsed by Donna and removed from rendered Markdown representations; they remain in the source for editing and inspection (e.g., via `artifacts fetch` or the repository file).
|
|
92
|
+
|
|
93
|
+
Fences without `donna` keyword are considered regular code blocks and have no special meaning for Donna.
|
|
94
|
+
|
|
95
|
+
### Configuration Merging
|
|
96
|
+
|
|
97
|
+
When a section contains multiple configuration blocks, Donna merges them in document order.
|
|
98
|
+
|
|
99
|
+
- The merge is applied per section: the head section is merged independently, and each tail section has its own merged configuration.
|
|
100
|
+
- Config blocks are merged in the order they appear; later blocks override earlier keys.
|
|
101
|
+
- The merge is shallow: if a key maps to a nested object, a later block replaces the whole value (there is no deep merge).
|
|
102
|
+
- Config blocks in subsections (H3 and below) belong to their parent H2 tail section and are merged into that section's configuration.
|
|
103
|
+
|
|
104
|
+
## Section Kinds, Their Formats and Behaviors
|
|
105
|
+
|
|
106
|
+
### Header section
|
|
107
|
+
|
|
108
|
+
Header section MUST contain a config block with a `kind` property. The `kind` MUST be a full Python import path pointing to the primary section kind instance.
|
|
109
|
+
|
|
110
|
+
Example (`donna` keyword skipped for examples):
|
|
111
|
+
|
|
112
|
+
```toml
|
|
113
|
+
kind = "donna.lib.specification"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Header section MUST also contain short human-readable description of the artifact outside of the config block.
|
|
117
|
+
|
|
118
|
+
### Kind: Specification
|
|
119
|
+
|
|
120
|
+
Specification artifacts describe various aspects of the project in a structured way.
|
|
121
|
+
|
|
122
|
+
Currently there is no additional structure or semantics for this kind of artifact.
|
|
123
|
+
|
|
124
|
+
### Kind: Workflow
|
|
125
|
+
|
|
126
|
+
Workflow artifacts describe a sequence of operations that Donna and agents can perform to achieve a specific goal.
|
|
127
|
+
|
|
128
|
+
Workflow is a Finite State Machine (FSM) where each tail section describes one operation in the workflow.
|
|
129
|
+
|
|
130
|
+
Donna validates workflows by ensuring the start operation exists, reachable sections are valid operations, final operations have no outgoing transitions, and non-final operations have at least one outgoing transition. It does not currently report unreachable sections.
|
|
131
|
+
|
|
132
|
+
Workflow start operation MUST be declared in the workflow head-section config via `start_operation_id`
|
|
133
|
+
and MUST reference an existing operation section.
|
|
134
|
+
|
|
135
|
+
Example (`donna` keyword skipped for examples):
|
|
136
|
+
|
|
137
|
+
```toml
|
|
138
|
+
kind = "donna.lib.workflow"
|
|
139
|
+
start_operation_id = "start_operation"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Each tail section MUST contain config block with `id` and `kind` properties that specifies the identifier and kind of the operation.
|
|
143
|
+
|
|
144
|
+
Example (`donna` keyword skipped for examples):
|
|
145
|
+
|
|
146
|
+
```toml
|
|
147
|
+
id = "operation_id"
|
|
148
|
+
kind = "donna.lib.request_action"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Kinds of Workflow Operations
|
|
152
|
+
|
|
153
|
+
1. `donna.lib.request_action` operation kind indicates that Donna will request the agent to perform some action.
|
|
154
|
+
|
|
155
|
+
The content of the tail section is the text instructions for the agent on what to do.
|
|
156
|
+
|
|
157
|
+
Example of the instructions:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
1. Run `some cli command` to do something.
|
|
161
|
+
2. If no errors encountered `{{ '{{ donna.lib.goto("next_operation") }}' }}`
|
|
162
|
+
3. If errors encountered `{{ '{{ donna.lib.goto("error_handling_operation") }}' }}`
|
|
163
|
+
|
|
164
|
+
Here may be any additional instructions, requirements, notes, references, etc.
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
`donna.lib.goto` directive will be rendered in the direct instruction for agent of what to call after it completed the action.
|
|
168
|
+
|
|
169
|
+
**The body of the operation MUST contain a neat strictly defined algorithm for the agent to follow.**
|
|
170
|
+
|
|
171
|
+
2. `donna.lib.run_script` operation kind executes a script from the operation body without agent/user interaction.
|
|
172
|
+
|
|
173
|
+
The body of the operation MUST include exactly one fenced code block whose info string includes `<language> donna script`.
|
|
174
|
+
Any other text in the operation body is ignored.
|
|
175
|
+
|
|
176
|
+
Script example:
|
|
177
|
+
|
|
178
|
+
```bash donna script
|
|
179
|
+
#!/usr/bin/bash
|
|
180
|
+
|
|
181
|
+
echo "Hello, World!"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Configuration options:
|
|
185
|
+
|
|
186
|
+
```toml
|
|
187
|
+
id = "<operation_id>"
|
|
188
|
+
kind = "donna.lib.run_script"
|
|
189
|
+
|
|
190
|
+
save_stdout_to = "<variable_name>" # optional
|
|
191
|
+
save_stderr_to = "<variable_name>" # optional
|
|
192
|
+
|
|
193
|
+
goto_on_success = "<next_operation_id>" # required
|
|
194
|
+
goto_on_failure = "<next_operation_id>" # required
|
|
195
|
+
goto_on_code = { # optional
|
|
196
|
+
"1" = "<next_operation_id_for_code_1>"
|
|
197
|
+
"2" = "<next_operation_id_for_code_2>"
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
timeout = 60 # optional, in seconds
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Routing rules:
|
|
204
|
+
|
|
205
|
+
- Exit code `0` routes to `goto_on_success`.
|
|
206
|
+
- Non-zero exit codes first check `goto_on_code`, then fall back to `goto_on_failure`.
|
|
207
|
+
- Timeouts are treated as exit code `124`.
|
|
208
|
+
|
|
209
|
+
When `save_stdout_to` and/or `save_stderr_to` are set, the operation stores captured output in the task context
|
|
210
|
+
under the specified variable names.
|
|
211
|
+
|
|
212
|
+
3. `donna.lib.finish` operation kind indicates that the workflow is finished.
|
|
213
|
+
|
|
214
|
+
Each possible path through the workflow MUST end with this operation kind.
|
|
215
|
+
|
|
216
|
+
## Directives
|
|
217
|
+
|
|
218
|
+
Donna provides multiple directives that MUST be used in the artifact source to enhance its behavior.
|
|
219
|
+
|
|
220
|
+
Here they are:
|
|
221
|
+
|
|
222
|
+
1. `{{ "{{ donna.lib.view(<full-artifact-id>) }}" }}` — references another artifact. In `view`/`execute` modes it renders an exact CLI command to view the artifact; in `analysis` mode it renders a `$$donna ... $$` marker.
|
|
223
|
+
2. `{{ "{{ donna.lib.goto(<workflow-operation-id>) }}" }}` — references the next workflow operation to execute. In `view`/`execute` modes it renders an exact CLI command to advance the workflow; in `analysis` mode it renders a `$$donna goto ... $$` marker used for transition extraction.
|
|
224
|
+
3. `{{ "{{ donna.lib.task_variable(<variable_name>) }}" }}` — in `view` mode renders a placeholder note about task-variable substitution, in `execute` mode renders the actual task-context value (or an explicit error marker if missing), and in `analysis` mode renders a `$$donna task_variable ... $$` marker.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Donna Usage Instructions
|
|
2
|
+
|
|
3
|
+
```toml donna
|
|
4
|
+
kind = "donna.lib.specification"
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
This document describes how agents MUST use Donna to manage and perform their workflows.
|
|
8
|
+
|
|
9
|
+
**Agents MUST follow the instructions and guidelines outlined in this document precisely.**
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
`donna` is a CLI tool that helps manage the work of AI agents like OpenAI Codex.
|
|
14
|
+
|
|
15
|
+
It is designed to invert control flow: instead of agents deciding what to do next, the `donna` tells agents what to do next by following predefined workflows.
|
|
16
|
+
|
|
17
|
+
The core idea is that most high-level workflows are more algorithmic than it may seem at first glance. For example, it may be difficult to fix a particular type issue in the codebase, but the overall process of polishing the codebase is quite linear:
|
|
18
|
+
|
|
19
|
+
1. Ensure all tests pass.
|
|
20
|
+
2. Ensure the code is formatted correctly.
|
|
21
|
+
3. Ensure there are no linting errors.
|
|
22
|
+
4. Go to the step 1 if you changed something in the process.
|
|
23
|
+
5. Finish.
|
|
24
|
+
|
|
25
|
+
We may need coding agents on the each step of the process, but there no reason for agents to manage the whole loop by themselves — it takes longer time, spends tokens and confuses agents.
|
|
26
|
+
|
|
27
|
+
## Primary Rules
|
|
28
|
+
|
|
29
|
+
- All work is always done in the context of a session. There is only one active session at a time.
|
|
30
|
+
- You MUST always work on one task assigned to you.
|
|
31
|
+
- If developer asked you to do something and you have no session, you create one with the `donna` tool.
|
|
32
|
+
- If you have a session, you MUST keep all the information about it in your memory. Ask `donna` tool for the session details when you forget something.
|
|
33
|
+
|
|
34
|
+
## Protocol
|
|
35
|
+
|
|
36
|
+
Protocol selects the output formatting and behavior of Donna's CLI for different consumers (humans, LLMs, automation).
|
|
37
|
+
When an agent invokes Donna, it SHOULD use the `llm` protocol (`-p llm`) unless the workflow explicitly requires another protocol.
|
|
38
|
+
|
|
39
|
+
### Session workflow
|
|
40
|
+
|
|
41
|
+
- You start session by calling `donna -p <protocol> sessions start`.
|
|
42
|
+
- After you started a session:
|
|
43
|
+
1. List all possible workflows with command `donna -p <protocol> artifacts list`.
|
|
44
|
+
2. Choose the most appropriate workflow for the task you are going to work on or ask the developer if you are not sure which workflow to choose.
|
|
45
|
+
3. Start working by calling `donna -p <protocol> sessions run <workflow-id>`.
|
|
46
|
+
4. The `donna` tool will output descriptions of all operations it performs to complete the story.
|
|
47
|
+
5. The `donna` tool will output **action requests** that you MUST perform. You MUST follow these instructions precisely.
|
|
48
|
+
- When you done doing your part, you call `donna -p <protocol> sessions action-request-completed <action-request-id> <next-full-operation-id>` to report that you completed the action request. `<next-full-operation-id>` MUST contain full identifier of the next operation, like `<world>:<artifact>:<operation-id>`.
|
|
49
|
+
- After you report the result:
|
|
50
|
+
1. The `donna` tool will output what you need to do next.
|
|
51
|
+
2. You repeat the process until the story is completed.
|
|
52
|
+
|
|
53
|
+
### Starting work
|
|
54
|
+
|
|
55
|
+
- If the developer asked you to do something:
|
|
56
|
+
- run `donna -p <protocol> sessions status` to get the status of the current session.
|
|
57
|
+
- or run `donna -p <protocol> sessions details` to get detailed information about the current session, including list of active action requests.
|
|
58
|
+
- If there is no active session, start a new session by calling `donna -p <protocol> sessions start`.
|
|
59
|
+
- If the session is already active and there are no unfinished work in it, start a new session by calling `donna -p <protocol> sessions start`.
|
|
60
|
+
- If the session is already active and there are unfinished work in it, you MUST ask the developer whether to continue the work in the current session or start a new one.
|
|
61
|
+
- If the developer asked you to continue your work, you MUST call `donna -p <protocol> sessions continue` to get your instructions on what to do next.
|
|
62
|
+
|
|
63
|
+
### Working with artifacts
|
|
64
|
+
|
|
65
|
+
An artifact is a markdown document with extra metadata stored in one of the Donna's worlds.
|
|
66
|
+
|
|
67
|
+
Use the next commands to work with artifacts
|
|
68
|
+
|
|
69
|
+
- `donna -p <protocol> artifacts list [--pattern <artifact-pattern>]` — list all artifacts corresponding to the given pattern. If `<artifact-pattern>` is omitted, list all artifacts in all worlds. Use this command when you need to find an artifact or see what artifacts are available.
|
|
70
|
+
- `donna -p <protocol> artifacts view <world>:<artifact>` — get the meaningful (rendered) content of the artifact. This command shows the rendered information about the artifact. Use this command when you need to read the artifact content.
|
|
71
|
+
- `donna -p <protocol> artifacts fetch <world>:<artifact>` — download the original source of the artifact content, outputs the file path to the artifact's copy you can change. Use this command when you need to change the content of the artifact.
|
|
72
|
+
- `donna -p <protocol> artifacts update <world>:<artifact> <file-path>` — upload the given file as the artifact. Use this command when you finished changing the content of the artifact.
|
|
73
|
+
- `donna -p <protocol> artifacts validate <world>:<artifact>` — validate the given artifact to ensure it is correct and has no issues.
|
|
74
|
+
- `donna -p <protocol> artifacts validate-all [--pattern <artifact-pattern>]` — validate all artifacts corresponding to the given pattern.
|
|
75
|
+
|
|
76
|
+
The format of `<artifact-pattern>` is as follows:
|
|
77
|
+
|
|
78
|
+
- full artifact identifier: `<world>:<artifact>`
|
|
79
|
+
- `*` — single wildcard matches a single level in the artifact path. Examples:
|
|
80
|
+
- `*:artifact:name` — matches all artifacts named `artifact:name` in all worlds.
|
|
81
|
+
- `world:*:name` — matches all artifacts with id `something:name` in the `world` world.
|
|
82
|
+
- `**` — double wildcard matches multiple levels in the artifact path. Examples:
|
|
83
|
+
- `**:name` — matches all artifacts with id ending with `:name` in all worlds.
|
|
84
|
+
- `world:**` — matches all artifacts in the `world` world.
|
|
85
|
+
- `world:**:name` — matches all artifacts with id ending with `:name` in the `world` world.
|
|
86
|
+
|
|
87
|
+
## IMPORTANT ON DONNA TOOL USAGE
|
|
88
|
+
|
|
89
|
+
**Strictly follow described command syntax**
|
|
90
|
+
|
|
91
|
+
**You MUST follow `donna` call conventions specified in**, by priority:
|
|
92
|
+
|
|
93
|
+
1. Direct instructions from the developer.
|
|
94
|
+
2. `AGENTS.md` document.
|
|
95
|
+
3. Specifications in `project:` world.
|
|
96
|
+
4. This document.
|
|
97
|
+
|
|
98
|
+
**All Donna CLI commands MUST include an explicit protocol selection using `-p <mode>`.** Like `donna -p llm <command>`.
|
|
99
|
+
|
|
100
|
+
**Pass text arguments to the tool in quotes with respect to escaping.** The tool MUST receive the exact text you want to pass as an argument.
|
|
101
|
+
|
|
102
|
+
Use one of the next approaches to correctly escape text arguments:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
# option 1
|
|
106
|
+
donna -p <protocol> <command> <...> $'# Long text\n\nwith escape sequences...'
|
|
107
|
+
|
|
108
|
+
# option 2
|
|
109
|
+
donna -p <protocol> <command> <...> \
|
|
110
|
+
"$(cat <<'EOF'
|
|
111
|
+
# Long text
|
|
112
|
+
|
|
113
|
+
with escape sequences...
|
|
114
|
+
EOF
|
|
115
|
+
)"
|
|
116
|
+
|
|
117
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Donna World Layout
|
|
2
|
+
|
|
3
|
+
```toml donna
|
|
4
|
+
kind = "donna.lib.specification"
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
This document describes how Donna discovers and manages its dynamic and/or external artifacts.
|
|
8
|
+
Including usage docs, work workflows, operations, current work state and additional code.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
In order to function properly and to perform in a full potential, Donna relies on a set of artifacts
|
|
13
|
+
that guide its behavior and provide necessary capabilities.
|
|
14
|
+
|
|
15
|
+
These artifacts are represented as text files, primary in Markdown format, however other text-based
|
|
16
|
+
formats can be used as well, if explicitly requested by the developer or by the workflows.
|
|
17
|
+
|
|
18
|
+
Donna discovers these artifacts by scanning the "worlds" specified in `<project-root>/.donna/config.toml`
|
|
19
|
+
as `worlds` list. Most of worlds are filesystem folders, however other world types can be implemented such as:
|
|
20
|
+
s3 buckets, git repositories, databases, etc.
|
|
21
|
+
|
|
22
|
+
Default worlds and there locations are:
|
|
23
|
+
|
|
24
|
+
- `donna` — `donna.artifacts` — the subpackage with artifacts provided by Donna itself.
|
|
25
|
+
- `home` — `~/.donna/home` — the user-level donna artifacts, i.e. those that should be visible to all projects on this machine.
|
|
26
|
+
- `project` — `<project-root>/.donna/project` — the project-level donna artifacts, i.e. those that are specific to this project.
|
|
27
|
+
- `session` — `<project-root>/.donna/session` — the session world that contains the current state of work performed by Donna.
|
|
28
|
+
|
|
29
|
+
All worlds have a free layout, defined by developers who own the particular world.
|
|
30
|
+
|
|
31
|
+
## Write Access
|
|
32
|
+
|
|
33
|
+
By default, worlds are read-only. Besides the next exceptions:
|
|
34
|
+
|
|
35
|
+
- `session` in the project world is read-write, Donna stores its current state of work here.
|
|
36
|
+
- `<project-root>/.donna` is read-write when the developer explicitly asks Donna to change it. For example, to add the result of performed work into project usage docs.
|
|
File without changes
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Meta Work Loop
|
|
2
|
+
|
|
3
|
+
```toml donna
|
|
4
|
+
kind = "donna.lib.workflow"
|
|
5
|
+
start_operation_id = "start"
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
General purpose work planning and execution workflow. Use it when you need to do complex work and there is no more specific workflow available.
|
|
9
|
+
|
|
10
|
+
## Start Work
|
|
11
|
+
|
|
12
|
+
```toml donna
|
|
13
|
+
id = "start"
|
|
14
|
+
kind = "donna.lib.request_action"
|
|
15
|
+
fsm_mode = "start"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
19
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
20
|
+
3. If the developer hasn't provided you a description of the work for this session, ask them to provide it.
|
|
21
|
+
4. Create new session-level specification `session:work_scope` with developer-provided description of the work to be done.
|
|
22
|
+
5. `{{ donna.lib.goto("create_work_description") }}`
|
|
23
|
+
|
|
24
|
+
## Create Work Description
|
|
25
|
+
|
|
26
|
+
```toml donna
|
|
27
|
+
id = "create_work_description"
|
|
28
|
+
kind = "donna.lib.request_action"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
32
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
33
|
+
3. Formulate a concise high-level description of the work to be done, based on the developer-provided description.
|
|
34
|
+
4. Add this description to the `session:work_scope`.
|
|
35
|
+
5. `{{ donna.lib.goto("list_primary_goals") }}`
|
|
36
|
+
|
|
37
|
+
## List Primary Goals
|
|
38
|
+
|
|
39
|
+
```toml donna
|
|
40
|
+
id = "list_primary_goals"
|
|
41
|
+
kind = "donna.lib.request_action"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
45
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
46
|
+
3. If you can add more goals based on existing `{{ donna.lib.view("session:work_scope") }}` add them to the specification.
|
|
47
|
+
4. If you can polish the existing goals according to the quality criteria in the `{{ donna.lib.view("donna:work:planning") }}` do it.
|
|
48
|
+
5. `{{ donna.lib.goto("list_objectives") }}`
|
|
49
|
+
|
|
50
|
+
## List Objectives
|
|
51
|
+
|
|
52
|
+
```toml donna
|
|
53
|
+
id = "list_objectives"
|
|
54
|
+
kind = "donna.lib.request_action"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You MUST list objectives that need to be achieved to complete each goal.
|
|
58
|
+
|
|
59
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
60
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
61
|
+
3. If you can add more objectives based on existing `{{ donna.lib.view("session:work_scope") }}` add them to the specification.
|
|
62
|
+
4. If you can polish the existing objectives according to the quality criteria in the `{{ donna.lib.view("donna:work:planning") }}` do it.
|
|
63
|
+
5. `{{ donna.lib.goto("list_constraints") }}`
|
|
64
|
+
|
|
65
|
+
## List Constraints
|
|
66
|
+
|
|
67
|
+
```toml donna
|
|
68
|
+
id = "list_constraints"
|
|
69
|
+
kind = "donna.lib.request_action"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
73
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
74
|
+
3. If you can add more constraints based on existing `{{ donna.lib.view("session:work_scope") }}` add them to the specification.
|
|
75
|
+
4. If you can polish the existing constraints according to the quality criteria in the `{{ donna.lib.view("donna:work:planning") }}` do it.
|
|
76
|
+
5. `{{ donna.lib.goto("list_acceptance_criteria") }}`
|
|
77
|
+
|
|
78
|
+
## List Acceptance Criteria
|
|
79
|
+
|
|
80
|
+
```toml donna
|
|
81
|
+
id = "list_acceptance_criteria"
|
|
82
|
+
kind = "donna.lib.request_action"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
86
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
87
|
+
3. If you can add more acceptance criteria based on existing `{{ donna.lib.view("session:work_scope") }}` add them to the specification.
|
|
88
|
+
4. If you can polish the existing acceptance criteria according to the quality criteria in the `{{ donna.lib.view("donna:work:planning") }}` do it.
|
|
89
|
+
5. `{{ donna.lib.goto("list_deliverables") }}`
|
|
90
|
+
|
|
91
|
+
## List Deliverables
|
|
92
|
+
|
|
93
|
+
```toml donna
|
|
94
|
+
id = "list_deliverables"
|
|
95
|
+
kind = "donna.lib.request_action"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
99
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
100
|
+
3. If you can list more deliverables based on existing `{{ donna.lib.view("session:work_scope") }}` add them to the specification.
|
|
101
|
+
4. If you can polish the existing deliverables according to the quality criteria in the `{{ donna.lib.view("donna:work:planning") }}` do it.
|
|
102
|
+
5. `{{ donna.lib.goto("prepare_plan") }}`
|
|
103
|
+
|
|
104
|
+
## Prepare Work Plan
|
|
105
|
+
|
|
106
|
+
```toml donna
|
|
107
|
+
id = "prepare_plan"
|
|
108
|
+
kind = "donna.lib.request_action"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
1. Read the specification `{{ donna.lib.view("donna:work:planning") }}` if you haven't done it yet.
|
|
112
|
+
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
113
|
+
3. Read the specification `{{ donna.lib.view("session:work_scope") }}` if you haven't done it yet.
|
|
114
|
+
4. Create new session-level workflow `session:work_execution` according to the scope of work you have defined.
|
|
115
|
+
5. `{{ donna.lib.goto("execute_plan") }}`
|
|
116
|
+
|
|
117
|
+
## Execute Plan
|
|
118
|
+
|
|
119
|
+
```toml donna
|
|
120
|
+
id = "execute_plan"
|
|
121
|
+
kind = "donna.lib.request_action"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
1. Run workflow `session:work_execution` to execute the work according to the plan.
|
|
125
|
+
2. `{{ donna.lib.goto("groom_work") }}`
|
|
126
|
+
|
|
127
|
+
## Groom Work
|
|
128
|
+
|
|
129
|
+
```toml donna
|
|
130
|
+
id = "groom_work"
|
|
131
|
+
kind = "donna.lib.request_action"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
1. Run the grooming workflow to ensure that the result is polished, clean, and ready for review.
|
|
135
|
+
2. `{{ donna.lib.goto("finish") }}`
|
|
136
|
+
|
|
137
|
+
## Finish
|
|
138
|
+
|
|
139
|
+
```toml donna
|
|
140
|
+
id = "finish"
|
|
141
|
+
kind = "donna.lib.finish"
|
|
142
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Show Workflow Spec + Schema
|
|
2
|
+
|
|
3
|
+
```toml donna
|
|
4
|
+
kind = "donna.lib.workflow"
|
|
5
|
+
start_operation_id = "read_workflow_source"
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
<!-- This is a temporary worflow, later Donna should have a specialized command to display the spec -->
|
|
9
|
+
|
|
10
|
+
This workflow guides an agent through loading a workflow artifact source, choosing the correct FSM graph DSL, and producing a concise schema summary with a graph and per-operation descriptions.
|
|
11
|
+
|
|
12
|
+
## Read workflow source
|
|
13
|
+
|
|
14
|
+
```toml donna
|
|
15
|
+
id = "read_workflow_source"
|
|
16
|
+
kind = "donna.lib.request_action"
|
|
17
|
+
fsm_mode = "start"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
1. Identify the full workflow artifact id to summarize from the developer request (for example: `project:work:grooming`).
|
|
21
|
+
2. If the workflow id is missing or ambiguous, ask the developer to provide the exact id, then repeat this operation.
|
|
22
|
+
3. Fetch the workflow artifact source with:
|
|
23
|
+
- `./bin/donna.sh artifacts fetch '<workflow-id>'`
|
|
24
|
+
4. Read the fetched source from the path printed by the command to capture:
|
|
25
|
+
- Workflow name (H1 title) and short description.
|
|
26
|
+
- The start operation (from `start_operation_id` in the workflow head config, which must be marked with `fsm_mode = "start"`).
|
|
27
|
+
- Each operation `id`, `kind`, and any {% raw %}`{{ donna.lib.goto(...) }}`{% endraw %} transitions in its body.
|
|
28
|
+
5. Continue to {{ donna.lib.goto("select_fsm_dsl") }}.
|
|
29
|
+
|
|
30
|
+
## Select FSM graph DSL
|
|
31
|
+
|
|
32
|
+
```toml donna
|
|
33
|
+
id = "select_fsm_dsl"
|
|
34
|
+
kind = "donna.lib.request_action"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
1. Determine whether the developer requested a specific FSM graph DSL (from the original request or provided inputs).
|
|
38
|
+
2. If a DSL is specified, record it verbatim for rendering.
|
|
39
|
+
3. If no DSL is specified, select Mermaid DSL.
|
|
40
|
+
4. Continue to {{ donna.lib.goto("render_schema") }}.
|
|
41
|
+
|
|
42
|
+
## Render short schema
|
|
43
|
+
|
|
44
|
+
```toml donna
|
|
45
|
+
id = "render_schema"
|
|
46
|
+
kind = "donna.lib.request_action"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
1. Produce the schema output in the exact meta format below, using the selected DSL for the FSM graph:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
# <workflow name>
|
|
53
|
+
|
|
54
|
+
<very short one sentence description of what it does>
|
|
55
|
+
|
|
56
|
+
<FSM graph description in some DSL>
|
|
57
|
+
|
|
58
|
+
<list of operations: `<id>` — <short one sentence description of what it does>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. Ensure the FSM graph includes all operations and transitions, and clearly marks the start and finish operations.
|
|
62
|
+
3. For Mermaid, use a `stateDiagram-v2` or `flowchart` representation and keep node ids aligned with operation ids.
|
|
63
|
+
4. For each operation list entry, write a single concise sentence that is clean, complete, and faithful to the operation body.
|
|
64
|
+
5. Continue to {{ donna.lib.goto("refine_schema") }}.
|
|
65
|
+
|
|
66
|
+
## Refine schema output
|
|
67
|
+
|
|
68
|
+
```toml donna
|
|
69
|
+
id = "refine_schema"
|
|
70
|
+
kind = "donna.lib.request_action"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
1. Re-read the produced schema and improve clarity and correctness without changing the required format.
|
|
74
|
+
2. Tighten wording to keep each description to a single clean sentence while still being thorough and accurate.
|
|
75
|
+
3. Ensure the DSL selection rule is reflected in the graph and described output.
|
|
76
|
+
4. Continue to {{ donna.lib.goto("validate_schema") }}.
|
|
77
|
+
|
|
78
|
+
## Validate schema output
|
|
79
|
+
|
|
80
|
+
```toml donna
|
|
81
|
+
id = "validate_schema"
|
|
82
|
+
kind = "donna.lib.request_action"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
1. Verify the output contains the title, one-sentence description, FSM graph, and operation list in the required order.
|
|
86
|
+
2. Confirm the chosen DSL is correct (developer-specified or Mermaid by default).
|
|
87
|
+
3. Confirm each operation description is a single sentence and matches the operation purpose.
|
|
88
|
+
4. If any check fails, return to {{ donna.lib.goto("refine_schema") }}.
|
|
89
|
+
5. If all checks pass, proceed to {{ donna.lib.goto("finish") }}.
|
|
90
|
+
|
|
91
|
+
## Finish
|
|
92
|
+
|
|
93
|
+
```toml donna
|
|
94
|
+
id = "finish"
|
|
95
|
+
kind = "donna.lib.finish"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Workflow complete.
|