devflow-toolkit 0.3.24__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.24 → devflow_toolkit-0.3.26}/CHANGELOG.md +56 -0
  2. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/PKG-INFO +63 -12
  3. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/README.md +37 -3
  4. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/docs/REFERENCE.md +62 -11
  5. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/pyproject.toml +1 -1
  6. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/approve.py +11 -0
  7. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/init.py +23 -0
  8. devflow_toolkit-0.3.26/src/devflow/commands/security.py +67 -0
  9. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/status.py +18 -0
  10. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/config.py +17 -0
  11. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/discovery.py +16 -2
  12. devflow_toolkit-0.3.26/src/devflow/core/security_tools.py +301 -0
  13. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/specification.py +93 -5
  14. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/prompts/discovery.md +14 -8
  15. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/prompts/spec.md +12 -6
  16. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_discovery_decisions.py +22 -0
  17. devflow_toolkit-0.3.26/tests/test_security_tools.py +294 -0
  18. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_spec_workflow.py +26 -0
  19. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_state.py +1 -0
  20. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/.gitignore +0 -0
  21. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/LICENSE +0 -0
  22. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/PUBLISHING.md +0 -0
  23. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/__init__.py +0 -0
  24. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/__init__.py +0 -0
  25. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/agents.py +0 -0
  26. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/antigravity.py +0 -0
  27. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/base.py +0 -0
  28. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/claude_code.py +0 -0
  29. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/codex.py +0 -0
  30. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/detector.py +0 -0
  31. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/instructions.py +0 -0
  32. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/kiro.py +0 -0
  33. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/opencode.py +0 -0
  34. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/adapters/registry.py +0 -0
  35. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/cli.py +0 -0
  36. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/__init__.py +0 -0
  37. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/config.py +0 -0
  38. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/doctor.py +0 -0
  39. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/harness.py +0 -0
  40. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/recover.py +0 -0
  41. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/reopen.py +0 -0
  42. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/commands/spec.py +0 -0
  43. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/__init__.py +0 -0
  44. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/architecture.py +0 -0
  45. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/__init__.py +0 -0
  46. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/errors.py +0 -0
  47. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/models.py +0 -0
  48. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/artifacts/store.py +0 -0
  49. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/clock.py +0 -0
  50. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/constitution.py +0 -0
  51. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/file_types.py +0 -0
  52. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/ports.py +0 -0
  53. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/profile_manager.py +0 -0
  54. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/project.py +0 -0
  55. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/recovery.py +0 -0
  56. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/spec_workflow.py +0 -0
  57. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/__init__.py +0 -0
  58. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/errors.py +0 -0
  59. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/events.py +0 -0
  60. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/locator.py +0 -0
  61. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/lock.py +0 -0
  62. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/manager.py +0 -0
  63. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/models.py +0 -0
  64. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/core/state/transitions.py +0 -0
  65. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/models/__init__.py +0 -0
  66. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/models/profile.py +0 -0
  67. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/models/project.py +0 -0
  68. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  69. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  70. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  71. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  72. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  73. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/base/profile.yaml +0 -0
  74. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  75. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  76. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  77. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  78. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/prompts/__init__.py +0 -0
  79. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/src/devflow/prompts/discovery-repair.md +0 -0
  80. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_cli.py +0 -0
  81. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_discovery.py +0 -0
  82. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_event_log.py +0 -0
  83. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_greenfield.py +0 -0
  84. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_hardening.py +0 -0
  85. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_harness_adapters.py +0 -0
  86. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_recovery.py +0 -0
  87. {devflow_toolkit-0.3.24 → devflow_toolkit-0.3.26}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,62 @@
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
+
29
+ ## 0.3.25 - 2026-11-09
30
+
31
+ ### Added
32
+
33
+ - `devflow init` offers local security checks that run on every
34
+ commit, without tokens: Semgrep (Django or Python and OWASP rules),
35
+ Bandit, pip-audit and gitleaks, run by pre-commit. It writes a managed
36
+ `.pre-commit-config.yaml` with pinned revisions, installs `pre-commit`
37
+ when missing and runs `pre-commit install`. `--security-tools` and
38
+ `--no-security-tools` skip the question.
39
+ - `next_level.title` names the suggested specification. Suggestions use
40
+ it instead of the raw option text.
41
+ - `devflow status` shows a short review checklist before approval.
42
+
43
+ ### Changed
44
+
45
+ - Acceptance criteria are plain list items (`- **AC-001:**`) without
46
+ checkboxes; DevFlow removes checkboxes an agent writes. Criteria are
47
+ verified during implementation, not ticked in an approved file.
48
+ - DevFlow writes section 11 itself: how the approval is recorded and
49
+ how to reopen it, in the documentation language. The agent leaves it
50
+ empty.
51
+ - Discovery adds a `next_level` only for a real improvement, never for
52
+ an alternative or a reduction.
53
+ - The specification prompt asks for a one-paragraph summary, no
54
+ repetition across sections and no repeated deferred items in
55
+ section 10.
56
+
57
+ ### Package
58
+
59
+ - Package version is `0.3.25`.
60
+
5
61
  ## 0.3.24 - 2026-11-09
