donna 0.2.0__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.
Files changed (70) hide show
  1. donna/artifacts/intro.md +39 -0
  2. donna/artifacts/research/specs/report.md +163 -0
  3. donna/artifacts/research/work/research.md +198 -0
  4. donna/artifacts/rfc/specs/request_for_change.md +270 -0
  5. donna/artifacts/rfc/work/create.md +120 -0
  6. donna/artifacts/rfc/work/do.md +109 -0
  7. donna/artifacts/rfc/work/plan.md +68 -0
  8. donna/artifacts/usage/artifacts.md +55 -12
  9. donna/artifacts/usage/cli.md +114 -39
  10. donna/artifacts/usage/worlds.md +8 -2
  11. donna/cli/__main__.py +1 -1
  12. donna/cli/commands/artifacts.py +104 -17
  13. donna/cli/commands/sessions.py +8 -8
  14. donna/cli/commands/workspaces.py +42 -0
  15. donna/cli/errors.py +18 -0
  16. donna/cli/types.py +16 -9
  17. donna/cli/utils.py +2 -2
  18. donna/core/errors.py +1 -11
  19. donna/core/result.py +5 -8
  20. donna/core/utils.py +0 -3
  21. donna/lib/__init__.py +4 -0
  22. donna/lib/sources.py +1 -1
  23. donna/lib/worlds.py +2 -2
  24. donna/machine/action_requests.py +0 -5
  25. donna/machine/artifacts.py +8 -6
  26. donna/machine/primitives.py +5 -5
  27. donna/machine/sessions.py +13 -5
  28. donna/machine/state.py +4 -4
  29. donna/machine/tasks.py +4 -18
  30. donna/machine/templates.py +4 -2
  31. donna/primitives/artifacts/specification.py +13 -2
  32. donna/primitives/artifacts/workflow.py +11 -2
  33. donna/primitives/directives/list.py +86 -0
  34. donna/primitives/directives/view.py +52 -11
  35. donna/primitives/operations/finish_workflow.py +13 -2
  36. donna/primitives/operations/output.py +87 -0
  37. donna/primitives/operations/request_action.py +3 -9
  38. donna/primitives/operations/run_script.py +2 -2
  39. donna/protocol/utils.py +22 -0
  40. donna/workspaces/artifacts.py +238 -0
  41. donna/{world → workspaces}/artifacts_discovery.py +1 -1
  42. donna/{world → workspaces}/config.py +18 -11
  43. donna/{world → workspaces}/errors.py +55 -45
  44. donna/workspaces/initialization.py +78 -0
  45. donna/{world → workspaces}/markdown.py +21 -26
  46. donna/{world → workspaces}/sources/base.py +2 -2
  47. donna/{world → workspaces}/sources/markdown.py +8 -7
  48. donna/{world → workspaces}/templates.py +4 -4
  49. donna/workspaces/tmp.py +51 -0
  50. donna/{world → workspaces}/worlds/base.py +6 -3
  51. donna/{world → workspaces}/worlds/filesystem.py +30 -10
  52. donna/{world → workspaces}/worlds/python.py +12 -9
  53. donna-0.2.2.dist-info/METADATA +463 -0
  54. donna-0.2.2.dist-info/RECORD +92 -0
  55. {donna-0.2.0.dist-info → donna-0.2.2.dist-info}/WHEEL +1 -1
  56. donna/artifacts/work/do_it.md +0 -142
  57. donna/artifacts/work/do_it_fast.md +0 -98
  58. donna/artifacts/work/planning.md +0 -245
  59. donna/cli/commands/projects.py +0 -49
  60. donna/world/artifacts.py +0 -122
  61. donna/world/initialization.py +0 -42
  62. donna/world/tmp.py +0 -33
  63. donna/world/worlds/__init__.py +0 -0
  64. donna-0.2.0.dist-info/METADATA +0 -44
  65. donna-0.2.0.dist-info/RECORD +0 -85
  66. /donna/{artifacts/work → workspaces}/__init__.py +0 -0
  67. /donna/{world → workspaces}/sources/__init__.py +0 -0
  68. /donna/{world → workspaces/worlds}/__init__.py +0 -0
  69. {donna-0.2.0.dist-info → donna-0.2.2.dist-info}/entry_points.txt +0 -0
  70. {donna-0.2.0.dist-info → donna-0.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,39 @@
1
+ # Introduction to the Donna tool
2
+
3
+ ```toml donna
4
+ kind = "donna.lib.specification"
5
+ ```
6
+ This document provides an introduction to the Donna — a CLI tool that helps manage the work of AI agents like Codex.
7
+
8
+ ## Overview
9
+
10
+ Donna is designed to to invert control flow: instead of agents deciding what to do next, the `donna` tells agents what to do next by following predefined workflows.
11
+
12
+ The core idea is that most of 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:
13
+
14
+ 1. Ensure all tests pass.
15
+ 2. Ensure the code is formatted correctly.
16
+ 3. Ensure there are no linting errors.
17
+ 4. Go to the step 1 if you changed something in the process.
18
+ 5. Finish.
19
+
20
+ We may need coding agents on the each step of the process, but there no reason for agents to manage the whole grooming loop by themselves — it take longer time, spends tokens and may lead to confusion of agents.
21
+
22
+ ## Artifact Tags
23
+
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
+
26
+ Artifact type tags:
27
+
28
+ - `workflow` — workflow artifact — is set automatically by Donna.
29
+ - `specification` — specification artifact — is set automatically by Donna.
30
+
31
+ {# We recommend using those tags in `project:` and `session:` worlds as well to keep consistency. #}
32
+
33
+ ## Instructions
34
+
35
+ 1. On start of the YOUR session you **MUST** read and understand instruction on using the Donna tool `{{ donna.lib.view("donna:usage:cli") }}`. It **MUST** be a one time operation. Do not repeat it unless you forget how to use the tool.
36
+ 2. If you need to perform a work with Donna, you **MUST** select an appropriate Donna workflow to perform the work and run it.
37
+ 3. If there is no appropriate workflow, ask the developer for a precise instructions on what to do.
38
+ 4. List all workflows: `{{ donna.lib.list("**", tags=["workflow"]) }}`
39
+ 5. List all specifications: `{{ donna.lib.list("**", tags=["specification"]) }}`
@@ -0,0 +1,163 @@
1
+ # Format of the Research Report document
2
+
3
+ ```toml donna
4
+ kind = "donna.lib.specification"
5
+ ```
6
+
7
+ This document describes the format and structure of a Research Report document used by Donna workflows from `donna:research:*` namespace.
8
+
9
+ ## Overview
10
+
11
+ Donna introduces a group of workflows located in `donna:research:*` namespace that organize the process of researching a problem, collecting information, analyzing it, synthesizing options, and producing a final solution.
12
+
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
+
15
+ The agent (via workflows) creates the artifact and updates it iteratively as the research process progresses.
16
+
17
+ ## Research report structure
18
+
19
+ The research report is a Donna artifact (check `{{ donna.lib.view("donna:usage:artifacts") }}`) with the next structure:
20
+
21
+ - **Primary section** -- title and short description of the research problem.
22
+ - **Original problem description** -- original problem statement from the developer or parent workflow.
23
+ - **Formalized problem description** -- formalized version of the problem statement.
24
+ - **Goals** -- list of goals the research should achieve.
25
+ - **Desired form of final solution** -- description of the expected form and constraints for the final solution.
26
+ - **Solution space** -- description of analysis axes and synthesis dimensions.
27
+ - **Information to collect** -- list of information required to research the problem.
28
+ - **Information sources** -- list of sources that can provide the required information.
29
+ - **Collected information** -- gathered information with source references.
30
+ - **Analysis** -- analysis of collected information along the specified axes.
31
+ - **Synthesized solutions** -- synthesized solution options along the specified dimensions.
32
+ - **Evaluation** -- evaluation of synthesized solutions against the goals.
33
+ - **Final solution** -- final solution in the desired form.
34
+
35
+ ## General language and format
36
+
37
+ - You MUST follow [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119.txt) for keywords like MUST, SHOULD, MAY, etc.
38
+ - You MUST follow `{{ donna.lib.view("donna:usage:artifacts") }}`.
39
+ - You MUST follow the structure specified in this document.
40
+
41
+ ### List format
42
+
43
+ - If a section is described as a list, it MUST contain only a single markdown list.
44
+ - Each list item MUST be concise and clear.
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 the resulting artifacts and behavior.
47
+
48
+ Common approaches to improve list items:
49
+
50
+ - Split a single item with an enumeration into multiple items with a single focus.
51
+ - Transform an abstract item into a concrete one by referencing specific artifacts, measurable criteria, verifiable conditions, etc.
52
+
53
+ ### Trusted inputs
54
+
55
+ Some sections of the research report MUST be based on trusted inputs. Trusted inputs are:
56
+
57
+ - Original problem description from the developer or parent workflow.
58
+ - Statements from the research report itself.
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 they describe constraints or best practices.
62
+ - Primary research sources (datasets, reports, official publications) were used to collect the required information.
63
+
64
+ ## `Primary` section
65
+
66
+ - Title MUST be concise and reflect the essence of the research problem.
67
+ - Description MUST provide a brief overview of the problem, its purpose, and why research is needed.
68
+
69
+ ## `Original problem description` section
70
+
71
+ - This section MUST contain the original problem description from the developer or from the parent workflow.
72
+ - The problem description MUST NOT be modified by agents.
73
+
74
+ ## `Formalized problem description` section
75
+
76
+ - The section MUST contain a clear professional high-level description of the problem based on the original description.
77
+ - The section MUST be limited to a single paragraph with a few sentences.
78
+ - The section MUST explain what someone gains after the problem is solved and how they can see it working.
79
+
80
+ ## `Goals` section
81
+
82
+ - This section MUST contain a list of goals that the research should achieve.
83
+ - Each goal MUST be grounded in the formalized problem description.
84
+
85
+ Goal quality criteria:
86
+
87
+ - A goal MUST be a desired end state, outcome, or result.
88
+ - A goal MUST define what ultimately should be true, not how to achieve it.
89
+
90
+ Examples:
91
+
92
+ - Bad: `- Investigate database options.`
93
+ - Good: `- Identify a database option that meets the project's scalability requirements.`
94
+
95
+ ## `Desired form of final solution` section
96
+
97
+ - The section MUST be grounded in the formalized problem description and the goals.
98
+ - The section MUST describe the expected form of the final solution (for example: recommendation, decision matrix, implementation plan, or specification).
99
+ - The section MUST specify any required structure, formatting, or constraints on the final solution.
100
+ - The section SHOULD be a short list or a short paragraph, whichever is clearer for the problem.
101
+
102
+ ## `Solution space` section
103
+
104
+ - The section MUST describe the axes along which collected information will be analyzed and the dimensions along which solutions will be synthesized.
105
+ - The section MUST contain two subsections: **Analysis axes** and **Synthesis dimensions**.
106
+ - Each axis or dimension MUST be grounded in the goals or the formalized problem description.
107
+
108
+ ### `Analysis axes` subsection
109
+
110
+ - The subsection MUST contain a list of analysis axes.
111
+ - Each axis MUST describe a single perspective or criterion used to analyze information.
112
+ - Each axis SHOULD be phrased so it is clear how to apply it to collected information.
113
+
114
+ ### `Synthesis dimensions` subsection
115
+
116
+ - The subsection MUST contain a list of synthesis dimensions.
117
+ - Each dimension MUST describe a single perspective or criterion used to synthesize solution options.
118
+ - Each dimension SHOULD make the comparison between options easier.
119
+
120
+ ## `Information to collect` section
121
+
122
+ - The section MUST contain a list of information items required to research the problem.
123
+ - Each item MUST be specific enough to be collected or verified from sources.
124
+ - Each item MUST be grounded in the formalized problem description or the goals.
125
+
126
+ ## `Information sources` section
127
+
128
+ - The section MUST contain a list of sources that can provide the required information.
129
+ - Each source entry MUST include a short identifier and a brief description of the source.
130
+ - Each source entry SHOULD include access method, scope, and reliability notes if relevant.
131
+ - Each source MUST be relevant to at least one item from **Information to collect**.
132
+
133
+ ## `Collected information` section
134
+
135
+ - The section MUST contain the collected information mapped to the items from **Information to collect**.
136
+ - Each collected information item MUST reference one or more source identifiers from **Information sources**.
137
+ - The section MUST make it clear which information items are satisfied and which are missing.
138
+ - If a required information item cannot be collected, the section MUST state that explicitly and explain why.
139
+
140
+ ## `Analysis` section
141
+
142
+ - The section MUST analyze the collected information along the **Analysis axes**.
143
+ - The analysis MUST be organized so each axis can be reviewed independently.
144
+ - The analysis MUST clearly separate observed facts from inferences or assumptions.
145
+ - The analysis format MUST fit the **Desired form of final solution** and should make downstream synthesis straightforward.
146
+
147
+ ## `Synthesized solutions` section
148
+
149
+ - The section MUST present synthesized solutions or options in a format consistent with the **Synthesis dimensions**.
150
+ - Each solution SHOULD reference the analysis items that justify it.
151
+ - The synthesis format MUST fit the **Desired form of final solution**.
152
+
153
+ ## `Evaluation` section
154
+
155
+ - The section MUST evaluate each synthesized solution against the **Goals**.
156
+ - The evaluation MUST make trade-offs explicit and identify risks or uncertainties.
157
+ - The evaluation MUST result in a clear comparison between solutions.
158
+
159
+ ## `Final solution` section
160
+
161
+ - The section MUST present the final solution in the form specified in **Desired form of final solution**.
162
+ - The final solution MUST be justified by the evaluation results.
163
+ - If the evaluation does not allow a confident final solution, the section MUST state the remaining uncertainties and what additional information would resolve them.
@@ -0,0 +1,198 @@
1
+ # Research workflow
2
+
3
+ ```toml donna
4
+ kind = "donna.lib.workflow"
5
+ start_operation_id = "start"
6
+ ```
7
+
8
+ Workflow for performing research on a given question/problem/situation. Collects relevant information, analyzes it, synthesizes possible options, and produces an answer/solution/deliverables.
9
+
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
+
12
+ - When the developer explicitly asks to conduct research.
13
+ - When other workflows need to perform research as a subtask.
14
+
15
+ ## Start
16
+
17
+ ```toml donna
18
+ id = "start"
19
+ kind = "donna.lib.request_action"
20
+ fsm_mode = "start"
21
+ ```
22
+
23
+ 1. Read the specification `{{ donna.lib.view("donna:usage:artifacts") }}` if you haven't done it yet.
24
+ 2. Read the specification `{{ donna.lib.view("donna:research:specs:report") }}` if you haven't done it yet.
25
+ 3. `{{ donna.lib.goto("ensure_problem_description_exists") }}`
26
+
27
+ ## Ensure problem description exists
28
+
29
+ ```toml donna
30
+ id = "ensure_problem_description_exists"
31
+ kind = "donna.lib.request_action"
32
+ ```
33
+
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
+
36
+ 1. If you have a problem description in your context, `{{ donna.lib.goto("prepare_artifact") }}`.
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") }}`.
38
+ 3. If you have no problem description in your context, and you don't know where it is, ask the developer to provide it. After you get the problem description, `{{ donna.lib.goto("prepare_artifact") }}`.
39
+
40
+ ## Prepare research artifact
41
+
42
+ ```toml donna
43
+ id = "prepare_artifact"
44
+ kind = "donna.lib.request_action"
45
+ ```
46
+
47
+ 1. Based on the problem description you have, suggest an artifact name in the format `session:research:<short-problem-related-identifier>`. `<short-problem-related-identifier>` MUST be unique within the session.
48
+ {# TODO: we can add donna.lib.list('session:*') here as the command to list all artifacts in session #}
49
+ 2. Create the artifact and specify an original problem description in it.
50
+ 3. `{{ donna.lib.goto("formalize_research") }}`
51
+
52
+ ## Formalize Research
53
+
54
+ ```toml donna
55
+ id = "formalize_research"
56
+ kind = "donna.lib.request_action"
57
+ ```
58
+
59
+ 1. Using your knowledge about the project and the original problem description, formulate a format description of the problem
60
+ 2. Update the artifact with the formalized problem description.
61
+ 3. `{{ donna.lib.goto("set_primary_section_of_the_research_artifact") }}`
62
+
63
+ ## Set primary section of the research artifact
64
+
65
+ ```toml donna
66
+ id = "set_primary_section_of_the_research_artifact"
67
+ kind = "donna.lib.request_action"
68
+ ```
69
+
70
+ 1. Based on the formalized problem description, update the primary (h1) section of the research artifact to reflect the problem being researched. So the agents can effectively find and understand the research artifact using Donna.
71
+ 2. `{{ donna.lib.goto("formulate_goals") }}`
72
+
73
+ ## Formulate Goals
74
+
75
+ ```toml donna
76
+ id = "formulate_goals"
77
+ kind = "donna.lib.request_action"
78
+ ```
79
+
80
+ 1. Based on the formalized problem description, formulate a list of goals that the problem solution should achieve.
81
+ 2. Update the artifact with the list of goals.
82
+ 3. `{{ donna.lib.goto("fomalize_form_of_final_solution") }}`
83
+
84
+ ## Formalize form of final solution
85
+
86
+ ```toml donna
87
+ id = "fomalize_form_of_final_solution"
88
+ kind = "donna.lib.request_action"
89
+ ```
90
+
91
+ 1. Based on the formalized problem description and the list of goals, formulate the desired form of the final solution.
92
+ 2. Update the artifact with the desired form of the final solution.
93
+ 3. `{{ donna.lib.goto("describe_solution_space") }}`
94
+
95
+ ## Describe solution space
96
+
97
+ ```toml donna
98
+ id = "describe_solution_space"
99
+ kind = "donna.lib.request_action"
100
+ ```
101
+
102
+ To produce a solution, we should understand how to analyze the data and how to synthesize results into the final solution.
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.
105
+
106
+ 1. List the analysis axes.
107
+ 2. List the synthesis dimensions.
108
+ 3. Update the artifact with the description of the solution space.
109
+ 4. `{{ donna.lib.goto("describe_information_to_collect") }}`
110
+
111
+ ## Describe information to collect
112
+
113
+ ```toml donna
114
+ id = "describe_information_to_collect"
115
+ kind = "donna.lib.request_action"
116
+ ```
117
+
118
+ 1. Based on the formalized problem description and the list of goals, list the information to be collected to research the problem.
119
+ 2. Update the artifact with the description of the information to collect.
120
+ 3. `{{ donna.lib.goto("list_information_sources") }}`
121
+
122
+ ## List information sources
123
+
124
+ ```toml donna
125
+ id = "list_information_sources"
126
+ kind = "donna.lib.request_action"
127
+ ```
128
+
129
+ 1. Based on the formalized problem description and the list of goals, formulate a list of information sources that can help to research the problem.
130
+ 2. Update the artifact with the list of information sources.
131
+ 3. `{{ donna.lib.goto("collect_information") }}`
132
+
133
+ ## Collect information
134
+
135
+ ```toml donna
136
+ id = "collect_information"
137
+ kind = "donna.lib.request_action"
138
+ ```
139
+
140
+ 1. For each information source from the list:
141
+ 1. For each piece of required information from the description:
142
+ 1. If the source can not provide this piece of information, skip it.
143
+ 2. Access the source and collect the required information.
144
+ 3. Update the artifact with the collected information.
145
+ 2. `{{ donna.lib.goto("analyze_information") }}`
146
+
147
+ ## Analyze information
148
+
149
+ ```toml donna
150
+ id = "analyze_information"
151
+ kind = "donna.lib.request_action"
152
+ ```
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 required solution form.
155
+ 2. Update the artifact with the analysis results.
156
+ 3. `{{ donna.lib.goto("synthesize_solutions") }}`
157
+
158
+ ## Synthesize solutions
159
+
160
+ ```toml donna
161
+ id = "synthesize_solutions"
162
+ kind = "donna.lib.request_action"
163
+ ```
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 required solution form.
166
+ 2. Update the artifact with the synthesized solutions.
167
+ 3. `{{ donna.lib.goto("evaluate_solutions") }}`
168
+
169
+ ## Evaluate solutions
170
+
171
+ ```toml donna
172
+ id = "evaluate_solutions"
173
+ kind = "donna.lib.request_action"
174
+ ```
175
+
176
+ 1. Evaluate the synthesized solutions against the goals from the formalized problem description.
177
+ 2. Update the artifact with the evaluation results.
178
+ 3. `{{ donna.lib.goto("produce_final_solution") }}`
179
+
180
+ ## Produce final solution
181
+
182
+ ```toml donna
183
+ id = "produce_final_solution"
184
+ kind = "donna.lib.request_action"
185
+ ```
186
+
187
+ 1. Based on the evaluation results, produce the final solution in the desired form.
188
+ 2. Update the artifact with the final solution.
189
+ 3. `{{ donna.lib.goto("finish") }}`
190
+
191
+ ## Finish
192
+
193
+ ```toml donna
194
+ id = "finish"
195
+ kind = "donna.lib.finish"
196
+ ```
197
+
198
+ Research workflow completed. Provide the final research output to the developer.
@@ -0,0 +1,270 @@
1
+ # Format of the Request for Change document
2
+
3
+ ```toml donna
4
+ kind = "donna.lib.specification"
5
+ ```
6
+
7
+ This document describes the format and structure of a Request for Change (RFC) document used to propose changes to a project by Donna workflows from `donna:rfc:*` namespace.
8
+
9
+ ## Overview
10
+
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
+
13
+ You create RFC documents to propose changes to the project.
14
+
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
+
17
+ The agent (via workflows) creates the artifact and polishes it iteratively as the RFC process progresses.
18
+
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
+
21
+ ## RFC structure
22
+
23
+ The RFC document is Donna artifact (check `{{ donna.lib.view("donna:usage:artifacts") }}`) with the next structure:
24
+
25
+ - **Primary section** — title and short description of the proposed change.
26
+ - **Original description** — original description of the requested changes from the developer or parent workflow.
27
+ - **Formal description** — formal description of the requested changes.
28
+ - **Goals** — list of goals that the proposed change aims to achieve.
29
+ - **Objectives** — list of objectives that need to be accomplished to achieve the goals.
30
+ - **Constraints** — list of constraints that must be considered while implementing the proposed change.
31
+ - **Requirements** — list of requirements that the proposed change must fulfill.
32
+ - **Acceptance criteria** — list of criteria that define when the proposed change is considered complete and successful.
33
+ - **Solution** — list of statements about how the final result should look like.
34
+ - **Verification** — list of statements about how to verify each objective, constraint, requirement, and acceptance criterion.
35
+ - **Deliverables** — list of deliverables that should be produced as part of the proposed change.
36
+ - **Action items** — unordered list of atomic actions/changes that must be performed to implement the proposed change.
37
+
38
+ ## General language and format
39
+
40
+ - You MUST follow [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119.txt) for keywords like MUST, SHOULD, MAY, etc.
41
+ - You MUST follow `{{ donna.lib.view("donna:usage:artifacts") }}`.
42
+ - You MUST follow the structure specified in this document.
43
+
44
+ ### List format
45
+
46
+ - If a section is described as a list, it MUST contain only a single markdown list.
47
+ - Each list item MUST be concise and clear.
48
+ - Each list item SHOULD be atomic and focused on a single aspect.
49
+ - Reviewer MUST be able to tell whether the list item statement is true or false by inspecting the resulting artifacts and behavior.
50
+
51
+ Examples:
52
+
53
+ - Bad: `- Improve performance and fix bugs.`
54
+ - Bad: `- The interface MUST include button A, button B, and dropdown C.`
55
+ - Good: `- Performance test MUST show at least 20% improvement in response time under load.`
56
+ - Good: `- Fix bug A causing a crash when input is empty.`
57
+ - Good: `- The interface MUST include button A that triggers action X.`
58
+ - Good: `- The interface MUST include button B that triggers action Y.`
59
+
60
+ Common approaches to improve list items:
61
+
62
+ - Split a single item with an enumeration into multiple items with a single focus.
63
+ - Transform an abstract item into a concrete one by specifying measurable criteria or user-visible behavior.
64
+
65
+ ### Trusted inputs
66
+
67
+ Some sections of the RFC document MUST be based on trusted inputs. Trusted inputs are:
68
+
69
+ - Original description from the developer or parent workflow.
70
+ - Statements from the RFC document itself.
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 they describe constraints or best practices.
74
+
75
+ ## `Primary` section
76
+
77
+ - Title MUST be concise and reflect the essence of the proposed change.
78
+ - Description MUST provide a brief overview of the proposed change, its purpose, and its expected impact.
79
+
80
+ ## `Original description` section
81
+
82
+ - This section MUST contain the original request from the developer or from the parent workflow.
83
+ - The request MUST NOT be modified by agents.
84
+
85
+ ## `Formal description` section
86
+
87
+ - The section MUST contain a clear professional high-level description of the work to be done based on the developer's request.
88
+ - The section MUST be limited to a single paragraph with a few sentences.
89
+ - The section MUST explain what someone gains after these changes and how they can see it working.
90
+ State the user-visible behavior the change will enable.
91
+
92
+ ## `Goals` section
93
+
94
+ - This section MUST contain a list of goals that the proposed change aims to achieve.
95
+
96
+ The goal quality criteria:
97
+
98
+ - A goal MUST be a desired end state, outcome, or result.
99
+ - A goal MUST define what ultimately should be true, not how to achieve it.
100
+
101
+ Examples:
102
+
103
+ - Bad: `- Implement authentication system.`
104
+ - Good: `- Protect user data from unauthorized access.`
105
+
106
+ ## `Objectives` section
107
+
108
+ - The section MUST contain a list of objectives that need to be completed to achieve the goals.
109
+ - Each goal MUST have a set of objectives that, when all achieved, ensure the goal is met.
110
+ - Each goal MUST have 2–6 objectives, unless the goal is demonstrably trivial (≤1 artifact, no dependencies).
111
+
112
+ Objective quality criteria:
113
+
114
+ - An objective MUST be a specific, measurable condition that must be true for a goal to be satisfied.
115
+ - An objective MUST describe an achieved state, capability, artifact, or behavior.
116
+
117
+ Examples:
118
+
119
+ - Bad: `- Create user authentication and authorization system.`
120
+ - Bad: `- Design user authentication flow.`
121
+ - Good: `- Specification for user authentication flow exists.`
122
+ - Good: `- User is able to log in using email and password.`
123
+
124
+ ## `Constraints` section
125
+
126
+ - The section MUST contain a list of constraints that the changes MUST respect.
127
+ - The section MAY be empty only if no constraints are explicitly known.
128
+ - A constraint MUST be derived from trusted inputs. Agents MUST NOT invent constraints.
129
+
130
+ Constraint quality criteria:
131
+
132
+ - A constraint MUST be a hard limit on the solution space.
133
+ - A constraint MUST be externally imposed by technology, policy, compatibility, time, budget, etc.
134
+ - A constraint MUST NOT describe desired behavior or outcomes.
135
+ - A constraint MUST be non-negotiable within the scope of the RFC.
136
+
137
+ Examples:
138
+
139
+ - Bad: `- The system should be easy to maintain.`
140
+ - Bad: `- Use clean architecture.`
141
+ - Good: `- The solution MUST be compatible with Python 3.12.`
142
+ - Good: `- The solution MUST NOT introduce new runtime dependencies.`
143
+ - Good: `- The solution MUST follow the specification project:specs:abc`
144
+ - Good: `MUST not change public CLI flags`
145
+
146
+ ## `Requirements` section
147
+
148
+ - The section MUST contain a list of requirements that the proposed change MUST fulfill.
149
+
150
+ Requirement quality criteria:
151
+
152
+ - A requirement MUST be a single atomic condition, capability, or feature that the system MUST meet, provide, or exhibit after the change is implemented.
153
+ - A requirement MUST be directly testable.
154
+ - A requirement MUST be stated independently of implementation details.
155
+ - A requirement MUST NOT restate goals or objectives verbatim.
156
+
157
+ Examples:
158
+
159
+ - Bad: `- Improve security.`
160
+ - Bad: `- Implement OAuth.`
161
+ - Good: `- The system MUST reject authentication attempts with invalid credentials.`
162
+ - Good: `- The system MUST log all failed authentication attempts with timestamp and user identifier.`
163
+
164
+ ## `Acceptance criteria` section
165
+
166
+ - The section MUST contain a list of acceptance criteria used to determine whether the proposed change is complete and successful.
167
+ - An acceptance criterion MUST be derived explicitly from statements in the RFC document. Agents MUST NOT invent acceptance criteria.
168
+
169
+ Acceptance criteria quality criteria:
170
+
171
+ - An acceptance criterion MUST be a single atomic check that results in a pass/fail outcome.
172
+ - An acceptance criterion check MUST be about a single artifact: a single file exists, a single test passes, a single behavior observed, etc.
173
+ - An acceptance criterion MUST NOT describe implementation steps, internal design decisions, or "how" to achieve the result.
174
+
175
+ Examples:
176
+
177
+ - Bad: `- All requirements are implemented.`
178
+ - Bad: `- The feature works as expected.`
179
+ - Good: `- The artifact with documentation for X exists.`
180
+ - Good: `- The autotest for requirement Y exists.`
181
+ - Good: `- All autotests pass without errors.`
182
+ - Good: `- The tool can run on Python 3.12 without errors.`
183
+
184
+ ## `Solution` section
185
+
186
+ - The section MUST contain a list of statements describing how the system should look like/behave after the proposed changes are implemented.
187
+ - The section MUST NOT establish an order of implementation steps.
188
+ - The full solution MUST ensure the truth/validity of all statements in the RFC.
189
+
190
+ Solution statement quality criteria:
191
+
192
+ - A solution statement MUST be a specific change in a specific artifact, behavior, or capability.
193
+ - A solution statement MUST NOT prescribe implementation steps.
194
+ - A solution statement SHOULD be phrased in the present tense, describing an achieved state.
195
+
196
+ Examples:
197
+
198
+ - Bad: `- First implement the database schema, then add API endpoints.`
199
+ - Bad: `- Use framework X to handle authentication.`
200
+ - Good: `- The system exposes an authentication API that accepts credentials and returns an access token on success.`
201
+ - Good: `- User-facing documentation describes how to configure and use the authentication feature.`
202
+
203
+ ## `Verification` section
204
+
205
+ - The section MUST contain a list of checks that MUST be passed to prove that the work is complete and correct.
206
+ - Each verification statement MUST map to a single item from **Objectives**, **Constraints**, **Requirements**, or **Acceptance criteria**.
207
+ - Each **Objective**, **Constraint**, **Requirement**, or **Acceptance criterion** MUST map to a single verification statement.
208
+ - Each verification statement MUST describe *how* the corresponding item can be verified.
209
+
210
+ Verification quality criteria:
211
+
212
+ - A verification statement MUST be a concrete verification step or check.
213
+ - A verification statement MUST be automatable if it is possible.
214
+ - A verification statement SHOULD be verifiable by agents without human intervention.
215
+ - A verification statement MUST result in a boolean outcome (verified / not verified).
216
+ - A verification statement MUST reference specific artifacts, commands, tests, or observable behavior.
217
+
218
+ Examples:
219
+
220
+ - Bad: `- Verify that authentication works correctly.`
221
+ - Bad: `- Review the implementation manually.`
222
+ - Good: `- Run test suite `tests/auth/test_login.py`; all tests MUST pass.`
223
+ - Good: `- Inspect artifact `project:specs:authenticationd`; it MUST exist and contain section "Login flow".`
224
+ - Good: `- Execute CLI command `tool login` with invalid credentials; command MUST exit with non-zero code.`
225
+
226
+ ## `Deliverables` section
227
+
228
+ - The section MUST contain a list of concrete artifacts that MUST exist after the changes are implemented.
229
+ - A deliverable MUST be derived from trusted inputs. Agents MUST NOT invent deliverables.
230
+
231
+ Deliverable quality criteria:
232
+
233
+ - A deliverable MUST be a tangible, single artifact or a single part of an artifact, not an activity or process.
234
+ - A deliverable MUST be independently identifiable and verifiable.
235
+ - Each deliverable MUST be phrased as an existence statement using normative
236
+ language: "MUST include …", "MUST exist …", etc.
237
+ - Explicitly add source files as deliverables only when the task is specifically
238
+ about creating or modifying those files (e.g., "MUST add docs/cli.md …").
239
+
240
+ Examples:
241
+
242
+ - Bad: `- Implement authentication code`
243
+ - Bad: `- Refactor auth module.`
244
+ - Good: `- Module app/auth/authentication.py exists.`
245
+ - Good: `- Donna artifact project:specs:authentication exists.`
246
+ - Good: `- Test suite tests/auth/ exists.`
247
+
248
+ ## `Action items` section
249
+
250
+ - The section MUST contain an unordered list of atomic actions.
251
+
252
+ Action item quality criteria:
253
+
254
+ - An action item MUST be a single change that can be applied or executed.
255
+ - An action item MUST be small enough to be completed without further decomposition.
256
+ - An action item MUST be phrased as an imperative sentence.
257
+ - An action item MUST affect a specific artifact, file, config, etc.
258
+ - An action item MUST reference concrete paths, identifiers, or commands.
259
+ - An action item MUST be actionable by an agent.
260
+
261
+ Examples:
262
+
263
+ - Bad: `- Work on authentication.`
264
+ - Bad: `- Improve security everywhere.`
265
+ - Bad: `- Fix the bugs A`
266
+ - Good: `- Create an artifact project:specs:authentication with sections "Login flow" and "Token lifecycle".`
267
+ - Good: `- Add test file tests/auth/test_login.py covering invalid credential cases.`
268
+ - Good: `- Implement test tests/auth/test_login.py:TestLogin:test_invalid_credentials.`
269
+ - Good: `- Update CLI help text to include login command description.`
270
+ - Good: `- Implement function app/auth/authentication.py:authenticate_user().`