durable-goals 0.1.0__tar.gz
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.
- durable_goals-0.1.0/LICENSE +21 -0
- durable_goals-0.1.0/PKG-INFO +106 -0
- durable_goals-0.1.0/README.md +83 -0
- durable_goals-0.1.0/pyproject.toml +41 -0
- durable_goals-0.1.0/schemas/activation.schema.json +26 -0
- durable_goals-0.1.0/schemas/amendment.schema.json +45 -0
- durable_goals-0.1.0/schemas/contract.schema.json +105 -0
- durable_goals-0.1.0/schemas/evidence-index.schema.json +30 -0
- durable_goals-0.1.0/schemas/gateway.schema.json +43 -0
- durable_goals-0.1.0/schemas/workflow.schema.json +48 -0
- durable_goals-0.1.0/setup.cfg +4 -0
- durable_goals-0.1.0/src/durable_goals/__init__.py +51 -0
- durable_goals-0.1.0/src/durable_goals/cli.py +290 -0
- durable_goals-0.1.0/src/durable_goals/errors.py +14 -0
- durable_goals-0.1.0/src/durable_goals/evidence.py +89 -0
- durable_goals-0.1.0/src/durable_goals/io.py +108 -0
- durable_goals-0.1.0/src/durable_goals/pointers.py +114 -0
- durable_goals-0.1.0/src/durable_goals/resolve.py +168 -0
- durable_goals-0.1.0/src/durable_goals/validate.py +388 -0
- durable_goals-0.1.0/src/durable_goals/workflow.py +464 -0
- durable_goals-0.1.0/src/durable_goals/writer.py +582 -0
- durable_goals-0.1.0/src/durable_goals.egg-info/PKG-INFO +106 -0
- durable_goals-0.1.0/src/durable_goals.egg-info/SOURCES.txt +28 -0
- durable_goals-0.1.0/src/durable_goals.egg-info/dependency_links.txt +1 -0
- durable_goals-0.1.0/src/durable_goals.egg-info/entry_points.txt +2 -0
- durable_goals-0.1.0/src/durable_goals.egg-info/top_level.txt +1 -0
- durable_goals-0.1.0/tests/test_cli.py +192 -0
- durable_goals-0.1.0/tests/test_resolver.py +201 -0
- durable_goals-0.1.0/tests/test_workflow.py +175 -0
- durable_goals-0.1.0/tests/test_writer.py +213 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 durable-goals contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: durable-goals
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A durable, evidence-backed goal protocol for long-running agents
|
|
5
|
+
Author: durable-goals contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tim-inzitari/durable-goals
|
|
8
|
+
Project-URL: Repository, https://github.com/tim-inzitari/durable-goals
|
|
9
|
+
Project-URL: Issues, https://github.com/tim-inzitari/durable-goals/issues
|
|
10
|
+
Keywords: agents,ai,goals,workflow,dag
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Durable Goals
|
|
25
|
+
|
|
26
|
+
Durable Goals helps AI agents keep working toward the same goal across long
|
|
27
|
+
conversations, restarts, and multiple agent threads.
|
|
28
|
+
|
|
29
|
+
Instead of relying on chat history, it stores the goal, changes to the goal,
|
|
30
|
+
evidence, and completion rules in the repository. A small DAG can also expose
|
|
31
|
+
several independent goals so different threads can safely pick up different
|
|
32
|
+
work.
|
|
33
|
+
|
|
34
|
+
It does **not** run agents or choose models. It gives Codex, Claude Code, local
|
|
35
|
+
scripts, or another harness a shared answer to three questions:
|
|
36
|
+
|
|
37
|
+
- What is the current goal?
|
|
38
|
+
- What work is ready next?
|
|
39
|
+
- What evidence proves the goal is complete?
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Requires Python 3.11 or newer and has no runtime dependencies.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uv tool install durable-goals
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or install it with pip:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m pip install durable-goals
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then use the `dgoal` command anywhere:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dgoal --version
|
|
59
|
+
dgoal init goals/my-goal \
|
|
60
|
+
--goal-id my-goal \
|
|
61
|
+
--objective "Describe what needs to be finished."
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Try the example
|
|
65
|
+
|
|
66
|
+
From a clone of this repository:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python -m pip install -e .
|
|
70
|
+
|
|
71
|
+
dgoal validate examples/model-refresh/gateway.json
|
|
72
|
+
dgoal status examples/model-refresh/gateway.json
|
|
73
|
+
dgoal resolve examples/model-refresh/gateway.json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The basic convention is simple: an agent reads the goal package's `GOAL.md`
|
|
77
|
+
before acting. The repository remains the source of truth, even when the chat
|
|
78
|
+
or process disappears.
|
|
79
|
+
|
|
80
|
+
## What is included
|
|
81
|
+
|
|
82
|
+
- Persistent, versioned goal contracts
|
|
83
|
+
- Evidence-backed completion
|
|
84
|
+
- Append-only goal amendments and activation records
|
|
85
|
+
- DAG dependencies for multi-goal workflows
|
|
86
|
+
- Atomic claims so concurrent threads choose different ready goals
|
|
87
|
+
- A dependency-free Python CLI and test suite
|
|
88
|
+
|
|
89
|
+
## Learn more
|
|
90
|
+
|
|
91
|
+
Agents and maintainers should read [`AGENTS.md`](AGENTS.md) for the full
|
|
92
|
+
protocol, authority rules, CLI examples, and implementation scope.
|
|
93
|
+
|
|
94
|
+
- [CLI reference](docs/CLI.md)
|
|
95
|
+
- [Authoritative entry-point convention](docs/AUTHORITATIVE_ENTRYPOINT.md)
|
|
96
|
+
- [Distribution model](docs/DISTRIBUTION.md)
|
|
97
|
+
- [Cross-agent compatibility](docs/SKILL_COMPATIBILITY.md)
|
|
98
|
+
|
|
99
|
+
## Status
|
|
100
|
+
|
|
101
|
+
This is an early `0.1` release intended for trusted repositories. SHA-256
|
|
102
|
+
checks protect integrity, but they do not authenticate authors. Use signed
|
|
103
|
+
commits or another trusted transport when writers do not share the same trust
|
|
104
|
+
boundary.
|
|
105
|
+
|
|
106
|
+
Licensed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Durable Goals
|
|
2
|
+
|
|
3
|
+
Durable Goals helps AI agents keep working toward the same goal across long
|
|
4
|
+
conversations, restarts, and multiple agent threads.
|
|
5
|
+
|
|
6
|
+
Instead of relying on chat history, it stores the goal, changes to the goal,
|
|
7
|
+
evidence, and completion rules in the repository. A small DAG can also expose
|
|
8
|
+
several independent goals so different threads can safely pick up different
|
|
9
|
+
work.
|
|
10
|
+
|
|
11
|
+
It does **not** run agents or choose models. It gives Codex, Claude Code, local
|
|
12
|
+
scripts, or another harness a shared answer to three questions:
|
|
13
|
+
|
|
14
|
+
- What is the current goal?
|
|
15
|
+
- What work is ready next?
|
|
16
|
+
- What evidence proves the goal is complete?
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
Requires Python 3.11 or newer and has no runtime dependencies.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv tool install durable-goals
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or install it with pip:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python -m pip install durable-goals
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then use the `dgoal` command anywhere:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
dgoal --version
|
|
36
|
+
dgoal init goals/my-goal \
|
|
37
|
+
--goal-id my-goal \
|
|
38
|
+
--objective "Describe what needs to be finished."
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Try the example
|
|
42
|
+
|
|
43
|
+
From a clone of this repository:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python -m pip install -e .
|
|
47
|
+
|
|
48
|
+
dgoal validate examples/model-refresh/gateway.json
|
|
49
|
+
dgoal status examples/model-refresh/gateway.json
|
|
50
|
+
dgoal resolve examples/model-refresh/gateway.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The basic convention is simple: an agent reads the goal package's `GOAL.md`
|
|
54
|
+
before acting. The repository remains the source of truth, even when the chat
|
|
55
|
+
or process disappears.
|
|
56
|
+
|
|
57
|
+
## What is included
|
|
58
|
+
|
|
59
|
+
- Persistent, versioned goal contracts
|
|
60
|
+
- Evidence-backed completion
|
|
61
|
+
- Append-only goal amendments and activation records
|
|
62
|
+
- DAG dependencies for multi-goal workflows
|
|
63
|
+
- Atomic claims so concurrent threads choose different ready goals
|
|
64
|
+
- A dependency-free Python CLI and test suite
|
|
65
|
+
|
|
66
|
+
## Learn more
|
|
67
|
+
|
|
68
|
+
Agents and maintainers should read [`AGENTS.md`](AGENTS.md) for the full
|
|
69
|
+
protocol, authority rules, CLI examples, and implementation scope.
|
|
70
|
+
|
|
71
|
+
- [CLI reference](docs/CLI.md)
|
|
72
|
+
- [Authoritative entry-point convention](docs/AUTHORITATIVE_ENTRYPOINT.md)
|
|
73
|
+
- [Distribution model](docs/DISTRIBUTION.md)
|
|
74
|
+
- [Cross-agent compatibility](docs/SKILL_COMPATIBILITY.md)
|
|
75
|
+
|
|
76
|
+
## Status
|
|
77
|
+
|
|
78
|
+
This is an early `0.1` release intended for trusted repositories. SHA-256
|
|
79
|
+
checks protect integrity, but they do not authenticate authors. Use signed
|
|
80
|
+
commits or another trusted transport when writers do not share the same trust
|
|
81
|
+
boundary.
|
|
82
|
+
|
|
83
|
+
Licensed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "durable-goals"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A durable, evidence-backed goal protocol for long-running agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{name = "durable-goals contributors"}]
|
|
13
|
+
keywords = ["agents", "ai", "goals", "workflow", "dag"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
23
|
+
]
|
|
24
|
+
dependencies = []
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/tim-inzitari/durable-goals"
|
|
28
|
+
Repository = "https://github.com/tim-inzitari/durable-goals"
|
|
29
|
+
Issues = "https://github.com/tim-inzitari/durable-goals/issues"
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
dgoal = "durable_goals.cli:main"
|
|
33
|
+
|
|
34
|
+
[tool.setuptools]
|
|
35
|
+
package-dir = {"" = "src"}
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages.find]
|
|
38
|
+
where = ["src"]
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.data-files]
|
|
41
|
+
"share/durable-goals/schemas" = ["schemas/*.json"]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Activation v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "goal_id", "amendment_revision", "activated_at"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.activation/v1"},
|
|
9
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
10
|
+
"amendment_revision": {"type": "integer", "minimum": 2},
|
|
11
|
+
"activated_at": {"type": "string", "format": "date-time"},
|
|
12
|
+
"evidence": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"uniqueItems": true,
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["id", "sha256"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"id": {"type": "string", "minLength": 1},
|
|
21
|
+
"sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Amendment v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "goal_id", "revision", "recorded_at", "authority", "operations", "activation_mode"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.amendment/v1"},
|
|
9
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
10
|
+
"revision": {"type": "integer", "minimum": 2},
|
|
11
|
+
"recorded_at": {"type": "string", "format": "date-time"},
|
|
12
|
+
"authority": {"type": "string", "minLength": 1},
|
|
13
|
+
"reason": {"type": "string"},
|
|
14
|
+
"activation_mode": {"enum": ["manual", "immediate", "next_safe_boundary"]},
|
|
15
|
+
"activation_condition": {"$ref": "contract.schema.json#/$defs/predicate"},
|
|
16
|
+
"operations": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": ["op", "path"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"op": {"enum": ["set", "remove"]},
|
|
25
|
+
"path": {"type": "string", "pattern": "^/"},
|
|
26
|
+
"value": {},
|
|
27
|
+
"expect": {}
|
|
28
|
+
},
|
|
29
|
+
"oneOf": [
|
|
30
|
+
{"properties": {"op": {"const": "set"}}, "required": ["value"]},
|
|
31
|
+
{
|
|
32
|
+
"properties": {"op": {"const": "remove"}},
|
|
33
|
+
"not": {"required": ["value"]}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"allOf": [
|
|
40
|
+
{
|
|
41
|
+
"if": {"properties": {"activation_mode": {"const": "next_safe_boundary"}}},
|
|
42
|
+
"then": {"required": ["activation_condition"]}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Contract v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "goal_id", "revision", "objective", "invariants", "completion"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.contract/v1"},
|
|
9
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
10
|
+
"revision": {"type": "integer", "minimum": 1},
|
|
11
|
+
"objective": {"type": "string", "minLength": 1},
|
|
12
|
+
"invariants": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": ["id", "statement"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"id": {"type": "string", "minLength": 1},
|
|
20
|
+
"statement": {"type": "string", "minLength": 1}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"completion": {"$ref": "#/$defs/predicate"},
|
|
25
|
+
"delegations": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"required": ["goal_id", "owns"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
33
|
+
"owns": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"transitions": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["id", "goal_id", "goal_gateway", "after"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"id": {"type": "string", "minLength": 1},
|
|
45
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
46
|
+
"goal_gateway": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1,
|
|
49
|
+
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
50
|
+
},
|
|
51
|
+
"after": {"const": "completion"}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"predicate": {
|
|
58
|
+
"oneOf": [
|
|
59
|
+
{
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["literal"],
|
|
63
|
+
"properties": {"literal": {"type": "boolean"}}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"required": ["all"],
|
|
69
|
+
"properties": {"all": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/predicate"}}}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["any"],
|
|
75
|
+
"properties": {"any": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/predicate"}}}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"required": ["not"],
|
|
81
|
+
"properties": {"not": {"$ref": "#/$defs/predicate"}}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["evidence", "field"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"evidence": {"type": "string", "minLength": 1},
|
|
89
|
+
"field": {"type": "string", "pattern": "^(/.*)?$"},
|
|
90
|
+
"equals": {},
|
|
91
|
+
"gte": {"type": "number"},
|
|
92
|
+
"lte": {"type": "number"},
|
|
93
|
+
"exists": {"type": "boolean"}
|
|
94
|
+
},
|
|
95
|
+
"oneOf": [
|
|
96
|
+
{"required": ["equals"]},
|
|
97
|
+
{"required": ["gte"]},
|
|
98
|
+
{"required": ["lte"]},
|
|
99
|
+
{"required": ["exists"]}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Evidence Index v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "goal_id", "entries"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.evidence-index/v1"},
|
|
9
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
10
|
+
"entries": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": ["id", "path", "sha256"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"id": {"type": "string", "minLength": 1},
|
|
18
|
+
"path": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
22
|
+
},
|
|
23
|
+
"sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
|
|
24
|
+
"contract_revision": {"type": "integer", "minimum": 1},
|
|
25
|
+
"recorded_at": {"type": "string", "format": "date-time"}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Gateway v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "goal_id", "current_revision", "contract", "amendments", "activations", "evidence_index"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.gateway/v1"},
|
|
9
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
10
|
+
"current_revision": {"type": "integer", "minimum": 1},
|
|
11
|
+
"contract": {"$ref": "#/$defs/reference"},
|
|
12
|
+
"amendments": {"$ref": "#/$defs/reference"},
|
|
13
|
+
"activations": {"$ref": "#/$defs/reference"},
|
|
14
|
+
"evidence_index": {"$ref": "#/$defs/reference"},
|
|
15
|
+
"status": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["path"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"path": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"reference": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": ["path", "sha256"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"path": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
38
|
+
},
|
|
39
|
+
"sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Durable Goals Workflow v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schema", "workflow_id", "revision", "nodes", "edges"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {"const": "durable-goals.workflow/v1"},
|
|
9
|
+
"workflow_id": {"$ref": "#/$defs/id"},
|
|
10
|
+
"revision": {"type": "integer", "minimum": 1},
|
|
11
|
+
"nodes": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["id", "goal_id", "gateway"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"id": {"$ref": "#/$defs/id"},
|
|
19
|
+
"goal_id": {"type": "string", "minLength": 1},
|
|
20
|
+
"gateway": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"edges": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["id", "from", "to"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"id": {"$ref": "#/$defs/id"},
|
|
36
|
+
"from": {"$ref": "#/$defs/id"},
|
|
37
|
+
"to": {"$ref": "#/$defs/id"}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"id": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^[a-z0-9][a-z0-9._-]*$"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Public API for the durable-goals protocol resolver."""
|
|
2
|
+
|
|
3
|
+
from .errors import GoalError, IntegrityError, ResolutionError, ValidationError
|
|
4
|
+
from .resolve import Resolution, resolve_gateway
|
|
5
|
+
from .writer import (
|
|
6
|
+
activate_amendment,
|
|
7
|
+
chain_goal,
|
|
8
|
+
initialize_goal_package,
|
|
9
|
+
materialize_status,
|
|
10
|
+
record_amendment,
|
|
11
|
+
record_evidence,
|
|
12
|
+
)
|
|
13
|
+
from .workflow import (
|
|
14
|
+
WorkflowResolution,
|
|
15
|
+
add_dependency,
|
|
16
|
+
add_goal_node,
|
|
17
|
+
claim_next_prompt,
|
|
18
|
+
initialize_workflow,
|
|
19
|
+
next_prompts,
|
|
20
|
+
remove_dependency,
|
|
21
|
+
remove_goal_node,
|
|
22
|
+
release_claim,
|
|
23
|
+
resolve_workflow,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"GoalError",
|
|
28
|
+
"IntegrityError",
|
|
29
|
+
"Resolution",
|
|
30
|
+
"ResolutionError",
|
|
31
|
+
"ValidationError",
|
|
32
|
+
"WorkflowResolution",
|
|
33
|
+
"add_dependency",
|
|
34
|
+
"add_goal_node",
|
|
35
|
+
"claim_next_prompt",
|
|
36
|
+
"activate_amendment",
|
|
37
|
+
"chain_goal",
|
|
38
|
+
"initialize_goal_package",
|
|
39
|
+
"initialize_workflow",
|
|
40
|
+
"materialize_status",
|
|
41
|
+
"record_amendment",
|
|
42
|
+
"record_evidence",
|
|
43
|
+
"remove_dependency",
|
|
44
|
+
"remove_goal_node",
|
|
45
|
+
"release_claim",
|
|
46
|
+
"resolve_gateway",
|
|
47
|
+
"resolve_workflow",
|
|
48
|
+
"next_prompts",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
__version__ = "0.1.0"
|