6
62
 
7
63
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.24
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.24`.**
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.24-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:
@@ -315,6 +315,35 @@ error instead of silently switching to deterministic analysis. Pass
315
315
  `--harness none` or `--no-agent` to opt into deterministic output
316
316
  explicitly.
317
317
 
318
+ ### Local security checks
319
+
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:
323
+
324
+ - Semgrep, with rules for Django (or Python) and OWASP;
325
+ - Bandit, for Python code;
326
+ - pip-audit, for vulnerable dependencies;
327
+ - gitleaks, for secrets in the code.
328
+
329
+ pre-commit (pre-commit.com) runs these tools automatically on every
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`).
333
+
334
+ Accepting writes a managed `.pre-commit-config.yaml` with pinned hook
335
+ revisions, installs `pre-commit` with pip when it is missing and runs
336
+ `pre-commit install` when the project is a git repository. Only the
337
+ hooks that apply are added: Bandit and pip-audit for Python projects,
338
+ `p/django` rules for Django. An existing, unmanaged
339
+ `.pre-commit-config.yaml` is never overwritten. The first commit
340
+ downloads the tools; `pre-commit run --all-files` checks the whole
341
+ project.
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
+
318
347
  ## Configuration
319
348
 
320
349
  `.devflow/config.yaml` stores project settings. It references the
@@ -428,7 +457,7 @@ as an architectural constraint when it is present.
428
457
 
429
458
  ### Harnesses
430
459
 
431
- | Harness | Status in 0.3.24 |
460
+ | Harness | Status in 0.3.26 |
432
461
  | --- | --- |
433
462
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
434
463
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -717,8 +746,10 @@ everything at once:
717
746
  2. **Security is always asked, never assumed.** Basic security decisions
718
747
  are explicit questions with a recommended option and a short
719
748
  explanation, so the user learns them by answering.
720
- 3. **Every question offers a next level.** One option takes the decision
721
- one level further. It is recorded in `next_level`:
749
+ 3. **Questions offer a next level when a real improvement exists.** One
750
+ option takes the decision one level further (more secure, capable or
751
+ robust; never a mere alternative or a reduction). It is recorded in
752
+ `next_level`, with a `title` phrased as a future spec request:
722
753
 
723
754
  ```yaml
724
755
  options:
@@ -726,13 +757,14 @@ everything at once:
726
757
  - "Token that expires after 24 hours"
727
758
  next_level:
728
759
  option: "Token that expires after 24 hours"
760
+ title: "Expire login tokens after 24 hours"
729
761
  why: "Limits the damage if a token leaks."
730
762
  ```
731
763
 
732
764
  If the user chooses it, the answer uses that exact text. If not,
733
- DevFlow treats it as a suggestion for a later specification. The
734
- recommended option is level 1, so a `next_level` marked as
735
- recommended is ignored.
765
+ DevFlow suggests `title` (or the option text when there is no title)
766
+ as a later specification. The recommended option is level 1, so a
767
+ `next_level` marked as recommended is ignored.
736
768
  4. **No deeper than this level.** More advanced decisions found along
737
769
  the way, and parts of a large request left for later, are recorded in
738
770
  `deferred`:
@@ -768,7 +800,7 @@ for each item; the agent does not write it.
768
800
  8. If artifacts exist without workflow state, diagnose with
769
801
  `devflow doctor <id>` and repair with `devflow recover <id>`.
770
802
 
771
- Available commands in `0.3.24`:
803
+ Available commands in `0.3.26`:
772
804
 
