devflow-toolkit 0.3.25__tar.gz → 0.3.26__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 (87) hide show
  1. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/CHANGELOG.md +24 -0
  2. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/PKG-INFO +36 -12
  3. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/README.md +32 -12
  4. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/docs/REFERENCE.md +35 -11
  5. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/pyproject.toml +1 -1
  6. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/approve.py +11 -0
  7. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/init.py +15 -60
  8. devflow_toolkit-0.3.26/src/devflow/commands/security.py +67 -0
  9. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/config.py +17 -0
  10. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/specification.py +14 -0
  11. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_security_tools.py +106 -4
  12. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/.gitignore +0 -0
  13. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/LICENSE +0 -0
  14. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/PUBLISHING.md +0 -0
  15. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/__init__.py +0 -0
  16. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/__init__.py +0 -0
  17. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/agents.py +0 -0
  18. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/antigravity.py +0 -0
  19. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/base.py +0 -0
  20. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/claude_code.py +0 -0
  21. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/codex.py +0 -0
  22. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/detector.py +0 -0
  23. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/instructions.py +0 -0
  24. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/kiro.py +0 -0
  25. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/opencode.py +0 -0
  26. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/adapters/registry.py +0 -0
  27. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/cli.py +0 -0
  28. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/__init__.py +0 -0
  29. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/config.py +0 -0
  30. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/doctor.py +0 -0
  31. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/harness.py +0 -0
  32. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/recover.py +0 -0
  33. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/reopen.py +0 -0
  34. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/spec.py +0 -0
  35. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/commands/status.py +0 -0
  36. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/__init__.py +0 -0
  37. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/architecture.py +0 -0
  38. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/__init__.py +0 -0
  39. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/errors.py +0 -0
  40. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/models.py +0 -0
  41. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/store.py +0 -0
  42. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/clock.py +0 -0
  43. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/constitution.py +0 -0
  44. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/discovery.py +0 -0
  45. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/file_types.py +0 -0
  46. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/ports.py +0 -0
  47. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/profile_manager.py +0 -0
  48. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/project.py +0 -0
  49. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/recovery.py +0 -0
  50. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/security_tools.py +0 -0
  51. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/spec_workflow.py +0 -0
  52. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/__init__.py +0 -0
  53. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/errors.py +0 -0
  54. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/events.py +0 -0
  55. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/locator.py +0 -0
  56. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/lock.py +0 -0
  57. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/manager.py +0 -0
  58. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/models.py +0 -0
  59. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/core/state/transitions.py +0 -0
  60. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/models/__init__.py +0 -0
  61. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/models/profile.py +0 -0
  62. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/models/project.py +0 -0
  63. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  64. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  65. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  66. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  67. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  68. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/profile.yaml +0 -0
  69. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  70. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  71. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  72. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  73. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/prompts/__init__.py +0 -0
  74. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/prompts/discovery-repair.md +0 -0
  75. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/prompts/discovery.md +0 -0
  76. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/src/devflow/prompts/spec.md +0 -0
  77. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_cli.py +0 -0
  78. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_discovery.py +0 -0
  79. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_discovery_decisions.py +0 -0
  80. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_event_log.py +0 -0
  81. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_greenfield.py +0 -0
  82. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_hardening.py +0 -0
  83. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_harness_adapters.py +0 -0
  84. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_recovery.py +0 -0
  85. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_spec_workflow.py +0 -0
  86. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_state.py +0 -0
  87. {devflow_toolkit-0.3.25 → devflow_toolkit-0.3.26}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.26 - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - Acknowledgments in the README and in the PyPI description, with a
10
+ special mention of Typer and its author, Sebastián Ramírez
11
+ (@tiangolo), creator of FastAPI.
12
+ - When the local security checks are configured, `context.md` tells
13
+ the specification writer to record `pre-commit run --all-files` as a
14
+ quality gate in section 6.
15
+
16
+ ### Changed
17
+
18
+ - The local security checks review code, so they are offered once
19
+ after the first `devflow approve`, when implementation starts, instead
20
+ of during `devflow init`. `devflow init --security-tools` still
21
+ installs them at any time, and `--no-security-tools` turns the offer
22
+ off. The answer is stored as `security.tools_offered` in
23
+ `.devflow/config.yaml`.
24
+
25
+ ### Package
26
+
27
+ - Package version is `0.3.26`.
28
+
5
29
  ## 0.3.25 - 2026-11-09
