donna 0.2.1__py3-none-any.whl → 0.2.2__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/artifacts/intro.md +2 -2
- donna/artifacts/research/specs/report.md +7 -7
- donna/artifacts/research/work/research.md +6 -6
- donna/artifacts/rfc/specs/request_for_change.md +18 -19
- donna/artifacts/rfc/work/create.md +4 -4
- donna/artifacts/rfc/work/do.md +8 -8
- donna/artifacts/rfc/work/plan.md +9 -9
- donna/artifacts/usage/artifacts.md +18 -10
- donna/artifacts/usage/cli.md +23 -17
- donna/cli/commands/sessions.py +1 -1
- donna/machine/primitives.py +1 -1
- donna/machine/sessions.py +1 -1
- donna/machine/state.py +2 -2
- donna/primitives/operations/output.py +12 -12
- donna/workspaces/config.py +5 -5
- donna/workspaces/sources/markdown.py +1 -1
- donna/workspaces/tmp.py +2 -2
- donna/workspaces/worlds/base.py +1 -1
- donna/workspaces/worlds/filesystem.py +7 -1
- donna-0.2.2.dist-info/METADATA +463 -0
- {donna-0.2.1.dist-info → donna-0.2.2.dist-info}/RECORD +24 -24
- donna-0.2.1.dist-info/METADATA +0 -47
- {donna-0.2.1.dist-info → donna-0.2.2.dist-info}/WHEEL +0 -0
- {donna-0.2.1.dist-info → donna-0.2.2.dist-info}/entry_points.txt +0 -0
- {donna-0.2.1.dist-info → donna-0.2.2.dist-info}/licenses/LICENSE +0 -0
donna/artifacts/intro.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Introduction to the Donna tool
|
|
2
2
|
|
|
3
3
|
```toml donna
|
|
4
4
|
kind = "donna.lib.specification"
|
|
@@ -21,7 +21,7 @@ We may need coding agents on the each step of the process, but there no reason f
|
|
|
21
21
|
|
|
22
22
|
## Artifact Tags
|
|
23
23
|
|
|
24
|
-
To
|
|
24
|
+
To simplify searching for artifacts by their semantics, Donna allows tagging artifacts with semantically valuable keywords. Artifacts in `donna:*` world use the next set of tags.
|
|
25
25
|
|
|
26
26
|
Artifact type tags:
|
|
27
27
|
|
|
@@ -12,7 +12,7 @@ Donna introduces a group of workflows located in `donna:research:*` namespace th
|
|
|
12
12
|
|
|
13
13
|
Session-related research artifacts MUST be stored as `session:research:<short-problem-related-identifier>`, unless the developer or parent workflow specifies a different location. The `<short-problem-related-identifier>` MUST be unique within the session.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The agent (via workflows) creates the artifact and updates it iteratively as the research process progresses.
|
|
16
16
|
|
|
17
17
|
## Research report structure
|
|
18
18
|
|
|
@@ -40,14 +40,14 @@ The research report is a Donna artifact (check `{{ donna.lib.view("donna:usage:a
|
|
|
40
40
|
|
|
41
41
|
### List format
|
|
42
42
|
|
|
43
|
-
- If a section described as a list, it MUST contain only a single markdown list.
|
|
43
|
+
- If a section is described as a list, it MUST contain only a single markdown list.
|
|
44
44
|
- Each list item MUST be concise and clear.
|
|
45
45
|
- Each list item SHOULD be atomic and focused on a single aspect.
|
|
46
|
-
- Reviewer MUST be able to tell if the list item statement is true or false by inspecting resulting artifacts and behavior.
|
|
46
|
+
- Reviewer MUST be able to tell if the list item statement is true or false by inspecting the resulting artifacts and behavior.
|
|
47
47
|
|
|
48
48
|
Common approaches to improve list items:
|
|
49
49
|
|
|
50
|
-
- Split a single item with an enumeration into multiple items with single focus.
|
|
50
|
+
- Split a single item with an enumeration into multiple items with a single focus.
|
|
51
51
|
- Transform an abstract item into a concrete one by referencing specific artifacts, measurable criteria, verifiable conditions, etc.
|
|
52
52
|
|
|
53
53
|
### Trusted inputs
|
|
@@ -57,9 +57,9 @@ Some sections of the research report MUST be based on trusted inputs. Trusted in
|
|
|
57
57
|
- Original problem description from the developer or parent workflow.
|
|
58
58
|
- Statements from the research report itself.
|
|
59
59
|
- Existing project documentation, code, and artifacts.
|
|
60
|
-
- External standards when they define constraints or best practices for the project domain.
|
|
61
|
-
- Documentation of third-party libraries, frameworks, or tools when
|
|
62
|
-
- Primary research sources (datasets, reports, official publications) used to collect the required information.
|
|
60
|
+
- External standards, when they define constraints or best practices for the project domain.
|
|
61
|
+
- Documentation of third-party libraries, frameworks, or tools when they describe constraints or best practices.
|
|
62
|
+
- Primary research sources (datasets, reports, official publications) were used to collect the required information.
|
|
63
63
|
|
|
64
64
|
## `Primary` section
|
|
65
65
|
|
|
@@ -9,7 +9,7 @@ Workflow for performing research on a given question/problem/situation. Collects
|
|
|
9
9
|
|
|
10
10
|
The purpose of this workflow is to provide an information for making decisions or producing solutions based on researched data. It can be used:
|
|
11
11
|
|
|
12
|
-
- When the developer explicitly asks to
|
|
12
|
+
- When the developer explicitly asks to conduct research.
|
|
13
13
|
- When other workflows need to perform research as a subtask.
|
|
14
14
|
|
|
15
15
|
## Start
|
|
@@ -31,7 +31,7 @@ id = "ensure_problem_description_exists"
|
|
|
31
31
|
kind = "donna.lib.request_action"
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
At this point you SHOULD have a clear description of the problem in your context. I.e
|
|
34
|
+
At this point, you SHOULD have a clear description of the problem in your context. I.e., you know what you need to do in this workflow.
|
|
35
35
|
|
|
36
36
|
1. If you have a problem description in your context, `{{ donna.lib.goto("prepare_artifact") }}`.
|
|
37
37
|
2. If you have no problem description in your context, but you know it is in one of `session:*` artifacts, find and view it. Then `{{ donna.lib.goto("prepare_artifact") }}`.
|
|
@@ -99,9 +99,9 @@ id = "describe_solution_space"
|
|
|
99
99
|
kind = "donna.lib.request_action"
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
To produce solution we should understand how to analyze the data and how to synthesize results into the final solution.
|
|
102
|
+
To produce a solution, we should understand how to analyze the data and how to synthesize results into the final solution.
|
|
103
103
|
|
|
104
|
-
For this we need to list the axes along which we will analyze the data and the dimensions along which we will synthesize the results.
|
|
104
|
+
For this, we need to list the axes along which we will analyze the data and the dimensions along which we will synthesize the results.
|
|
105
105
|
|
|
106
106
|
1. List the analysis axes.
|
|
107
107
|
2. List the synthesis dimensions.
|
|
@@ -151,7 +151,7 @@ id = "analyze_information"
|
|
|
151
151
|
kind = "donna.lib.request_action"
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
1. Using the analysis axes from the solution space description, analyze the collected information. Choose the format that best represents the analysis results and suits the
|
|
154
|
+
1. Using the analysis axes from the solution space description, analyze the collected information. Choose the format that best represents the analysis results and suits the required solution form.
|
|
155
155
|
2. Update the artifact with the analysis results.
|
|
156
156
|
3. `{{ donna.lib.goto("synthesize_solutions") }}`
|
|
157
157
|
|
|
@@ -162,7 +162,7 @@ id = "synthesize_solutions"
|
|
|
162
162
|
kind = "donna.lib.request_action"
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
1. Using the synthesis dimensions from the solution space description, synthesize possible solutions based on the analysis results. Choose the format that best represents the synthesized solutions and suits the
|
|
165
|
+
1. Using the synthesis dimensions from the solution space description, synthesize possible solutions based on the analysis results. Choose the format that best represents the synthesized solutions and suits the required solution form.
|
|
166
166
|
2. Update the artifact with the synthesized solutions.
|
|
167
167
|
3. `{{ donna.lib.goto("evaluate_solutions") }}`
|
|
168
168
|
|
|
@@ -10,13 +10,13 @@ This document describes the format and structure of a Request for Change (RFC) d
|
|
|
10
10
|
|
|
11
11
|
Donna introduces a group of workflows located in `donna:rfc:*` namespace that organize the process of proposing, reviewing, and implementing changes to a project via RFC documents.
|
|
12
12
|
|
|
13
|
-
You create RFC documents to propose changes to the project
|
|
13
|
+
You create RFC documents to propose changes to the project.
|
|
14
14
|
|
|
15
|
-
If
|
|
15
|
+
If not otherwise specified, RFC documents for the session MUST be stored as `session:rfc:<short-problem-related-identifier>` artifacts in the session world.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The agent (via workflows) creates the artifact and polishes it iteratively as the RFC process progresses.
|
|
18
18
|
|
|
19
|
-
After the RFC is completed, agent (via workflows) MAY implement changes directly or
|
|
19
|
+
After the RFC is completed, the agent (via workflows) MAY implement changes directly or create and execute a workflow based on the RFC content.
|
|
20
20
|
|
|
21
21
|
## RFC structure
|
|
22
22
|
|
|
@@ -43,23 +43,23 @@ The RFC document is Donna artifact (check `{{ donna.lib.view("donna:usage:artifa
|
|
|
43
43
|
|
|
44
44
|
### List format
|
|
45
45
|
|
|
46
|
-
- If a section described as a list, it MUST contain only a single markdown list.
|
|
46
|
+
- If a section is described as a list, it MUST contain only a single markdown list.
|
|
47
47
|
- Each list item MUST be concise and clear.
|
|
48
48
|
- Each list item SHOULD be atomic and focused on a single aspect.
|
|
49
|
-
- Reviewer MUST be able to tell
|
|
49
|
+
- Reviewer MUST be able to tell whether the list item statement is true or false by inspecting the resulting artifacts and behavior.
|
|
50
50
|
|
|
51
51
|
Examples:
|
|
52
52
|
|
|
53
53
|
- Bad: `- Improve performance and fix bugs.`
|
|
54
54
|
- Bad: `- The interface MUST include button A, button B, and dropdown C.`
|
|
55
55
|
- Good: `- Performance test MUST show at least 20% improvement in response time under load.`
|
|
56
|
-
- Good: `- Fix bug A causing crash when input is empty.`
|
|
56
|
+
- Good: `- Fix bug A causing a crash when input is empty.`
|
|
57
57
|
- Good: `- The interface MUST include button A that triggers action X.`
|
|
58
58
|
- Good: `- The interface MUST include button B that triggers action Y.`
|
|
59
59
|
|
|
60
60
|
Common approaches to improve list items:
|
|
61
61
|
|
|
62
|
-
- Split a single item with an enumeration into multiple items with single focus.
|
|
62
|
+
- Split a single item with an enumeration into multiple items with a single focus.
|
|
63
63
|
- Transform an abstract item into a concrete one by specifying measurable criteria or user-visible behavior.
|
|
64
64
|
|
|
65
65
|
### Trusted inputs
|
|
@@ -69,8 +69,8 @@ Some sections of the RFC document MUST be based on trusted inputs. Trusted input
|
|
|
69
69
|
- Original description from the developer or parent workflow.
|
|
70
70
|
- Statements from the RFC document itself.
|
|
71
71
|
- Existing project documentation, code, and artifacts.
|
|
72
|
-
- External standards when they define constraints or best practices for the project domain.
|
|
73
|
-
- Documentation of third-party libraries, frameworks, or tools when
|
|
72
|
+
- External standards, when they define constraints or best practices for the project domain.
|
|
73
|
+
- Documentation of third-party libraries, frameworks, or tools when they describe constraints or best practices.
|
|
74
74
|
|
|
75
75
|
## `Primary` section
|
|
76
76
|
|
|
@@ -84,10 +84,9 @@ Some sections of the RFC document MUST be based on trusted inputs. Trusted input
|
|
|
84
84
|
|
|
85
85
|
## `Formal description` section
|
|
86
86
|
|
|
87
|
-
- The section MUST contain a clear professional high-level description of the work to be done based
|
|
88
|
-
on the developer's request.
|
|
87
|
+
- The section MUST contain a clear professional high-level description of the work to be done based on the developer's request.
|
|
89
88
|
- The section MUST be limited to a single paragraph with a few sentences.
|
|
90
|
-
- The
|
|
89
|
+
- The section MUST explain what someone gains after these changes and how they can see it working.
|
|
91
90
|
State the user-visible behavior the change will enable.
|
|
92
91
|
|
|
93
92
|
## `Goals` section
|
|
@@ -96,7 +95,7 @@ Some sections of the RFC document MUST be based on trusted inputs. Trusted input
|
|
|
96
95
|
|
|
97
96
|
The goal quality criteria:
|
|
98
97
|
|
|
99
|
-
- A goal MUST be a desired end state, outcome or result.
|
|
98
|
+
- A goal MUST be a desired end state, outcome, or result.
|
|
100
99
|
- A goal MUST define what ultimately should be true, not how to achieve it.
|
|
101
100
|
|
|
102
101
|
Examples:
|
|
@@ -141,7 +140,7 @@ Examples:
|
|
|
141
140
|
- Bad: `- Use clean architecture.`
|
|
142
141
|
- Good: `- The solution MUST be compatible with Python 3.12.`
|
|
143
142
|
- Good: `- The solution MUST NOT introduce new runtime dependencies.`
|
|
144
|
-
- Good: `- The solution MUST follow specification project:specs:abc`
|
|
143
|
+
- Good: `- The solution MUST follow the specification project:specs:abc`
|
|
145
144
|
- Good: `MUST not change public CLI flags`
|
|
146
145
|
|
|
147
146
|
## `Requirements` section
|
|
@@ -165,12 +164,12 @@ Examples:
|
|
|
165
164
|
## `Acceptance criteria` section
|
|
166
165
|
|
|
167
166
|
- The section MUST contain a list of acceptance criteria used to determine whether the proposed change is complete and successful.
|
|
168
|
-
- An acceptance criterion MUST be derived
|
|
167
|
+
- An acceptance criterion MUST be derived explicitly from statements in the RFC document. Agents MUST NOT invent acceptance criteria.
|
|
169
168
|
|
|
170
169
|
Acceptance criteria quality criteria:
|
|
171
170
|
|
|
172
171
|
- An acceptance criterion MUST be a single atomic check that results in a pass/fail outcome.
|
|
173
|
-
- An acceptance criterion check MUST be about a single artifact: single file exists, single test passes, single behavior observed, etc.
|
|
172
|
+
- An acceptance criterion check MUST be about a single artifact: a single file exists, a single test passes, a single behavior observed, etc.
|
|
174
173
|
- An acceptance criterion MUST NOT describe implementation steps, internal design decisions, or "how" to achieve the result.
|
|
175
174
|
|
|
176
175
|
Examples:
|
|
@@ -192,7 +191,7 @@ Solution statement quality criteria:
|
|
|
192
191
|
|
|
193
192
|
- A solution statement MUST be a specific change in a specific artifact, behavior, or capability.
|
|
194
193
|
- A solution statement MUST NOT prescribe implementation steps.
|
|
195
|
-
- A solution statement SHOULD be phrased in present tense, describing an achieved state.
|
|
194
|
+
- A solution statement SHOULD be phrased in the present tense, describing an achieved state.
|
|
196
195
|
|
|
197
196
|
Examples:
|
|
198
197
|
|
|
@@ -231,7 +230,7 @@ Examples:
|
|
|
231
230
|
|
|
232
231
|
Deliverable quality criteria:
|
|
233
232
|
|
|
234
|
-
- A deliverable MUST be a tangible
|
|
233
|
+
- A deliverable MUST be a tangible, single artifact or a single part of an artifact, not an activity or process.
|
|
235
234
|
- A deliverable MUST be independently identifiable and verifiable.
|
|
236
235
|
- Each deliverable MUST be phrased as an existence statement using normative
|
|
237
236
|
language: "MUST include …", "MUST exist …", etc.
|
|
@@ -6,7 +6,7 @@ kind = "donna.lib.workflow"
|
|
|
6
6
|
start_operation_id = "start"
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
This workflow creates a Request for Change (RFC) document based on a description of
|
|
9
|
+
This workflow creates a Request for Change (RFC) document based on a description of the problem or the required changes.
|
|
10
10
|
|
|
11
11
|
## Start Work
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ id = "ensure_work_description_exists"
|
|
|
27
27
|
kind = "donna.lib.request_action"
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
At this point you SHOULD have a clear description of the problem in your context. I.e. you know what you need to do in this workflow.
|
|
30
|
+
At this point, you SHOULD have a clear description of the problem in your context. I.e. you know what you need to do in this workflow.
|
|
31
31
|
|
|
32
32
|
1. If you have a problem description in your context, `{{ donna.lib.goto("prepare_rfc_artifact") }}`.
|
|
33
33
|
2. If you have no problem description in your context, but you know it is in one of `{{ donna.lib.list("session:**") }}` artifacts, find and view it. Then `{{ donna.lib.goto("prepare_rfc_artifact") }}`.
|
|
@@ -40,7 +40,7 @@ id = "prepare_rfc_artifact"
|
|
|
40
40
|
kind = "donna.lib.request_action"
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
1. If the name of artifact is not specified explicitly, assume it to be `session:rfc:<short-problem-related-identifier>`, where `<short-problem-related-identifier>` MUST be unique within the session.
|
|
43
|
+
1. If the name of the artifact is not specified explicitly, assume it to be `session:rfc:<short-problem-related-identifier>`, where `<short-problem-related-identifier>` MUST be unique within the session.
|
|
44
44
|
2. Save the next template into the artifact, replace `<variables>` with appropriate values.
|
|
45
45
|
|
|
46
46
|
```
|
|
@@ -105,7 +105,7 @@ id = "review_rfc_content"
|
|
|
105
105
|
kind = "donna.lib.request_action"
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
1. Read the RFC document and identify any gaps, inconsistencies, or areas for improvement in the content in accordance with the current project context. Use `{{ donna.lib.view("donna:research:work:research") }}` workflow if you need to
|
|
108
|
+
1. Read the RFC document and identify any gaps, inconsistencies, or areas for improvement in the content in accordance with the current project context. Use `{{ donna.lib.view("donna:research:work:research") }}` workflow if you need to make a complex decision.
|
|
109
109
|
2. Make necessary edits to the RFC draft artifact to address identified issues.
|
|
110
110
|
3. If there were changes made on this step or the previous `review_rfc_format` step `{{ donna.lib.goto("review_rfc_format") }}`.
|
|
111
111
|
4. If no changes were made, `{{ donna.lib.goto("finish") }}`.
|
donna/artifacts/rfc/work/do.md
CHANGED
|
@@ -20,12 +20,12 @@ kind = "donna.lib.request_action"
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
1. If the developer or parent workflow explicitly specified that the work is complex, `{{ donna.lib.goto("create_rfc") }}`.
|
|
23
|
-
2. If the developer or parent workflow explicitly specified that the work is simple, `{{ donna.lib.goto("
|
|
23
|
+
2. If the developer or parent workflow explicitly specified that the work is simple, `{{ donna.lib.goto("fast_planning") }}`.
|
|
24
24
|
3. Make a rough estimate of the complexity of the requested changes.
|
|
25
|
-
4. If the complexity is small, `{{ donna.lib.goto("
|
|
25
|
+
4. If the complexity is small, `{{ donna.lib.goto("fast_planning") }}`.
|
|
26
26
|
5. Otherwise, `{{ donna.lib.goto("create_rfc") }}`.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Examples of changes with small complexity:
|
|
29
29
|
|
|
30
30
|
- A single file edit with clear instructions.
|
|
31
31
|
- A small addition to an existing function or class.
|
|
@@ -33,10 +33,10 @@ Examles of changes with small complexity:
|
|
|
33
33
|
- A small documentation update.
|
|
34
34
|
- A simple bug fix with a known solution.
|
|
35
35
|
|
|
36
|
-
## Fast
|
|
36
|
+
## Fast planning
|
|
37
37
|
|
|
38
38
|
```toml donna
|
|
39
|
-
id = "
|
|
39
|
+
id = "fast_planning"
|
|
40
40
|
kind = "donna.lib.request_action"
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -62,9 +62,9 @@ id = "plan_rfc_work"
|
|
|
62
62
|
kind = "donna.lib.request_action"
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
1. Choose the workflow to plan the work required to implement the RFC created
|
|
65
|
+
1. Choose the workflow to plan the work required to implement the RFC created in the previous step.
|
|
66
66
|
2. Run the chosen workflow.
|
|
67
|
-
3. Ensure you know the workflow id created in the previous step (default is `session:
|
|
67
|
+
3. Ensure you know the workflow id created in the previous step (default is `session:execute_rfc` if not specified).
|
|
68
68
|
4. After completing the workflow `{{ donna.lib.goto("execute_rfc_work") }}`.
|
|
69
69
|
|
|
70
70
|
## Execute RFC work
|
|
@@ -74,7 +74,7 @@ id = "execute_rfc_work"
|
|
|
74
74
|
kind = "donna.lib.request_action"
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
1. Run the workflow created by the plan step (default: `session:
|
|
77
|
+
1. Run the workflow created by the plan step (default: `session:execute_rfc`) and complete it.
|
|
78
78
|
2. After completing the workflow `{{ donna.lib.goto("polish_changes") }}`.
|
|
79
79
|
|
|
80
80
|
## Polish changes
|
donna/artifacts/rfc/work/plan.md
CHANGED
|
@@ -16,7 +16,7 @@ kind = "donna.lib.request_action"
|
|
|
16
16
|
fsm_mode = "start"
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
1. Read the RFC the developer or parent workflow
|
|
19
|
+
1. Read the RFC that the developer or parent workflow wants you to implement.
|
|
20
20
|
2. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
|
|
21
21
|
2. `{{ donna.lib.goto("prepare_workflow_artifact") }}`
|
|
22
22
|
|
|
@@ -27,15 +27,15 @@ id = "prepare_workflow_artifact"
|
|
|
27
27
|
kind = "donna.lib.request_action"
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
1. If the name of artifact is not specified explicitly, assume it to `session:plans:<short-id-equal-to-rfc-slug>`.
|
|
30
|
+
1. If the name of the artifact is not specified explicitly, assume it to `session:plans:<short-id-equal-to-rfc-slug>`.
|
|
31
31
|
2. Create a workflow with the next operations:
|
|
32
32
|
- Start
|
|
33
33
|
- A step for each action point in the RFC, ordered to minimize dependencies between steps and introduce changes incrementally.
|
|
34
|
-
- (`id="review_changes"`) A gate step to start
|
|
35
|
-
- A gate step to start
|
|
36
|
-
- A step per deliverable to check if it exists and is correct. If the deliverable is missing or incorrect, step MUST specify how to fix it
|
|
34
|
+
- (`id="review_changes"`) A gate step to start reviewing the changes.
|
|
35
|
+
- A gate step to start reviewing the deliverables.
|
|
36
|
+
- A step per deliverable to check if it exists and is correct. If the deliverable is missing or incorrect, the step MUST specify how to fix it and `goto` to the `review_changes` step.
|
|
37
37
|
- A gate step to start verification.
|
|
38
|
-
- A step for each verification statement to check it. If the statement is not satisfied, step MUST specify how to fix it and goto to the `review_changes` step.
|
|
38
|
+
- A step for each verification statement to check it. If the statement is not satisfied, the step MUST specify how to fix it and `goto` to the `review_changes` step.
|
|
39
39
|
- A finish step.
|
|
40
40
|
3. `{{ donna.lib.goto("review_workflow") }}`
|
|
41
41
|
|
|
@@ -46,16 +46,16 @@ id = "review_workflow"
|
|
|
46
46
|
kind = "donna.lib.request_action"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
For each of steps in the workflow you created:
|
|
49
|
+
For each of the steps in the workflow you created:
|
|
50
50
|
|
|
51
|
-
1. If the step can fail, add instructions on how to fix the issue and goto to appropriate step.
|
|
51
|
+
1. If the step can fail, add instructions on how to fix the issue and `goto` to the appropriate step.
|
|
52
52
|
2. If the step requires both research and implementation, split it into two steps: research step and implementation step.
|
|
53
53
|
3. If the step required editing multiple artifacts (multiple files, multiple functions, etc.), split it into multiple steps, one per change required.
|
|
54
54
|
4. If the step is too big or complex, split it into multiple smaller steps.
|
|
55
55
|
|
|
56
56
|
After all steps are reviewed:
|
|
57
57
|
|
|
58
|
-
1. If the changes
|
|
58
|
+
1. If the changes were introduced, `{{ donna.lib.goto("review_workflow") }}`.
|
|
59
59
|
2. If no changes were introduced, `{{ donna.lib.goto("finish") }}`.
|
|
60
60
|
|
|
61
61
|
## Finish
|
|
@@ -28,11 +28,11 @@ Read the specification `{{ donna.lib.view("donna:usage:cli") }}` to learn how to
|
|
|
28
28
|
|
|
29
29
|
## Source Format and Rendering
|
|
30
30
|
|
|
31
|
-
The source of the text artifact is a Jinja2
|
|
31
|
+
The source of the text artifact is a Jinja2 template of a Markdown document.
|
|
32
32
|
|
|
33
33
|
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.
|
|
34
34
|
|
|
35
|
-
**Artifact source should not use Jinja2
|
|
35
|
+
**Artifact source should not use Jinja2 inheritance features** like `{{ "{% extends %}" }}` and `{{ "{% block %}" }}`.
|
|
36
36
|
|
|
37
37
|
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.
|
|
38
38
|
|
|
@@ -63,11 +63,11 @@ Donna renders the same artifact source into different representations depending
|
|
|
63
63
|
|
|
64
64
|
Technically, any valid Markdown document is a valid text artifact.
|
|
65
65
|
|
|
66
|
-
However, Donna
|
|
66
|
+
However, Donna assigns special meaning to some elements of the Markdown document to provide enhanced behavior and capabilities.
|
|
67
67
|
|
|
68
68
|
### Sections
|
|
69
69
|
|
|
70
|
-
Artifact is
|
|
70
|
+
Artifact is divided into multiple sections:
|
|
71
71
|
|
|
72
72
|
- H1 header and all text till the first H2 header is considered the `head section` of the artifact.
|
|
73
73
|
- Each H2 header and all text till the next H2 header (or end of document) is considered a `tail section` of the artifact.
|
|
@@ -170,7 +170,9 @@ kind = "donna.lib.request_action"
|
|
|
170
170
|
|
|
171
171
|
#### Kinds of Workflow Operations
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
##### `donna.lib.request_action`
|
|
174
|
+
|
|
175
|
+
`donna.lib.request_action` operation kind indicates that Donna will request the agent to perform some action.
|
|
174
176
|
|
|
175
177
|
The content of the tail section is the text instructions for the agent on what to do.
|
|
176
178
|
|
|
@@ -188,7 +190,9 @@ Here may be any additional instructions, requirements, notes, references, etc.
|
|
|
188
190
|
|
|
189
191
|
**The body of the operation MUST contain a neat strictly defined algorithm for the agent to follow.**
|
|
190
192
|
|
|
191
|
-
|
|
193
|
+
##### `donna.lib.run_script`
|
|
194
|
+
|
|
195
|
+
`donna.lib.run_script` operation kind executes a script from the operation body without agent/user interaction.
|
|
192
196
|
|
|
193
197
|
The body of the operation MUST include exactly one fenced code block whose info string includes `<language> donna script`.
|
|
194
198
|
Any other text in the operation body is ignored.
|
|
@@ -229,7 +233,9 @@ Routing rules:
|
|
|
229
233
|
When `save_stdout_to` and/or `save_stderr_to` are set, the operation stores captured output in the task context
|
|
230
234
|
under the specified variable names.
|
|
231
235
|
|
|
232
|
-
|
|
236
|
+
##### `donna.lib.output`
|
|
237
|
+
|
|
238
|
+
`donna.lib.output` operation kind emits its body as an output cell and then continues to the configured next step.
|
|
233
239
|
|
|
234
240
|
The body of the operation is rendered as an output cell during execution.
|
|
235
241
|
|
|
@@ -241,7 +247,9 @@ kind = "donna.lib.output"
|
|
|
241
247
|
next_operation_id = "<next_operation_id>" # required
|
|
242
248
|
```
|
|
243
249
|
|
|
244
|
-
|
|
250
|
+
##### `donna.lib.finish`
|
|
251
|
+
|
|
252
|
+
`donna.lib.finish` operation kind indicates that the workflow is finished.
|
|
245
253
|
|
|
246
254
|
The body of the operation is rendered as an output cell before the workflow completes.
|
|
247
255
|
|
|
@@ -254,6 +262,6 @@ Donna provides multiple directives that MUST be used in the artifact source to e
|
|
|
254
262
|
Here they are:
|
|
255
263
|
|
|
256
264
|
1. `{{ "{{ donna.lib.view(<artifact-id-pattern>) }}" }}` — references another artifact (supports `*` and `**` wildcard patterns). In `view`/`execute` modes it renders an exact CLI command to view the artifact; in `analysis` mode it renders a `$$donna ... $$` marker.
|
|
257
|
-
2. `{{ "{{ donna.lib.list(<artifact-id-pattern>) }}" }}` — references artifact listing by pattern (supports `*` and `**` wildcard patterns). In `view`/`execute` modes it renders an exact CLI command to list artifacts; in `analysis` mode it renders a `$$donna ... $$` marker.
|
|
258
|
-
3. `{{ "{{ 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.
|
|
265
|
+
2. `{{ "{{ donna.lib.list(<artifact-id-pattern>) }}" }}` — references artifact listing by pattern (supports `*` and `**` wildcard patterns). In `view`/`execute` modes it renders an exact CLI command to list artifacts; in `analysis` mode, it renders a `$$donna ... $$` marker.
|
|
266
|
+
3. `{{ "{{ 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.
|
|
259
267
|
4. `{{ "{{ 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.
|
donna/artifacts/usage/cli.md
CHANGED
|
@@ -59,7 +59,7 @@ action_request_id=AR-65-bd
|
|
|
59
59
|
--DONNA-CELL eZVkOwNPTHmadXpaHDUBNA END--
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Donna can
|
|
62
|
+
Donna can omit log cell start and end markers if a command produces only a single cell.
|
|
63
63
|
|
|
64
64
|
Donna renders cells differently, depending on the protocol used.
|
|
65
65
|
|
|
@@ -68,7 +68,7 @@ Donna renders cells differently, depending on the protocol used.
|
|
|
68
68
|
There are three sets of commands:
|
|
69
69
|
|
|
70
70
|
- `donna -p <protocol> workspaces …` — manages workspaces. Most-likely it will be used once per your project to initialize it.
|
|
71
|
-
- `donna -p <protocol> sessions …` — manages sessions. You will use these commands to start, push forward, and manage your work
|
|
71
|
+
- `donna -p <protocol> sessions …` — manages sessions. You will use these commands to start, push forward, and manage your work.
|
|
72
72
|
- `donna -p <protocol> artifacts …` — manages artifacts. You will use these commands to read and update artifacts you are working with.
|
|
73
73
|
|
|
74
74
|
Use:
|
|
@@ -82,31 +82,37 @@ Run `donna -p <protocol> workspaces init [<directory-path>]` to initialize Donna
|
|
|
82
82
|
|
|
83
83
|
It is a one time operation you need to perform once per project to create a place where Donna will store all its data.
|
|
84
84
|
|
|
85
|
-
###
|
|
85
|
+
### Starting sessions
|
|
86
|
+
|
|
87
|
+
The developer is responsible for starting a new session.
|
|
88
|
+
|
|
89
|
+
You are allowed to start a new session in the next cases:
|
|
90
|
+
|
|
91
|
+
1. There is no active session.
|
|
92
|
+
2. The developer explicitly instructed you to start a new session.
|
|
86
93
|
|
|
87
94
|
You start session by calling `donna -p <protocol> sessions start`.
|
|
88
95
|
|
|
89
|
-
|
|
96
|
+
### Session flow
|
|
97
|
+
|
|
98
|
+
After the session starts you MUST follow the next workflow to perform your work:
|
|
90
99
|
|
|
91
100
|
1. List all possible workflows with command `donna -p <protocol> artifacts list`.
|
|
92
101
|
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.
|
|
93
|
-
3. Start
|
|
102
|
+
3. Start chosen workflow by calling `donna -p <protocol> sessions run <workflow-id>`.
|
|
94
103
|
4. Donna will output descriptions of all operations it performs to complete the work.
|
|
95
104
|
5. Donna will output **action requests** that you MUST perform. You MUST follow these instructions precisely.
|
|
96
105
|
6. When you done processing an action request, call `donna -p <protocol> sessions action-request-completed <action-request-id> <next-full-operation-id>` to report request completion. `<next-full-operation-id>` MUST contain full identifier of the next operation, like `<world>:<artifact>:<operation-id>`.
|
|
97
|
-
7. After you complete an action request, Donna will continue workflow execution and
|
|
106
|
+
7. After you complete an action request, Donna will continue workflow execution and output what you need to do next.
|
|
98
107
|
|
|
99
108
|
You MUST continue following Donna's instructions until the workflow is completed.
|
|
100
109
|
|
|
101
110
|
### Session state
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Run `donna -p <protocol> sessions start` to start fully new session. This command resets session state AND removes all session-level artifacts. Use this command when you need to start work from scratch.
|
|
108
|
-
|
|
109
|
-
Run `donna -p <protocol> sessions reset` to reset the current session. This command resets session state BUT keeps all session-level artifacts. Use this command when you need to restart the worklow but keep all the artifacts you created during the session.
|
|
112
|
+
- `donna -p <protocol> sessions status` — get the status of the current session.
|
|
113
|
+
- `donna -p <protocol> sessions details` — get detailed information about the current session, including list of active action requests.
|
|
114
|
+
- `donna -p <protocol> sessions start` — start a new session. This command resets session state AND removes all session-level artifacts.
|
|
115
|
+
- Run `donna -p <protocol> sessions reset` to reset the current session. This command resets session state BUT keeps all session-level artifacts. Use this command when you need to restart the worklow but keep all the artifacts you created during the session.
|
|
110
116
|
|
|
111
117
|
### Starting work
|
|
112
118
|
|
|
@@ -114,8 +120,8 @@ If the developer asked you to do something new:
|
|
|
114
120
|
|
|
115
121
|
- Run `donna -p <protocol> sessions status` to get the status of the current session.
|
|
116
122
|
- If there is no active session, start a new session by calling `donna -p <protocol> sessions start`.
|
|
117
|
-
- If the session is
|
|
118
|
-
- If the session is
|
|
123
|
+
- If the session is 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.
|
|
124
|
+
- If the session is active and there are no unfinished work in it, follow the instructions in the `Session flow` section to choose and start a new workflow.
|
|
119
125
|
|
|
120
126
|
### Continuing work
|
|
121
127
|
|
|
@@ -127,11 +133,11 @@ If Donna tells you there is no work left, you MUST inform the developer that the
|
|
|
127
133
|
|
|
128
134
|
An artifact is a markdown document with extra metadata stored in one of the Donna's worlds.
|
|
129
135
|
|
|
130
|
-
Use the next commands to work with artifacts
|
|
136
|
+
Use the next commands to work with artifacts:
|
|
131
137
|
|
|
132
138
|
- `donna -p <protocol> artifacts list [<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.
|
|
133
139
|
- `donna -p <protocol> artifacts view <artifact-pattern>` — get the meaningful (rendered) content of all matching artifacts. This command shows the rendered information about each artifact. Use this command when you need to read artifact content.
|
|
134
|
-
- `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.
|
|
140
|
+
- `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.
|
|
135
141
|
- `donna -p <protocol> artifacts tmp <slug>.<extension>` — create a temporary file for artifact-related work and output its path.
|
|
136
142
|
- `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.
|
|
137
143
|
- `donna -p <protocol> artifacts copy <artifact-id-from> <artifact-id-to>` — copy an artifact source to another artifact ID (can be in a different world). This overwrites the destination if it exists.
|
donna/cli/commands/sessions.py
CHANGED
|
@@ -54,7 +54,7 @@ def details() -> Iterable[Cell]:
|
|
|
54
54
|
return sessions.details()
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
@sessions_cli.command(help="Run a workflow
|
|
57
|
+
@sessions_cli.command(help="Run a workflow from an artifact to drive the current session forward.")
|
|
58
58
|
@cells_cli
|
|
59
59
|
def run(workflow_id: FullArtifactIdArgument) -> Iterable[Cell]:
|
|
60
60
|
return sessions.start_workflow(workflow_id)
|
donna/machine/primitives.py
CHANGED
|
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|
|
20
20
|
from donna.workspaces.worlds.base import World
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
# TODO: Currently
|
|
23
|
+
# TODO: Currently it is a kind of God interface. It is convenient for now.
|
|
24
24
|
# However, in future we should move these methods into specific subclasses.
|
|
25
25
|
class Primitive(BaseEntity):
|
|
26
26
|
config_class: ClassVar[type[ArtifactSectionConfig]] = ArtifactSectionConfig
|
donna/machine/sessions.py
CHANGED
|
@@ -47,7 +47,7 @@ def _save_state(state: ConsistentState) -> Result[None, ErrorsList]:
|
|
|
47
47
|
@unwrap_to_error
|
|
48
48
|
def _state_run(mutator: MutableState) -> Result[None, ErrorsList]:
|
|
49
49
|
while mutator.has_work():
|
|
50
|
-
mutator.
|
|
50
|
+
mutator.execute_next_work_unit().unwrap()
|
|
51
51
|
_save_state(mutator.freeze()).unwrap()
|
|
52
52
|
|
|
53
53
|
return Ok(None)
|
donna/machine/state.py
CHANGED
|
@@ -160,7 +160,7 @@ class MutableState(BaseState):
|
|
|
160
160
|
self.apply_changes(changes)
|
|
161
161
|
|
|
162
162
|
@unwrap_to_error
|
|
163
|
-
def
|
|
163
|
+
def execute_next_work_unit(self) -> Result[None, ErrorsList]:
|
|
164
164
|
next_work_unit = self.get_next_work_unit()
|
|
165
165
|
assert next_work_unit is not None
|
|
166
166
|
|
|
@@ -190,7 +190,7 @@ class StateNode(Node):
|
|
|
190
190
|
"""
|
|
191
191
|
The session is IDLE. There are no active tasks.
|
|
192
192
|
|
|
193
|
-
- If the developer asked you to start working on a new task, you can do so by
|
|
193
|
+
- If the developer asked you to start working on a new task, you can do so by running a new workflow.
|
|
194
194
|
- If you have been working on a task, consider it completed and REPORT THE RESULTS TO THE DEVELOPER.
|
|
195
195
|
"""
|
|
196
196
|
)
|