773
805
  | Command | Status |
774
806
  | --- | --- |
@@ -1001,7 +1033,7 @@ devflow approve 001
1001
1033
  ```
1002
1034
 
1003
1035
  Approval is explicit and binds the decision to the current artifact
1004
- digests. For a `0.3.24` change it binds `spec.md`, `discovery.yaml` and,
1036
+ digests. For a `0.3.26` change it binds `spec.md`, `discovery.yaml` and,
1005
1037
  when a manifest applies, the architecture manifest digest. Repeating the
1006
1038
  same approval is a no-op. If an artifact changes after validation,
1007
1039
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -1012,7 +1044,7 @@ and names the pending questions and assumptions. Approval also rejects a
1012
1044
  specification whose section 7 still lists open questions. Legacy `0.2.0`
1013
1045
  changes without `discovery.yaml` remain approvable with a warning.
1014
1046
 
1015
- Only the `spec` stage is available in `0.3.24`, so `--stage` is optional
1047
+ Only the `spec` stage is available in `0.3.26`, so `--stage` is optional
1016
1048
  and defaults to `spec`. `--stage plan` and `--stage review` are
1017
1049
  rejected. There are no `plan`, `implement` or
1018
1050
  `review` commands in this release.
@@ -1219,3 +1251,22 @@ The test suite covers the core, CLI, state replay and harness adapters.
1219
1251
  Release verification additionally installs the built wheel and sdist in
1220
1252
  clean virtual environments and runs the consumer workflow from outside
1221
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.24` · 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
 
@@ -86,13 +86,28 @@ Prefer one command for both phases? Add `--auto` to the first command:
86
86
 
87
87
  ### 4. Review and approve
88
88
 
89
- Read `.devflow/specs/001-…/spec.md`. Section 10.1 lists the suggested
90
- next specs, each with its `devflow spec "..."` command. Then:
89
+ Read `.devflow/specs/001-…/spec.md`. `devflow status 001` shows a short
90
+ review checklist. You don't tick anything in the file: acceptance
91
+ criteria are verified during implementation, and editing an approved
92
+ spec invalidates the approval. Section 10.1 lists the suggested next
93
+ specs, each with its `devflow spec "..."` command. Then:
91
94
 
92
95
  ```bash
93
96
  devflow approve 001
94
97
  ```
95
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
+
96
111
  ### 5. Implement
97
112
 
98
113
  Open your agent normally (not through DevFlow) and ask:
@@ -155,6 +170,25 @@ written outside the normal flow.
155
170
  - [Changelog](CHANGELOG.md)
156
171
  - [How to publish a release](PUBLISHING.md)
157
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
+
158
192
  ## License
159
193
 
160
194
  MIT
@@ -1,6 +1,6 @@
1
1
  # DevFlow Toolkit
2
2
 
3
- **Current version: `0.3.24`.**
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.24-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:
@@ -283,6 +283,35 @@ error instead of silently switching to deterministic analysis. Pass
283
283
  `--harness none` or `--no-agent` to opt into deterministic output
284
284
  explicitly.
285
285
 
286
+ ### Local security checks
287
+
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:
291
+
292
+ - Semgrep, with rules for Django (or Python) and OWASP;
293
+ - Bandit, for Python code;
294
+ - pip-audit, for vulnerable dependencies;
295
+ - gitleaks, for secrets in the code.
296
+
297
+ pre-commit (pre-commit.com) runs these tools automatically on every
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`).
301
+
302
+ Accepting writes a managed `.pre-commit-config.yaml` with pinned hook
303
+ revisions, installs `pre-commit` with pip when it is missing and runs
304
+ `pre-commit install` when the project is a git repository. Only the
305
+ hooks that apply are added: Bandit and pip-audit for Python projects,
306
+ `p/django` rules for Django. An existing, unmanaged
307
+ `.pre-commit-config.yaml` is never overwritten. The first commit
308
+ downloads the tools; `pre-commit run --all-files` checks the whole
309
+ project.
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
+
286
315
  ## Configuration
287
316
 
288
317
  `.devflow/config.yaml` stores project settings. It references the
@@ -396,7 +425,7 @@ as an architectural constraint when it is present.
396
425
 
397
426
  ### Harnesses
398
427
 
399
- | Harness | Status in 0.3.24 |
428
+ | Harness | Status in 0.3.26 |
400
429
  | --- | --- |
401
430
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
402
431
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -685,8 +714,10 @@ everything at once:
685
714
  2. **Security is always asked, never assumed.** Basic security decisions
686
715
  are explicit questions with a recommended option and a short
687
716
  explanation, so the user learns them by answering.
688
- 3. **Every question offers a next level.** One option takes the decision
689
- one level further. It is recorded in `next_level`:
717
+ 3. **Questions offer a next level when a real improvement exists.** One
718
+ option takes the decision one level further (more secure, capable or
719
+ robust; never a mere alternative or a reduction). It is recorded in
720
+ `next_level`, with a `title` phrased as a future spec request:
690
721
 
691
722
  ```yaml