6
30
 
7
31
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.25
3
+ Version: 0.3.26
4
4
  Summary: Specification workflow toolkit for AI-assisted software changes
5
5
  Author: DevFlow contributors
6
6
  License-Expression: MIT
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  # DevFlow Toolkit
34
34
 
35
- **Current version: `0.3.25`.**
35
+ **Current version: `0.3.26`.**
36
36
 
37
37
  DevFlow is a command-line toolkit for leading AI models and coding
38
38
  agents through specification-driven changes in real software projects.
@@ -152,7 +152,7 @@ pip install devflow-toolkit
152
152
  To install a specific built artifact instead:
153
153
 
154
154
  ```bash
155
- pip install devflow_toolkit-0.3.25-py3-none-any.whl
155
+ pip install devflow_toolkit-0.3.26-py3-none-any.whl
156
156
  ```
157
157
 
158
158
  Verify the installation:
@@ -317,8 +317,9 @@ explicitly.
317
317
 
318
318
  ### Local security checks
319
319
 
320
- `devflow init` offers tools that run locally on every commit, without
321
- tokens:
320
+ Semgrep, Bandit, pip-audit and gitleaks review code, so they belong to
321
+ implementation. DevFlow offers them once, right after the first
322
+ `devflow approve`, in an interactive terminal:
322
323
 
323
324
  - Semgrep, with rules for Django (or Python) and OWASP;
324
325
  - Bandit, for Python code;
@@ -326,9 +327,9 @@ tokens:
326
327
  - gitleaks, for secrets in the code.
327
328
 
328
329
  pre-commit (pre-commit.com) runs these tools automatically on every
329
- commit. In an interactive terminal `init` describes them and asks; use
330
- `--security-tools` to install them without asking, or
331
- `--no-security-tools` to skip the offer.
330
+ commit, without tokens. `devflow init --security-tools` installs them at
331
+ any time; `devflow init --no-security-tools` turns the offer off. The
332
+ answer is remembered in `.devflow/config.yaml` (`security.tools_offered`).
332
333
 
333
334
  Accepting writes a managed `.pre-commit-config.yaml` with pinned hook
334
335
  revisions, installs `pre-commit` with pip when it is missing and runs
@@ -339,6 +340,10 @@ hooks that apply are added: Bandit and pip-audit for Python projects,
339
340
  downloads the tools; `pre-commit run --all-files` checks the whole
340
341
  project.
341
342
 
343
+ When the checks are configured, `context.md` tells the specification
344
+ writer to record `pre-commit run --all-files` as a quality gate in
345
+ section 6.
346
+
342
347
  ## Configuration
343
348
 
344
349
  `.devflow/config.yaml` stores project settings. It references the
@@ -452,7 +457,7 @@ as an architectural constraint when it is present.
452
457
 
453
458
  ### Harnesses
454
459
 
455
- | Harness | Status in 0.3.25 |
460
+ | Harness | Status in 0.3.26 |
456
461
  | --- | --- |
457
462
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
458
463
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -795,7 +800,7 @@ for each item; the agent does not write it.
795
800
  8. If artifacts exist without workflow state, diagnose with
796
801
  `devflow doctor <id>` and repair with `devflow recover <id>`.
797
802
 
798
- Available commands in `0.3.25`:
803
+ Available commands in `0.3.26`:
799
804
 
800
805
  | Command | Status |
801
806
  | --- | --- |
