donespec 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.
Files changed (49) hide show
  1. donespec-0.1.0/.gitattributes +4 -0
  2. donespec-0.1.0/.github/workflows/ci.yml +25 -0
  3. donespec-0.1.0/.gitignore +16 -0
  4. donespec-0.1.0/LICENSE +21 -0
  5. donespec-0.1.0/PKG-INFO +397 -0
  6. donespec-0.1.0/README.md +367 -0
  7. donespec-0.1.0/action.yml +51 -0
  8. donespec-0.1.0/docs/architecture.md +52 -0
  9. donespec-0.1.0/docs/contributing.md +37 -0
  10. donespec-0.1.0/docs/installation.md +30 -0
  11. donespec-0.1.0/docs/launch-strategy.md +48 -0
  12. donespec-0.1.0/docs/release.md +49 -0
  13. donespec-0.1.0/done.json +55 -0
  14. donespec-0.1.0/done.schema.json +196 -0
  15. donespec-0.1.0/examples/api-task/README.md +9 -0
  16. donespec-0.1.0/examples/api-task/done.json +25 -0
  17. donespec-0.1.0/examples/docs-task/README.md +7 -0
  18. donespec-0.1.0/examples/docs-task/done.json +25 -0
  19. donespec-0.1.0/examples/fix-bug-task/README.md +7 -0
  20. donespec-0.1.0/examples/fix-bug-task/done.json +30 -0
  21. donespec-0.1.0/examples/fix-bug-task/package.json +5 -0
  22. donespec-0.1.0/examples/fix-bug-task/src/auth.ts +3 -0
  23. donespec-0.1.0/examples/fix-bug-task/src/types.ts +1 -0
  24. donespec-0.1.0/examples/refactor-task/README.md +7 -0
  25. donespec-0.1.0/examples/refactor-task/done.json +25 -0
  26. donespec-0.1.0/pyproject.toml +78 -0
  27. donespec-0.1.0/src/donespec/__init__.py +3 -0
  28. donespec-0.1.0/src/donespec/__main__.py +4 -0
  29. donespec-0.1.0/src/donespec/checkers/__init__.py +3 -0
  30. donespec-0.1.0/src/donespec/checkers/base.py +67 -0
  31. donespec-0.1.0/src/donespec/checkers/command.py +60 -0
  32. donespec-0.1.0/src/donespec/checkers/file_exists.py +28 -0
  33. donespec-0.1.0/src/donespec/checkers/git.py +61 -0
  34. donespec-0.1.0/src/donespec/checkers/http.py +58 -0
  35. donespec-0.1.0/src/donespec/checkers/regex.py +99 -0
  36. donespec-0.1.0/src/donespec/checkers/registry.py +26 -0
  37. donespec-0.1.0/src/donespec/cli.py +86 -0
  38. donespec-0.1.0/src/donespec/engine.py +44 -0
  39. donespec-0.1.0/src/donespec/exceptions.py +6 -0
  40. donespec-0.1.0/src/donespec/loader.py +26 -0
  41. donespec-0.1.0/src/donespec/models.py +47 -0
  42. donespec-0.1.0/src/donespec/output.py +55 -0
  43. donespec-0.1.0/src/donespec/pathing.py +17 -0
  44. donespec-0.1.0/src/donespec/schema.py +28 -0
  45. donespec-0.1.0/src/donespec/schemas/done.schema.json +196 -0
  46. donespec-0.1.0/tests/conftest.py +22 -0
  47. donespec-0.1.0/tests/test_checkers.py +101 -0
  48. donespec-0.1.0/tests/test_cli.py +46 -0
  49. donespec-0.1.0/tests/test_schema.py +27 -0