692
723
  options:
@@ -694,13 +725,14 @@ everything at once:
694
725
  - "Token that expires after 24 hours"
695
726
  next_level:
696
727
  option: "Token that expires after 24 hours"
728
+ title: "Expire login tokens after 24 hours"
697
729
  why: "Limits the damage if a token leaks."
698
730
  ```
699
731
 
700
732
  If the user chooses it, the answer uses that exact text. If not,
701
- DevFlow treats it as a suggestion for a later specification. The
702
- recommended option is level 1, so a `next_level` marked as
703
- recommended is ignored.
733
+ DevFlow suggests `title` (or the option text when there is no title)
734
+ as a later specification. The recommended option is level 1, so a
735
+ `next_level` marked as recommended is ignored.
704
736
  4. **No deeper than this level.** More advanced decisions found along
705
737
  the way, and parts of a large request left for later, are recorded in
706
738
  `deferred`:
@@ -736,7 +768,7 @@ for each item; the agent does not write it.
736
768
  8. If artifacts exist without workflow state, diagnose with
737
769
  `devflow doctor <id>` and repair with `devflow recover <id>`.
738
770
 
739
- Available commands in `0.3.24`:
771
+ Available commands in `0.3.26`:
740
772
 
741
773
  | Command | Status |
742
774
  | --- | --- |
@@ -969,7 +1001,7 @@ devflow approve 001
969
1001
  ```
970
1002
 
971
1003
  Approval is explicit and binds the decision to the current artifact
972
- digests. For a `0.3.24` change it binds `spec.md`, `discovery.yaml` and,
1004
+ digests. For a `0.3.26` change it binds `spec.md`, `discovery.yaml` and,
973
1005
  when a manifest applies, the architecture manifest digest. Repeating the
974
1006
  same approval is a no-op. If an artifact changes after validation,
975
1007
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -980,7 +1012,7 @@ and names the pending questions and assumptions. Approval also rejects a
980
1012
  specification whose section 7 still lists open questions. Legacy `0.2.0`
981
1013
  changes without `discovery.yaml` remain approvable with a warning.
982
1014
 
983
- Only the `spec` stage is available in `0.3.24`, so `--stage` is optional
1015
+ Only the `spec` stage is available in `0.3.26`, so `--stage` is optional
984
1016
  and defaults to `spec`. `--stage plan` and `--stage review` are
985
1017
  rejected. There are no `plan`, `implement` or
986
1018
  `review` commands in this release.
@@ -1187,3 +1219,22 @@ The test suite covers the core, CLI, state replay and harness adapters.
1187
1219
  Release verification additionally installs the built wheel and sdist in
1188
1220
  clean virtual environments and runs the consumer workflow from outside
1189
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.24"
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,6 +37,10 @@ from devflow.core.ports import (
37
37
  SetupResult,
38
38
  build_setup_context,
39
39
  )
40
+ from devflow.commands.security import (
41
+ decline_security_tools,
42
+ install_security_tools,
43
+ )
40
44
  from devflow.core.profile_manager import ProfileError, ProfileManager
41
45
  from devflow.core.project import ProjectDetector
42
46
  from devflow.models.profile import Profile
@@ -113,6 +117,15 @@ def init(
113
117
  "during an interactive init."
114
118
  ),
115
119
  ),
120
+ security_tools: Optional[bool] = typer.Option(
121
+ None,
122
+ "--security-tools/--no-security-tools",
123
+ help=(
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."
127
+ ),
128
+ ),
116
129
  ) -> None:
117
130
  """Initialize DevFlow in a project."""
118
131
  try:
@@ -127,6 +140,7 @@ def init(
127
140
  project_mode,
128
141
  language,
129
142
  model,
143
+ security_tools,
130
144
  )
131
145
  except (
132
146
  ArchitectureError,
@@ -151,6 +165,7 @@ def _initialize(
151
165
  project_mode: Optional[str],
152
166
  language: Optional[str],
153
167
  model: Optional[str],
168
+ security_tools: Optional[bool] = None,
154
169
  ) -> None:
155
170
  requested_harness = _requested_harness(harness, no_agent)
156
171
  requested_model = (model or "").strip()
@@ -216,6 +231,10 @@ def _initialize(
216
231
  model_override=model is not None,
217
232
  allow_prompt=not yes and sys.stdin.isatty(),
218
233
  )
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())
219
238
  return
220
239
 
221
240
  selected = list(explicit_profiles) or detected_names
@@ -323,6 +342,10 @@ def _initialize(
323
342
  f"[green]Specifications directory:[/green] "
324
343
  f"{config.specifications_path.relative_to(root)}"
325
344
  )
345
+ if security_tools:
346
+ install_security_tools(config, project, console)
347
+ elif security_tools is False:
348
+ decline_security_tools(config)
326
349
  console.print(
327
350
  "\nNext: [bold]devflow spec \"Describe the change\"[/bold]"
328
351
  )
@@ -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
+ )
@@ -33,6 +33,14 @@ from devflow.core.state import (
33
33
  console = Console()
34
34
  error_console = Console(stderr=True)
35
35
 
36
+ _REVIEW_CHECKLIST = (
37
+ "The scope matches the request and the Discovery decisions.",
38
+ "Every FR-XXX has at least one AC-XXX that verifies it.",
39
+ "Every AC-XXX can be checked by a test or an inspection.",
40
+ "Security risks in section 4 are mitigated or explicitly accepted.",
41
+ "Section 10 excludes what you do not want built now.",
42
+ )
43
+
36
44
 
37
45
  def status(
38
46
  spec_id: str = typer.Argument(
@@ -127,6 +135,16 @@ def _status(spec_id: str, path: Path) -> None:
127
135
  "They are not approved and do not advance the change.[/dim]"
128
136
  )
129
137
 
138
+ spec_record = state.artifacts.get("spec")
139
+ if (
140
+ state.status == WorkflowStatus.DRAFT.value
141
+ and spec_record is not None
142
+ and spec_record.status == ArtifactStatus.VALIDATED.value
143
+ ):
144
+ console.print("\n[bold]Review before approving[/bold]")
145
+ for item in _REVIEW_CHECKLIST:
146
+ console.print(f" - {item}")
147
+
130
148
  next_step = _next_step(current, location, discovery)
131
149
  if next_step:
132
150
  console.print(f"\n[bold]Next:[/bold] {next_step}")
@@ -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 (
@@ -490,9 +490,19 @@ class NextLevel:
490
490
 
491
491
  option: str
492
492
  why: str
493
+ title: str = ""
494
+
495
+ @property
496
+ def spec_title(self) -> str:
497
+ """Return the request to use for a later specification."""
498
+ return self.title or self.option
493
499
 
494
500
  def to_dict(self) -> dict[str, Any]:
495
- return {"option": self.option, "why": self.why}
501
+ data: dict[str, Any] = {"option": self.option}
502
+ if self.title:
503
+ data["title"] = self.title
504
+ data["why"] = self.why
505
+ return data
496
506
 
497
507
 
498
508
  @dataclass(frozen=True)
@@ -701,7 +711,7 @@ class DiscoveryDocument:
701
711
  continue
702
712
  add(
703
713
  DeferredItem(
704
- title=question.next_level.option,
714
+ title=question.next_level.spec_title,
705
715
  why=question.next_level.why,
706
716
  question_id=question.id,
707
717
  )
@@ -1310,6 +1320,10 @@ class DiscoveryManager:
1310
1320
  next_level_mapping.get("why"),
1311
1321
  f"{identifier}.next_level.why",
1312
1322
  ),
1323
+ title=_optional_text(
1324
+ next_level_mapping.get("title"),
1325
+ f"{identifier}.next_level.title",
1326
+ ) or "",
1313
1327
  )
1314
1328
  # The recommended option is level 1, never the next level.
1315
1329
  if _RECOMMENDED.search(next_level.option):