@@ -1028,7 +1033,7 @@ devflow approve 001
1028
1033
  ```
1029
1034
 
1030
1035
  Approval is explicit and binds the decision to the current artifact
1031
- digests. For a `0.3.25` change it binds `spec.md`, `discovery.yaml` and,
1036
+ digests. For a `0.3.26` change it binds `spec.md`, `discovery.yaml` and,
1032
1037
  when a manifest applies, the architecture manifest digest. Repeating the
1033
1038
  same approval is a no-op. If an artifact changes after validation,
1034
1039
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -1039,7 +1044,7 @@ and names the pending questions and assumptions. Approval also rejects a
1039
1044
  specification whose section 7 still lists open questions. Legacy `0.2.0`
1040
1045
  changes without `discovery.yaml` remain approvable with a warning.
1041
1046
 
1042
- Only the `spec` stage is available in `0.3.25`, so `--stage` is optional
1047
+ Only the `spec` stage is available in `0.3.26`, so `--stage` is optional
1043
1048
  and defaults to `spec`. `--stage plan` and `--stage review` are
1044
1049
  rejected. There are no `plan`, `implement` or
1045
1050
  `review` commands in this release.
@@ -1246,3 +1251,22 @@ The test suite covers the core, CLI, state replay and harness adapters.
1246
1251
  Release verification additionally installs the built wheel and sdist in
1247
1252
  clean virtual environments and runs the consumer workflow from outside
1248
1253
  the repository.
1254
+
1255
+ ## Acknowledgments
1256
+
1257
+ DevFlow is built on the shoulders of open-source work.
1258
+
1259
+ **[Typer](https://typer.tiangolo.com)**, by **Sebastián Ramírez
1260
+ ([@tiangolo](https://github.com/tiangolo))**, creator of FastAPI. Every
1261
+ DevFlow command, option and help screen is built with Typer. Thank you
1262
+ for making great command-line tools this simple to build.
1263
+
1264
+ - **[Rich](https://github.com/Textualize/rich)**, by Will McGugan, for
1265
+ the terminal output.
1266
+ - **[PyYAML](https://pyyaml.org)**, for the Discovery and workflow
1267
+ records.
1268
+ - **[pre-commit](https://pre-commit.com)**, by Anthony Sottile, and the
1269
+ Semgrep, Bandit, pip-audit and gitleaks projects, for the local
1270
+ security checks.
1271
+ - **[OWASP](https://owasp.org)**, for the security standards that guide
1272
+ DevFlow's security checks.
@@ -10,7 +10,7 @@ approved specification instead of a vague chat request.
10
10
  approval live in `.devflow/`, so any agent or teammate can pick up
11
11
  the work.
12
12
 
13
- Current version: `0.3.25` · Python 3.11+ · Linux and macOS
13
+ Current version: `0.3.26` · Python 3.11+ · Linux and macOS
14
14
 
15
15
  ## Install
16
16
 
@@ -52,17 +52,6 @@ devflow init --harness opencode --language es
52
52
  `codex`, `antigravity`, `kiro`). `--language` is the language of the
53
53
  questions and the spec.
54
54
 
55
- `init` also offers tools that run locally on every commit, without
56
- tokens:
57
-
58
- - Semgrep, with rules for Django and OWASP;
59
- - Bandit, for Python code;
60
- - pip-audit, for vulnerable dependencies;
61
- - gitleaks, for secrets in the code.
62
-
63
- pre-commit (pre-commit.com) runs them automatically on every commit.
64
- Accept the offer, or add them later with `devflow init --security-tools`.
65
-
66
55
  ### 2. Describe the change
67
56
 
68
57
  ```bash
@@ -107,6 +96,18 @@ specs, each with its `devflow spec "..."` command. Then:
107
96
  devflow approve 001
108
97
  ```
109
98
 
99
+ After the first approval, implementation is next, so DevFlow offers
100
+ tools that review the code locally on every commit, without tokens:
101
+
102
+ - Semgrep, with rules for Django and OWASP;
103
+ - Bandit, for Python code;
104
+ - pip-audit, for vulnerable dependencies;
105
+ - gitleaks, for secrets in the code.
106
+
107
+ pre-commit (pre-commit.com) runs them automatically on every commit.
108
+ The offer appears once; add them any time with
109
+ `devflow init --security-tools`.
110
+
110
111
  ### 5. Implement
111
112
 
112
113
  Open your agent normally (not through DevFlow) and ask:
@@ -169,6 +170,25 @@ written outside the normal flow.
169
170
  - [Changelog](CHANGELOG.md)
170
171
  - [How to publish a release](PUBLISHING.md)
171
172
 
173
+ ## Acknowledgments
174
+
175
+ DevFlow is built on the shoulders of open-source work.
176
+
177
+ **[Typer](https://typer.tiangolo.com)**, by **Sebastián Ramírez
178
+ ([@tiangolo](https://github.com/tiangolo))**, creator of FastAPI. Every
179
+ DevFlow command, option and help screen is built with Typer. Thank you
180
+ for making great command-line tools this simple to build.
181
+
182
+ - **[Rich](https://github.com/Textualize/rich)**, by Will McGugan, for
183
+ the terminal output.
184
+ - **[PyYAML](https://pyyaml.org)**, for the Discovery and workflow
185
+ records.
186
+ - **[pre-commit](https://pre-commit.com)**, by Anthony Sottile, and the
187
+ Semgrep, Bandit, pip-audit and gitleaks projects, for the local
188
+ security checks.
189
+ - **[OWASP](https://owasp.org)**, for the security standards that guide
190
+ DevFlow's security checks.
191
+
172
192
  ## License
173
193
 
174
194
  MIT
@@ -1,6 +1,6 @@
1
1
  # DevFlow Toolkit
2
2
 
3
- **Current version: `0.3.25`.**
3
+ **Current version: `0.3.26`.**
4
4
 
5
5
  DevFlow is a command-line toolkit for leading AI models and coding
6
6
  agents through specification-driven changes in real software projects.
@@ -120,7 +120,7 @@ pip install devflow-toolkit
120
120
  To install a specific built artifact instead:
121
121
 
122
122
  ```bash