@@ -0,0 +1,4 @@
1
+ * text=auto eol=lf
2
+ *.bat text eol=crlf
3
+ *.cmd text eol=crlf
4
+ *.ps1 text eol=crlf
@@ -0,0 +1,25 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Install
17
+ run: |
18
+ python -m pip install --upgrade pip
19
+ python -m pip install -e ".[dev]"
20
+ - name: Ruff check
21
+ run: ruff check .
22
+ - name: Ruff format check
23
+ run: ruff format --check .
24
+ - name: Pytest
25
+ run: pytest
@@ -0,0 +1,16 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ *.egg-info/
7
+ dist/
8
+ build/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+ htmlcov/
13
+ node_modules/
14
+ .env
15
+ .DS_Store
16
+ Thumbs.db
donespec-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DoneSpec 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,397 @@
1
+ Metadata-Version: 2.4
2
+ Name: donespec
3
+ Version: 0.1.0
4
+ Summary: Deterministic validation for AI agent task completion.
5
+ Project-URL: Homepage, https://github.com/donespec/donespec
6
+ Project-URL: Repository, https://github.com/donespec/donespec
7
+ Project-URL: Issues, https://github.com/donespec/donespec/issues
8
+ Author: DoneSpec Contributors
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai-agents,ci,cli,deterministic,developer-tools,testing,validation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: jsonschema>=4.22.0
23
+ Requires-Dist: pydantic>=2.7.0
24
+ Requires-Dist: rich>=13.7.0
25
+ Requires-Dist: typer>=0.12.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=8.2.0; extra == 'dev'
28
+ Requires-Dist: ruff>=0.5.0; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # DoneSpec
32
+
33
+ > Done means deterministically verified.
34
+
35
+ DoneSpec is a tiny CLI for validating whether an AI coding agent actually completed a task.
36
+
37
+ It reads a machine-readable `done.json`, executes deterministic checks, and exits with `0` only when the task is verifiably complete.
38
+
39
+ ```bash
40
+ donespec validate done.json
41
+ ```
42
+
43
+ ```text
44
+ DoneSpec validation: fix-auth-bug
45
+
46
+ ✓ npm tests passed (1242.7ms)
47
+ ✓ auth.ts exists (0.2ms)
48
+ ✓ returnTo is implemented (0.5ms)
49
+ ✗ shared types untouched (12.1ms)
50
+ Forbidden path modified: src/types.ts
51
+
52
+ Validation failed.
53
+ 1 check failed.
54
+ Exit code: 1
55
+ ```
56
+
57
+ ## 1. Problem
58
+
59
+ AI coding agents are increasingly good at producing code, but they still frequently claim work is complete when it is not.
60
+
61
+ Common failures:
62
+
63
+ - tests were not run,
64
+ - tests fail,
65
+ - files were modified incorrectly,
66
+ - requirements were partially implemented,
67
+ - forbidden paths were touched,
68
+ - expected outputs were hallucinated,
69
+ - runtime invariants were broken.
70
+
71
+ Humans are left reading optimistic summaries instead of deterministic evidence.
72
+
73
+ DoneSpec gives every task a local, reproducible completion contract.
74
+
75
+ ## 2. Why AI agents fail
76
+
77
+ AI agents optimize for plausible task completion. Software delivery requires verified task completion.
78
+
79
+ An agent can say:
80
+
81
+ > I fixed the auth bug and all tests pass.
82
+
83
+ DoneSpec asks:
84
+
85
+ - Did the configured command exit successfully?
86
+ - Does the expected file exist?
87
+ - Does the required implementation marker exist?
88
+ - Was a forbidden file modified?
89
+ - Does the HTTP endpoint return the expected status?
90
+
91
+ No vibes. No screenshots. No hidden judgement. Just deterministic checks.
92
+
93
+ ## 3. What DoneSpec solves
94
+
95
+ DoneSpec introduces a small validation layer between AI coding agents and human trust.
96
+
97
+ It provides:
98
+
99
+ - a machine-readable `done.json`,
100
+ - deterministic local checks,
101
+ - CI/CD integration,
102
+ - structured JSON output,
103
+ - a checker registry for future extension,
104
+ - zero LLM dependency in the validation path.
105
+
106
+ DoneSpec is not an AI wrapper, chatbot, dashboard, or orchestration system.
107
+
108
+ It is developer infrastructure.
109
+
110
+ ## 4. Installation
111
+
112
+ ### pipx
113
+
114
+ ```bash
115
+ pipx install donespec
116
+ ```
117
+
118
+ ### uv
119
+
120
+ ```bash
121
+ uv tool install donespec
122
+ ```
123
+
124
+ ### from source
125
+
126
+ ```bash
127
+ git clone https://github.com/donespec/donespec.git
128
+ cd donespec
129
+ python -m pip install -e ".[dev]"
130
+ ```
131
+
132
+ Verify:
133
+
134
+ ```bash
135
+ donespec --version
136
+ ```
137
+
138
+ ## 5. Quick example
139
+
140
+ Create `done.json`:
141
+
142
+ ```json
143
+ {
144
+ "version": "1.0",
145
+ "task_id": "fix-auth-bug",
146
+ "must_pass": [
147
+ {
148
+ "type": "command",
149
+ "name": "npm tests passed",
150
+ "run": "npm test"
151
+ },
152
+ {
153
+ "type": "file_exists",
154
+ "name": "auth.ts exists",
155
+ "path": "src/auth.ts"
156
+ },
157
+ {
158
+ "type": "regex_in_file",
159
+ "name": "returnTo is implemented",
160
+ "path": "src/auth.ts",
161
+ "pattern": "returnTo"
162
+ }
163
+ ],
164
+ "must_not": [
165
+ {
166
+ "type": "file_not_modified",
167
+ "name": "shared types untouched",
168
+ "path": "src/types.ts"
169
+ }
170
+ ]
171
+ }
172
+ ```
173
+
174
+ Run:
175
+
176
+ ```bash
177
+ donespec validate done.json
178
+ ```
179
+
180
+ Machine-readable output:
181
+
182
+ ```bash
183
+ donespec validate done.json --json
184
+ ```
185
+
186
+ ## 6. CLI usage
187
+
188
+ ```bash
189
+ donespec validate done.json
190
+ ```
191
+
192
+ Options:
193
+
194
+ ```text
195
+ --json Emit machine-readable JSON output.
196
+ --root PATH Project root. Defaults to the spec file directory.
197
+ --fail-fast Stop after first failed check.
198
+ ```
199
+
200
+ Exit codes:
201
+
202
+ | Code | Meaning |
203
+ | ---: | ------- |
204
+ | 0 | Validation passed |
205
+ | 1 | Validation failed |
206
+ | 2 | Invalid spec or runtime error |
207
+
208
+ ## Supported checks
209
+
210
+ ### `command`
211
+
212
+ Runs a shell command and validates the exit code.
213
+
214
+ ```json
215
+ {
216
+ "type": "command",
217
+ "name": "tests pass",
218
+ "run": "pytest",
219
+ "expected_exit_code": 0,
220
+ "timeout_seconds": 120
221
+ }
222
+ ```
223
+
224
+ ### `file_exists`
225
+
226
+ Checks that a file or directory exists.
227
+
228
+ ```json
229
+ {
230
+ "type": "file_exists",
231
+ "path": "src/auth.ts"
232
+ }
233
+ ```
234
+
235
+ ### `regex_in_file`
236
+
237
+ Checks that a regex exists in a file.
238
+
239
+ ```json
240
+ {
241
+ "type": "regex_in_file",
242
+ "path": "src/auth.ts",
243
+ "pattern": "returnTo"
244
+ }
245
+ ```
246
+
247
+ Optional flags:
248
+
249
+ ```json
250
+ {
251
+ "flags": ["IGNORECASE", "MULTILINE", "DOTALL"]
252
+ }
253
+ ```
254
+
255
+ ### `regex_absent`
256
+
257
+ Checks that a regex does not exist in a file.
258
+
259
+ ```json
260
+ {
261
+ "type": "regex_absent",
262
+ "path": "src/auth.ts",
263
+ "pattern": "console\\.log"
264
+ }
265
+ ```
266
+
267
+ ### `file_not_modified`
268
+
269
+ Checks Git status to ensure a file or path was not modified, staged, deleted, or newly added.
270
+
271
+ ```json
272
+ {
273
+ "type": "file_not_modified",
274
+ "path": "src/types.ts"
275
+ }
276
+ ```
277
+
278
+ ### `http_check`
279
+
280
+ Makes an HTTP request and validates the response status.
281
+
282
+ ```json
283
+ {
284
+ "type": "http_check",
285
+ "url": "http://127.0.0.1:8000/health",
286
+ "method": "GET",
287
+ "expected_status": 200,
288
+ "timeout_seconds": 3
289
+ }
290
+ ```
291
+
292
+ ## 7. CI integration
293
+
294
+ ### GitHub Actions
295
+
296
+ ```yaml
297
+ name: DoneSpec
298
+
299
+ on:
300
+ pull_request:
301
+
302
+ jobs:
303
+ validate:
304
+ runs-on: ubuntu-latest
305
+ steps:
306
+ - uses: actions/checkout@v4
307
+ - uses: donespec/action@v1
308
+ with:
309
+ spec: done.json
310
+ root: .
311
+ ```
312
+
313
+ The action installs DoneSpec, runs validation, and fails CI if any check fails.
314
+
315
+ ### Direct CI command
316
+
317
+ ```yaml
318
+ - run: python -m pip install donespec
319
+ - run: donespec validate done.json
320
+ ```
321
+
322
+ ## 8. Philosophy
323
+
324
+ DoneSpec is intentionally boring.
325
+
326
+ It should feel closer to ESLint, Prettier, pytest, or `package.json` scripts than to an AI platform.
327
+
328
+ Principles:
329
+
330
+ - local first,
331
+ - deterministic only,
332
+ - minimal dependencies,
333
+ - no accounts,
334
+ - no dashboard in the MVP,
335
+ - no LLM calls in validation,
336
+ - composable with any agent,
337
+ - simple enough for solo developers,
338
+ - strict enough for CI.
339
+
340
+ AI agents may generate work. DoneSpec verifies completion.
341
+
342
+ ## 9. Roadmap
343
+
344
+ DoneSpec is designed for future extension, but the MVP stays small.
345
+
346
+ Planned directions:
347
+
348
+ - more deterministic checkers,
349
+ - generated `done.json` templates,
350
+ - MCP server integration,
351
+ - AI agent integrations,
352
+ - VSCode extension,
353
+ - cloud dashboard,
354
+ - analytics,
355
+ - multi-agent validation.
356
+
357
+ Not in the MVP:
358
+
359
+ - authentication,
360
+ - database,
361
+ - SaaS dashboard,
362
+ - orchestration system,
363
+ - LLM dependency.
364
+
365
+ ## Repository layout
366
+
367
+ ```text
368
+ .
369
+ ├── action.yml
370
+ ├── done.schema.json
371
+ ├── docs/
372
+ ├── examples/
373
+ ├── pyproject.toml
374
+ ├── src/
375
+ │ └── donespec/
376
+ │ ├── cli.py
377
+ │ ├── engine.py
378
+ │ ├── loader.py
379
+ │ ├── models.py
380
+ │ ├── output.py
381
+ │ ├── schema.py
382
+ │ └── checkers/
383
+ └── tests/
384
+ ```
385
+
386
+ ## Development
387
+
388
+ ```bash
389
+ python -m pip install -e ".[dev]"
390
+ ruff check .
391
+ ruff format .
392
+ pytest
393
+ ```
394
+
395
+ ## License
396
+
397
+ MIT