123
- pip install devflow_toolkit-0.3.25-py3-none-any.whl
123
+ pip install devflow_toolkit-0.3.26-py3-none-any.whl
124
124
  ```
125
125
 
126
126
  Verify the installation:
@@ -285,8 +285,9 @@ explicitly.
285
285
 
286
286
  ### Local security checks
287
287
 
288
- `devflow init` offers tools that run locally on every commit, without
289
- tokens:
288
+ Semgrep, Bandit, pip-audit and gitleaks review code, so they belong to
289
+ implementation. DevFlow offers them once, right after the first
290
+ `devflow approve`, in an interactive terminal:
290
291
 
291
292
  - Semgrep, with rules for Django (or Python) and OWASP;
292
293
  - Bandit, for Python code;
@@ -294,9 +295,9 @@ tokens:
294
295
  - gitleaks, for secrets in the code.
295
296
 
296
297
  pre-commit (pre-commit.com) runs these tools automatically on every
297
- commit. In an interactive terminal `init` describes them and asks; use
298
- `--security-tools` to install them without asking, or
299
- `--no-security-tools` to skip the offer.
298
+ commit, without tokens. `devflow init --security-tools` installs them at
299
+ any time; `devflow init --no-security-tools` turns the offer off. The
300
+ answer is remembered in `.devflow/config.yaml` (`security.tools_offered`).
300
301
 
301
302
  Accepting writes a managed `.pre-commit-config.yaml` with pinned hook
302
303
  revisions, installs `pre-commit` with pip when it is missing and runs
@@ -307,6 +308,10 @@ hooks that apply are added: Bandit and pip-audit for Python projects,
307
308
  downloads the tools; `pre-commit run --all-files` checks the whole
308
309
  project.
309
310
 
311
+ When the checks are configured, `context.md` tells the specification
312
+ writer to record `pre-commit run --all-files` as a quality gate in
313
+ section 6.
314
+
310
315
  ## Configuration
311
316
 
312
317
  `.devflow/config.yaml` stores project settings. It references the
@@ -420,7 +425,7 @@ as an architectural constraint when it is present.
420
425
 
421
426
  ### Harnesses
422
427
 
423
- | Harness | Status in 0.3.25 |
428
+ | Harness | Status in 0.3.26 |
424
429
  | --- | --- |
425
430
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
426
431
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -763,7 +768,7 @@ for each item; the agent does not write it.
763
768
  8. If artifacts exist without workflow state, diagnose with
764
769
  `devflow doctor <id>` and repair with `devflow recover <id>`.
765
770
 
766
- Available commands in `0.3.25`:
771
+ Available commands in `0.3.26`:
767
772
 
768
773
  | Command | Status |
769
774
  | --- | --- |
@@ -996,7 +1001,7 @@ devflow approve 001
996
1001
  ```
997
1002
 
998
1003
  Approval is explicit and binds the decision to the current artifact
999
- digests. For a `0.3.25` change it binds `spec.md`, `discovery.yaml` and,
1004
+ digests. For a `0.3.26` change it binds `spec.md`, `discovery.yaml` and,
1000
1005
  when a manifest applies, the architecture manifest digest. Repeating the
1001
1006
  same approval is a no-op. If an artifact changes after validation,
1002
1007
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -1007,7 +1012,7 @@ and names the pending questions and assumptions. Approval also rejects a
1007
1012
  specification whose section 7 still lists open questions. Legacy `0.2.0`
1008
1013
  changes without `discovery.yaml` remain approvable with a warning.
1009
1014
 
1010
- Only the `spec` stage is available in `0.3.25`, so `--stage` is optional
1015
+ Only the `spec` stage is available in `0.3.26`, so `--stage` is optional
1011
1016
  and defaults to `spec`. `--stage plan` and `--stage review` are
1012
1017
  rejected. There are no `plan`, `implement` or
1013
1018
  `review` commands in this release.
@@ -1214,3 +1219,22 @@ The test suite covers the core, CLI, state replay and harness adapters.
1214
1219
  Release verification additionally installs the built wheel and sdist in
1215
1220
  clean virtual environments and runs the consumer workflow from outside
1216
1221
  the repository.
1222
+
1223
+ ## Acknowledgments
1224
+
1225
+ DevFlow is built on the shoulders of open-source work.
1226
+
1227
+ **[Typer](https://typer.tiangolo.com)**, by **Sebastián Ramírez
1228
+ ([@tiangolo](https://github.com/tiangolo))**, creator of FastAPI. Every
1229
+ DevFlow command, option and help screen is built with Typer. Thank you
1230
+ for making great command-line tools this simple to build.
1231
+
1232
+ - **[Rich](https://github.com/Textualize/rich)**, by Will McGugan, for
1233
+ the terminal output.
1234
+ - **[PyYAML](https://pyyaml.org)**, for the Discovery and workflow
1235
+ records.
1236
+ - **[pre-commit](https://pre-commit.com)**, by Anthony Sottile, and the
1237
+ Semgrep, Bandit, pip-audit and gitleaks projects, for the local
1238
+ security checks.
1239
+ - **[OWASP](https://owasp.org)**, for the security standards that guide
1240
+ DevFlow's security checks.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.25"
7
+ version = "0.3.26"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "docs/REFERENCE.md"
10
10
  license = "MIT"
@@ -2,11 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import sys
5
6
  from pathlib import Path
6
7
 
7
8
  import typer
8
9
  from rich.console import Console
9
10
 
11
+ from devflow.commands.security import offer_security_tools
10
12
  from devflow.core.artifacts.errors import ArtifactError
11
13
  from devflow.core.config import ConfigError, ConfigManager
12
14
  from devflow.core.discovery import DiscoveryError
@@ -99,3 +101,12 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
99
101
  "Changing an approved artifact marks it stale and blocks the "
100
102
  "workflow until it is validated again.[/dim]"
101
103
  )
104
+ if result.changed:
105
+ # Implementation starts after the first approval: this is when
106
+ # checks that review code on every commit become useful.
107
+ offer_security_tools(
108
+ config,
109
+ ProjectDetector().detect(config.root),
110
+ console,
111
+ allow_prompt=sys.stdin.isatty(),
112
+ )
@@ -37,7 +37,10 @@ from devflow.core.ports import (
37
37
  SetupResult,
38
38
  build_setup_context,
39
39
  )
40
- from devflow.core import security_tools
40
+ from devflow.commands.security import (
41
+ decline_security_tools,
42
+ install_security_tools,
43
+ )
41
44
  from devflow.core.profile_manager import ProfileError, ProfileManager
42
45
  from devflow.core.project import ProjectDetector
43
46
  from devflow.models.profile import Profile
@@ -118,8 +121,9 @@ def init(
118
121
  None,
119
122
  "--security-tools/--no-security-tools",
120
123
  help=(
121
- "Install local security checks (Semgrep, Bandit, pip-audit, "
122
- "gitleaks) with pre-commit. When omitted, an interactive init asks."
124
+ "Install now the local security checks (Semgrep, Bandit, "
125
+ "pip-audit, gitleaks) that review code on every commit. Without "
126
+ "this flag they are offered after the first spec approval."
123
127
  ),
124
128
  ),
125
129
  ) -> None:
@@ -227,12 +231,10 @@ def _initialize(
227
231
  model_override=model is not None,
228
232
  allow_prompt=not yes and sys.stdin.isatty(),
229
233
  )
230
- _offer_security_tools(
231
- config=config_manager.load(),
232
- project=project,
233
- requested=security_tools,
234
- allow_prompt=not yes and sys.stdin.isatty(),
235
- )
234
+ if security_tools:
235
+ install_security_tools(config_manager.load(), project, console)
236
+ elif security_tools is False:
237
+ decline_security_tools(config_manager.load())
236
238
  return
237
239
 
238
240
  selected = list(explicit_profiles) or detected_names
@@ -340,62 +342,15 @@ def _initialize(
340
342
  f"[green]Specifications directory:[/green] "
341
343
  f"{config.specifications_path.relative_to(root)}"
342
344
  )
343
- _offer_security_tools(
344
- config=config,
345
- project=project,
346
- requested=security_tools,
347
- allow_prompt=not yes and sys.stdin.isatty(),
348
- )
345
+ if security_tools:
346
+ install_security_tools(config, project, console)
347
+ elif security_tools is False:
348
+ decline_security_tools(config)
349
349
  console.print(
350
350
  "\nNext: [bold]devflow spec \"Describe the change\"[/bold]"
351
351
  )
352
352
 
353
353
 
354
- def _offer_security_tools(
355
- *,
356
- config: DevFlowConfig,
357
- project: Project,
358
- requested: Optional[bool],
359
- allow_prompt: bool,
360
- ) -> None:
361
- """Offer the local security checks and install them on request."""
362
- if requested is False:
363
- return
364
- root = config.root
365
- plan = security_tools.plan_for(project, root)
366
- if requested is None:
367
- if security_tools.is_configured(root):
368
- return
369
- if not allow_prompt:
370
- console.print(
371
- "[dim]Tip: add local security checks with "
372
- "'devflow init --security-tools'.[/dim]"
373
- )
374
- return
375
- console.print()
376
- for line in security_tools.describe(
377
- plan,
378
- config.documentation_language,
379
- ):
380
- console.print(line)
381
- if not typer.confirm(
382
- security_tools.confirm_prompt(config.documentation_language),
383
- default=True,
384
- ):
385
- return
386
-
387
- result = security_tools.install(root, plan)
388
- if result.config_status in {"created", "updated"}:
389
- console.print(
390
- f"[green]Security checks configured:[/green] "
391
- f"{security_tools.PRECOMMIT_CONFIG} ({', '.join(plan.tools)})"
392
- )
393
- for message in result.messages:
394
- console.print(f"[green]{message}[/green]")
395
- for warning in result.warnings:
396
- console.print(f"[yellow]Warning:[/yellow] {warning}")
397
-
398
-
399
354
  def _prompt_for_language() -> str:
400
355
  """Ask for the documentation language during interactive initialization."""
401
356
  console.print(
@@ -0,0 +1,67 @@
1
+ """Offer and install the local security checks used during implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import typer
6
+ from rich.console import Console
7
+
8
+ from devflow.core import security_tools
9
+ from devflow.core.config import ConfigManager, DevFlowConfig
10
+ from devflow.models.project import Project
11
+
12
+
13
+ def install_security_tools(
14
+ config: DevFlowConfig,
15
+ project: Project,
16
+ console: Console,
17
+ ) -> None:
18
+ """Install the checks and report the result."""
19
+ plan = security_tools.plan_for(project, config.root)
20
+ result = security_tools.install(config.root, plan)
21
+ ConfigManager(config.root).mark_security_tools_offered()
22
+ if result.config_status in {"created", "updated"}:
23
+ console.print(
24
+ f"[green]Security checks configured:[/green] "
25
+ f"{security_tools.PRECOMMIT_CONFIG} ({', '.join(plan.tools)})"
26
+ )
27
+ for message in result.messages:
28
+ console.print(f"[green]{message}[/green]")
29
+ for warning in result.warnings:
30
+ console.print(f"[yellow]Warning:[/yellow] {warning}")
31
+
32
+
33
+ def decline_security_tools(config: DevFlowConfig) -> None:
34
+ """Remember that the user does not want the offer again."""
35
+ ConfigManager(config.root).mark_security_tools_offered()
36
+
37
+
38
+ def offer_security_tools(
39
+ config: DevFlowConfig,
40
+ project: Project,
41
+ console: Console,
42
+ *,
43
+ allow_prompt: bool,
44
+ ) -> None:
45
+ """Offer the checks once, when implementation is about to start."""
46
+ manager = ConfigManager(config.root)
47
+ if (
48
+ not allow_prompt
49
+ or security_tools.is_configured(config.root)
50
+ or manager.security_tools_offered()
51
+ ):
52
+ return
53
+ plan = security_tools.plan_for(project, config.root)
54
+ console.print()
55
+ for line in security_tools.describe(plan, config.documentation_language):
56
+ console.print(line)
57
+ if typer.confirm(
58
+ security_tools.confirm_prompt(config.documentation_language),
59
+ default=True,
60
+ ):
61
+ install_security_tools(config, project, console)
62
+ return
63
+ manager.mark_security_tools_offered()
64
+ console.print(
65
+ "[dim]You can add them later with "
66
+ "'devflow init --security-tools'.[/dim]"
67
+ )
@@ -624,6 +624,23 @@ class ConfigManager:
624
624
  self._write_document(data)
625
625
  return self.load()
626
626
 
627
+ def security_tools_offered(self) -> bool:
628
+ """Return whether the local security checks were already offered."""
629
+ security = self._read_document().get("security")
630
+ return isinstance(security, dict) and bool(
631
+ security.get("tools_offered")
632
+ )
633
+
634
+ def mark_security_tools_offered(self) -> None:
635
+ """Remember that the local security checks were offered once."""
636
+ data = self._read_document()
637
+ security = data.get("security")
638
+ if not isinstance(security, dict):
639
+ security = {}
640
+ data["security"] = security
641
+ security["tools_offered"] = True
642
+ self._write_document(data)
643
+
627
644
  def ensure_directories(self, config: DevFlowConfig) -> None:
628
645
  """Create the directories referenced by the configuration."""
629
646
  for path in (
@@ -22,6 +22,7 @@ from devflow.core.constitution import (
22
22
  Constitution,
23
23
  implementation_documents,
24
24
  )
25
+ from devflow.core import security_tools
25
26
  from devflow.core.discovery import DiscoveryDocument
26
27
  from devflow.core.file_types import ANALYSIS_EXTENSIONS
27
28
  from devflow.core.project import (
@@ -1607,6 +1608,7 @@ class SpecificationManager:
1607
1608
  "",
1608
1609
  f"- Source files: {len(project.source_files)}",
1609
1610
  f"- Manifests: {', '.join(project.manifests) or 'none'}",
1611
+ *_quality_gate_lines(config.root),
1610
1612
  "",
1611
1613
  "### Constitution",
1612
1614
  "",
@@ -2041,6 +2043,7 @@ class SpecificationManager:
2041
2043
  "",
2042
2044
  f"- Source files: {len(project.source_files)}",
2043
2045
  f"- Manifests: {', '.join(project.manifests) or 'none'}",
2046
+ *_quality_gate_lines(config.root),
2044
2047
  "",
2045
2048
  "### Constitution",
2046
2049
  "",
@@ -2534,3 +2537,14 @@ def _approval_note(spec_id: str, language: str) -> str:
2534
2537
  base = (language or "en").split("-")[0].lower()
2535
2538
  template = _APPROVAL_NOTES.get(base, _APPROVAL_NOTES["en"])
2536
2539
  return template.format(spec_id=spec_id)
2540
+
2541
+
2542
+ def _quality_gate_lines(root: Path) -> list[str]:
2543
+ """Tell the spec writer about the security checks run on every commit."""
2544
+ if not security_tools.is_configured(root):
2545
+ return []
2546
+ return [
2547
+ f"- Security checks: `{security_tools.PRECOMMIT_CONFIG}` runs local "
2548
+ "security tools on every commit. Record `pre-commit run "
2549
+ "--all-files` as a quality gate in section 6.",
2550
+ ]
@@ -177,9 +177,7 @@ def test_init_installs_security_tools_on_request(
177
177
  assert security_tools.is_configured(tmp_path)
178
178
 
179
179
 
180
- def test_init_without_prompt_only_suggests_security_tools(
181
- tmp_path: Path,
182
- ) -> None:
180
+ def test_init_does_not_offer_security_tools(tmp_path: Path) -> None:
183
181
  _django_project(tmp_path)
184
182
 
185
183
  result = runner.invoke(
@@ -188,5 +186,109 @@ def test_init_without_prompt_only_suggests_security_tools(
188
186
  )
189
187
 
190
188
  assert result.exit_code == 0, result.output
191
- assert "devflow init --security-tools" in result.output
189
+ assert "Semgrep" not in result.output
192
190
  assert not (tmp_path / ".pre-commit-config.yaml").exists()
191
+
192
+
193
+ def _initialized(tmp_path: Path, *extra: str):
194
+ from devflow.core.config import ConfigManager
195
+ from devflow.core.project import ProjectDetector
196
+
197
+ _django_project(tmp_path)
198
+ result = runner.invoke(
199
+ app,
200
+ ["init", str(tmp_path), "--yes", "--harness", "none", *extra],
201
+ )
202
+ assert result.exit_code == 0, result.output
203
+ manager = ConfigManager(tmp_path)
204
+ return manager, ProjectDetector().detect(tmp_path)
205
+
206
+
207
+ def test_offer_after_approval_installs_on_yes(
208
+ tmp_path: Path,
209
+ monkeypatch: pytest.MonkeyPatch,
210
+ ) -> None:
211
+ from rich.console import Console
212
+
213
+ from devflow.commands import security
214
+
215
+ manager, project = _initialized(tmp_path)
216
+ monkeypatch.setattr(security.typer, "confirm", lambda *a, **k: True)
217
+ monkeypatch.setattr(
218
+ security_tools,
219
+ "_precommit_command",
220
+ lambda: ["pre-commit"],
221
+ )
222
+ monkeypatch.setattr(security_tools, "_run", lambda command, cwd: 0)
223
+ console = Console(record=True)
224
+
225
+ security.offer_security_tools(
226
+ manager.load(),
227
+ project,
228
+ console,
229
+ allow_prompt=True,
230
+ )
231
+
232
+ output = console.export_text()
233
+ assert "- Semgrep, with rules for Django and OWASP;" in output
234
+ assert security_tools.is_configured(tmp_path)
235
+ assert manager.security_tools_offered()
236
+
237
+
238
+ def test_declined_offer_is_not_repeated(
239
+ tmp_path: Path,
240
+ monkeypatch: pytest.MonkeyPatch,
241
+ ) -> None:
242
+ from rich.console import Console
243
+
244
+ from devflow.commands import security
245
+
246
+ manager, project = _initialized(tmp_path)
247
+ answers: list[bool] = []
248
+
249
+ def confirm(*args, **kwargs) -> bool:
250
+ answers.append(False)
251
+ return False
252
+
253
+ monkeypatch.setattr(security.typer, "confirm", confirm)
254
+
255
+ for _ in range(2):
256
+ security.offer_security_tools(
257
+ manager.load(),
258
+ project,
259
+ Console(record=True),
260
+ allow_prompt=True,
261
+ )
262
+
263
+ assert answers == [False]
264
+ assert not security_tools.is_configured(tmp_path)
265
+
266
+
267
+ def test_init_no_security_tools_disables_the_offer(tmp_path: Path) -> None:
268
+ manager, _ = _initialized(tmp_path, "--no-security-tools")
269
+
270
+ assert manager.security_tools_offered()
271
+
272
+
273
+ def test_context_names_the_security_checks_as_a_gate(
274
+ tmp_path: Path,
275
+ monkeypatch: pytest.MonkeyPatch,
276
+ ) -> None:
277
+ monkeypatch.setattr(
278
+ security_tools,
279
+ "_precommit_command",
280
+ lambda: ["pre-commit"],
281
+ )
282
+ monkeypatch.setattr(security_tools, "_run", lambda command, cwd: 0)
283
+ _initialized(tmp_path, "--security-tools")
284
+
285
+ result = runner.invoke(
286
+ app,
287
+ ["spec", "Add a health endpoint", str(tmp_path), "--no-agent"],
288
+ )
289
+
290
+ assert result.exit_code == 0, result.output
291
+ context = next(
292
+ (tmp_path / ".devflow" / "specs").glob("*/context.md")
293
+ ).read_text(encoding="utf-8")
294
+ assert "pre-commit run --all-files" in context