devflow-toolkit 0.3.20__tar.gz → 0.3.21__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 (81) hide show
  1. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/CHANGELOG.md +25 -0
  2. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/PKG-INFO +30 -14
  3. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/README.md +29 -13
  4. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/pyproject.toml +1 -1
  5. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/approve.py +5 -2
  6. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/status.py +56 -1
  7. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_discovery.py +4 -0
  8. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_state.py +14 -1
  9. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/.gitignore +0 -0
  10. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/LICENSE +0 -0
  11. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/__init__.py +0 -0
  12. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/__init__.py +0 -0
  13. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/agents.py +0 -0
  14. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/antigravity.py +0 -0
  15. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/base.py +0 -0
  16. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/claude_code.py +0 -0
  17. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/codex.py +0 -0
  18. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/detector.py +0 -0
  19. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/instructions.py +0 -0
  20. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/kiro.py +0 -0
  21. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/opencode.py +0 -0
  22. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/adapters/registry.py +0 -0
  23. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/cli.py +0 -0
  24. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/__init__.py +0 -0
  25. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/config.py +0 -0
  26. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/doctor.py +0 -0
  27. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/harness.py +0 -0
  28. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/init.py +0 -0
  29. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/recover.py +0 -0
  30. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/commands/spec.py +0 -0
  31. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/__init__.py +0 -0
  32. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/architecture.py +0 -0
  33. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/artifacts/__init__.py +0 -0
  34. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/artifacts/errors.py +0 -0
  35. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/artifacts/models.py +0 -0
  36. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/artifacts/store.py +0 -0
  37. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/clock.py +0 -0
  38. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/config.py +0 -0
  39. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/constitution.py +0 -0
  40. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/discovery.py +0 -0
  41. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/file_types.py +0 -0
  42. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/ports.py +0 -0
  43. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/profile_manager.py +0 -0
  44. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/project.py +0 -0
  45. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/recovery.py +0 -0
  46. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/spec_workflow.py +0 -0
  47. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/specification.py +0 -0
  48. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/__init__.py +0 -0
  49. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/errors.py +0 -0
  50. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/events.py +0 -0
  51. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/locator.py +0 -0
  52. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/lock.py +0 -0
  53. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/manager.py +0 -0
  54. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/models.py +0 -0
  55. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/core/state/transitions.py +0 -0
  56. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/models/__init__.py +0 -0
  57. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/models/profile.py +0 -0
  58. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/models/project.py +0 -0
  59. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  60. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  61. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  62. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  63. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  64. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/base/profile.yaml +0 -0
  65. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  66. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  67. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  68. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  69. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/prompts/__init__.py +0 -0
  70. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/prompts/discovery-repair.md +0 -0
  71. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/prompts/discovery.md +0 -0
  72. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/src/devflow/prompts/spec.md +0 -0
  73. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_cli.py +0 -0
  74. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_discovery_decisions.py +0 -0
  75. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_event_log.py +0 -0
  76. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_greenfield.py +0 -0
  77. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_hardening.py +0 -0
  78. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_harness_adapters.py +0 -0
  79. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_recovery.py +0 -0
  80. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_spec_workflow.py +0 -0
  81. {devflow_toolkit-0.3.20 → devflow_toolkit-0.3.21}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,31 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.21 - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - `devflow status` ends with a `Next:` line: continue Discovery,
10
+ approve the validated spec, implement the approved spec with a coding
11
+ agent, or run `devflow doctor` when an artifact is stale or orphaned.
12
+
13
+ ### Changed
14
+
15
+ - `devflow approve 001` is the documented form. `--stage` remains
16
+ optional and defaults to `spec`.
17
+ - `devflow status` marks a blocked state in the status line, for
18
+ example `spec_approved (blocked: spec (stale))`, instead of showing it
19
+ as a plain approved change.
20
+
21
+ ### Fixed
22
+
23
+ - The unsupported-stage error of `devflow approve` no longer names the
24
+ stale version `0.3.17`.
25
+
26
+ ### Package
27
+
28
+ - Package version is `0.3.21`.
29
+
5
30
  ## 0.3.20 - 2026-11-09
6
31
 
7
32
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.20
3
+ Version: 0.3.21
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.20`.**
35
+ **Current version: `0.3.21`.**
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.20-py3-none-any.whl
155
+ pip install devflow_toolkit-0.3.21-py3-none-any.whl
156
156
  ```
157
157
 
158
158
  Verify the installation:
@@ -207,7 +207,7 @@ devflow spec --continue 001
207
207
 
208
208
  ```bash
209
209
  devflow status 001
210
- devflow approve 001 --stage spec
210
+ devflow approve 001
211
211
  ```
212
212
 
213
213
  7. Start the next change. The stored language and model are reused:
@@ -428,7 +428,7 @@ as an architectural constraint when it is present.
428
428
 
429
429
  ### Harnesses
430
430
 
431
- | Harness | Status in 0.3.20 |
431
+ | Harness | Status in 0.3.21 |
432
432
  | --- | --- |
433
433
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
434
434
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -642,7 +642,7 @@ While any decision is pending or any assumption remains unaccepted:
642
642
 
643
643
  - `discovery.yaml` and `context.md` are written;
644
644
  - no `spec.md` is generated;
645
- - `devflow approve --stage spec` refuses the change;
645
+ - `devflow approve` refuses the change;
646
646
  - the workflow status is `awaiting_clarification`.
647
647
 
648
648
  `context.md` is the single generated context file. Its
@@ -680,7 +680,7 @@ A generated specification is valid only when section 7 is exactly
680
680
  did not cover, DevFlow rejects the generated document, archives it,
681
681
  appends the question to `discovery.yaml`, and returns the change to
682
682
  `awaiting_clarification`. The question must be answered before a new
683
- specification is generated. `devflow approve --stage spec` rejects a
683
+ specification is generated. `devflow approve` rejects a
684
684
  specification that still lists open questions.
685
685
 
686
686
  ## Workflow
@@ -696,13 +696,13 @@ specification that still lists open questions.
696
696
  8. If artifacts exist without workflow state, diagnose with
697
697
  `devflow doctor <id>` and repair with `devflow recover <id>`.
698
698
 
699
- Available commands in `0.3.20`:
699
+ Available commands in `0.3.21`:
700
700
 
701
701
  | Command | Status |
702
702
  | --- | --- |
703
703
  | `devflow init` | Implemented |
704
704
  | `devflow spec` | Implemented: Discovery, specification, and `--continue` |
705
- | `devflow approve <id> --stage spec` | Implemented |
705
+ | `devflow approve <id>` (stage `spec` by default) | Implemented |
706
706
  | `devflow status <id>` | Implemented |
707
707
  | `devflow doctor <id>` | Implemented: read-only diagnostics |
708
708
  | `devflow recover <id>` | Implemented: register existing artifacts |
@@ -856,6 +856,21 @@ devflow status 001-add-a-get-patients-endpoint
856
856
  approvals, stale artifacts and orphan files. It reconciles
857
857
  `workflow.yaml` from `events.jsonl` before reporting.
858
858
 
859
+ It ends with a `Next:` line:
860
+
861
+ | State | Next |
862
+ | --- | --- |
863
+ | Discovery pending | `devflow spec --continue 001` |
864
+ | Specification validated | review `spec.md`, then `devflow approve 001` |
865
+ | Specification approved | ask your coding agent to implement `spec.md` |
866
+ | Stale artifact or orphan file | `devflow doctor 001` |
867
+
868
+ A stale artifact also appears in the status line, for example
869
+ `spec_approved (blocked: spec (stale))`.
870
+
871
+ Use `status` day to day. `doctor` is for a change that `status` reports
872
+ as blocked, or that has files on disk without workflow state.
873
+
859
874
  ### Diagnose and recover a change
860
875
 
861
876
  If `context.md`, `discovery.yaml` or `spec.md` were written outside
@@ -899,7 +914,7 @@ Recovery does not bypass review. After recovering, inspect
899
914
  `devflow status 001`, then approve explicitly:
900
915
 
901
916
  ```bash
902
- devflow approve 001 --stage spec
917
+ devflow approve 001
903
918
  ```
904
919
 
905
920
  If Discovery is incomplete or `spec.md` is invalid, `recover` refuses to
@@ -909,11 +924,11 @@ register the artifacts and names the problem. Resolve it with
909
924
  ### Approve the specification
910
925
 
911
926
  ```bash
912
- devflow approve 001 --stage spec
927
+ devflow approve 001
913
928
  ```
914
929
 
915
930
  Approval is explicit and binds the decision to the current artifact
916
- digests. For a `0.3.20` change it binds `spec.md`, `discovery.yaml` and,
931
+ digests. For a `0.3.21` change it binds `spec.md`, `discovery.yaml` and,
917
932
  when a manifest applies, the architecture manifest digest. Repeating the
918
933
  same approval is a no-op. If an artifact changes after validation,
919
934
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -924,8 +939,9 @@ and names the pending questions and assumptions. Approval also rejects a
924
939
  specification whose section 7 still lists open questions. Legacy `0.2.0`
925
940
  changes without `discovery.yaml` remain approvable with a warning.
926
941
 
927
- Only the `spec` stage is available in `0.3.20`. `--stage plan` and
928
- `--stage review` are rejected. There are no `plan`, `implement` or
942
+ Only the `spec` stage is available in `0.3.21`, so `--stage` is optional
943
+ and defaults to `spec`. `--stage plan` and `--stage review` are
944
+ rejected. There are no `plan`, `implement` or
929
945
  `review` commands in this release.
930
946
 
931
947
  ### Implement an approved specification
@@ -1,6 +1,6 @@
1
1
  # DevFlow Toolkit
2
2
 
3
- **Current version: `0.3.20`.**
3
+ **Current version: `0.3.21`.**
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.20-py3-none-any.whl
123
+ pip install devflow_toolkit-0.3.21-py3-none-any.whl
124
124
  ```
125
125
 
126
126
  Verify the installation:
@@ -175,7 +175,7 @@ devflow spec --continue 001
175
175
 
176
176
  ```bash
177
177
  devflow status 001
178
- devflow approve 001 --stage spec
178
+ devflow approve 001
179
179
  ```
180
180
 
181
181
  7. Start the next change. The stored language and model are reused:
@@ -396,7 +396,7 @@ as an architectural constraint when it is present.
396
396
 
397
397
  ### Harnesses
398
398
 
399
- | Harness | Status in 0.3.20 |
399
+ | Harness | Status in 0.3.21 |
400
400
  | --- | --- |
401
401
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
402
402
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -610,7 +610,7 @@ While any decision is pending or any assumption remains unaccepted:
610
610
 
611
611
  - `discovery.yaml` and `context.md` are written;
612
612
  - no `spec.md` is generated;
613
- - `devflow approve --stage spec` refuses the change;
613
+ - `devflow approve` refuses the change;
614
614
  - the workflow status is `awaiting_clarification`.
615
615
 
616
616
  `context.md` is the single generated context file. Its
@@ -648,7 +648,7 @@ A generated specification is valid only when section 7 is exactly
648
648
  did not cover, DevFlow rejects the generated document, archives it,
649
649
  appends the question to `discovery.yaml`, and returns the change to
650
650
  `awaiting_clarification`. The question must be answered before a new
651
- specification is generated. `devflow approve --stage spec` rejects a
651
+ specification is generated. `devflow approve` rejects a
652
652
  specification that still lists open questions.
653
653
 
654
654
  ## Workflow
@@ -664,13 +664,13 @@ specification that still lists open questions.
664
664
  8. If artifacts exist without workflow state, diagnose with
665
665
  `devflow doctor <id>` and repair with `devflow recover <id>`.
666
666
 
667
- Available commands in `0.3.20`:
667
+ Available commands in `0.3.21`:
668
668
 
669
669
  | Command | Status |
670
670
  | --- | --- |
671
671
  | `devflow init` | Implemented |
672
672
  | `devflow spec` | Implemented: Discovery, specification, and `--continue` |
673
- | `devflow approve <id> --stage spec` | Implemented |
673
+ | `devflow approve <id>` (stage `spec` by default) | Implemented |
674
674
  | `devflow status <id>` | Implemented |
675
675
  | `devflow doctor <id>` | Implemented: read-only diagnostics |
676
676
  | `devflow recover <id>` | Implemented: register existing artifacts |
@@ -824,6 +824,21 @@ devflow status 001-add-a-get-patients-endpoint
824
824
  approvals, stale artifacts and orphan files. It reconciles
825
825
  `workflow.yaml` from `events.jsonl` before reporting.
826
826
 
827
+ It ends with a `Next:` line:
828
+
829
+ | State | Next |
830
+ | --- | --- |
831
+ | Discovery pending | `devflow spec --continue 001` |
832
+ | Specification validated | review `spec.md`, then `devflow approve 001` |
833
+ | Specification approved | ask your coding agent to implement `spec.md` |
834
+ | Stale artifact or orphan file | `devflow doctor 001` |
835
+
836
+ A stale artifact also appears in the status line, for example
837
+ `spec_approved (blocked: spec (stale))`.
838
+
839
+ Use `status` day to day. `doctor` is for a change that `status` reports
840
+ as blocked, or that has files on disk without workflow state.
841
+
827
842
  ### Diagnose and recover a change
828
843
 
829
844
  If `context.md`, `discovery.yaml` or `spec.md` were written outside
@@ -867,7 +882,7 @@ Recovery does not bypass review. After recovering, inspect
867
882
  `devflow status 001`, then approve explicitly:
868
883
 
869
884
  ```bash
870
- devflow approve 001 --stage spec
885
+ devflow approve 001
871
886
  ```
872
887
 
873
888
  If Discovery is incomplete or `spec.md` is invalid, `recover` refuses to
@@ -877,11 +892,11 @@ register the artifacts and names the problem. Resolve it with
877
892
  ### Approve the specification
878
893
 
879
894
  ```bash
880
- devflow approve 001 --stage spec
895
+ devflow approve 001
881
896
  ```
882
897
 
883
898
  Approval is explicit and binds the decision to the current artifact
884
- digests. For a `0.3.20` change it binds `spec.md`, `discovery.yaml` and,
899
+ digests. For a `0.3.21` change it binds `spec.md`, `discovery.yaml` and,
885
900
  when a manifest applies, the architecture manifest digest. Repeating the
886
901
  same approval is a no-op. If an artifact changes after validation,
887
902
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -892,8 +907,9 @@ and names the pending questions and assumptions. Approval also rejects a
892
907
  specification whose section 7 still lists open questions. Legacy `0.2.0`
893
908
  changes without `discovery.yaml` remain approvable with a warning.
894
909
 
895
- Only the `spec` stage is available in `0.3.20`. `--stage plan` and
896
- `--stage review` are rejected. There are no `plan`, `implement` or
910
+ Only the `spec` stage is available in `0.3.21`, so `--stage` is optional
911
+ and defaults to `spec`. `--stage plan` and `--stage review` are
912
+ rejected. There are no `plan`, `implement` or
897
913
  `review` commands in this release.
898
914
 
899
915
  ### Implement an approved specification
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.20"
7
+ version = "0.3.21"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -34,7 +34,10 @@ def approve(
34
34
  stage: str = typer.Option(
35
35
  "spec",
36
36
  "--stage",
37
- help="Stage to approve. Only 'spec' is available in this release.",
37
+ help=(
38
+ "Stage to approve. Defaults to 'spec', the only stage available "
39
+ "in this release."
40
+ ),
38
41
  ),
39
42
  ) -> None:
40
43
  """Approve the validated artifacts of a workflow stage."""
@@ -57,7 +60,7 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
57
60
  normalized = stage.strip().lower()
58
61
  if normalized != "spec":
59
62
  msg = (
60
- f"Stage '{stage}' is not available in DevFlow 0.3.17. "
63
+ f"Stage '{stage}' is not available in this release. "
61
64
  "Only the 'spec' stage can be approved."
62
65
  )
63
66
  raise UnsupportedStageError(msg)
@@ -8,6 +8,7 @@ import typer
8
8
  from rich.console import Console
9
9
 
10
10
  from devflow.core.artifacts.errors import ArtifactError
11
+ from devflow.core.artifacts.models import ArtifactStatus
11
12
  from devflow.core.config import (
12
13
  ConfigError,
13
14
  ConfigManager,
@@ -17,9 +18,12 @@ from devflow.core.discovery import DiscoveryError, DiscoveryManager
17
18
  from devflow.core.project import ProjectDetector
18
19
  from devflow.core.state import (
19
20
  ChangeLocation,
21
+ ChangeStatus,
20
22
  StateError,
21
23
  WorkflowLocator,
22
24
  WorkflowStateManager,
25
+ WorkflowStatus,
26
+ artifact_blockers,
23
27
  )
24
28
 
25
29
  console = Console()
@@ -64,7 +68,17 @@ def _status(spec_id: str, path: Path) -> None:
64
68
 
65
69
  console.print(f"[bold]Change:[/bold] {location.change}")
66
70
  console.print(f"[bold]Spec id:[/bold] {location.spec_id}")
67
- console.print(f"[bold]Status:[/bold] {state.status}")
71
+ blockers = (
72
+ artifact_blockers(state, state.status)
73
+ if state.status != WorkflowStatus.DRAFT.value
74
+ else ()
75
+ )
76
+ status_line = f"[bold]Status:[/bold] {state.status}"
77
+ if blockers:
78
+ status_line += (
79
+ " [yellow](blocked: " + ", ".join(blockers) + ")[/yellow]"
80
+ )
81
+ console.print(status_line)
68
82
  console.print(f"[bold]Updated:[/bold] {state.updated_at or 'unknown'}")
69
83
  if current.last_event is not None:
70
84
  console.print(
@@ -109,6 +123,47 @@ def _status(spec_id: str, path: Path) -> None:
109
123
  "They are not approved and do not advance the change.[/dim]"
110
124
  )
111
125
 
126
+ next_step = _next_step(current, location)
127
+ if next_step:
128
+ console.print(f"\n[bold]Next:[/bold] {next_step}")
129
+
130
+
131
+ def _next_step(
132
+ current: ChangeStatus,
133
+ location: ChangeLocation,
134
+ ) -> str:
135
+ """Suggest the next action for the current workflow state."""
136
+ state = current.state
137
+ spec_id = location.spec_id
138
+ artifacts = state.artifacts
139
+ stale = any(
140
+ record.status == ArtifactStatus.STALE.value
141
+ for record in artifacts.values()
142
+ )
143
+ if stale or current.orphans:
144
+ return f"devflow doctor {spec_id}"
145
+
146
+ spec = artifacts.get("spec")
147
+ if state.status == WorkflowStatus.SPEC_APPROVED.value:
148
+ spec_path = (
149
+ spec.path
150
+ if spec is not None
151
+ else f"{location.change}/spec.md"
152
+ )
153
+ return f"ask your coding agent to implement `{spec_path}`"
154
+ if (
155
+ state.status == WorkflowStatus.DRAFT.value
156
+ and spec is not None
157
+ and spec.status == ArtifactStatus.VALIDATED.value
158
+ ):
159
+ return f"review spec.md, then devflow approve {spec_id}"
160
+ if state.status in {
161
+ WorkflowStatus.DRAFT.value,
162
+ WorkflowStatus.AWAITING_CLARIFICATION.value,
163
+ }:
164
+ return f"devflow spec --continue {spec_id}"
165
+ return ""
166
+
112
167
 
113
168
  def _print_discovery(
114
169
  *,
@@ -567,6 +567,10 @@ def test_blocked_discovery_cannot_be_approved(tmp_path: Path) -> None:
567
567
  assert "discovery is not complete" in approval.output
568
568
  assert not (_change_directory(tmp_path) / "spec.md").exists()
569
569
 
570
+ status = runner.invoke(app, ["status", "001", str(tmp_path)])
571
+ assert status.exit_code == 0, status.output
572
+ assert "Next: devflow spec --continue 001" in status.output
573
+
570
574
 
571
575
  def test_continue_generates_a_digest_bound_specification(
572
576
  tmp_path: Path,
@@ -424,14 +424,24 @@ def test_cli_status_approve_and_stale_detection(
424
424
  assert status_result.exit_code == 0, status_result.output
425
425
  assert "Status: draft" in status_result.output
426
426
  assert "validated" in status_result.output
427
+ assert "Next: review spec.md, then devflow approve 001" in (
428
+ status_result.output
429
+ )
427
430
 
428
431
  approve_result = runner.invoke(
429
432
  app,
430
- ["approve", change, str(tmp_path), "--stage", "spec"],
433
+ ["approve", change, str(tmp_path)],
431
434
  )
432
435
  assert approve_result.exit_code == 0, approve_result.output
433
436
  assert "Workflow status: spec_approved" in approve_result.output
434
437
 
438
+ approved_status = runner.invoke(
439
+ app,
440
+ ["status", change, str(tmp_path)],
441
+ )
442
+ assert "ask your coding agent to implement" in approved_status.output
443
+ assert "blocked" not in approved_status.output
444
+
435
445
  repeat = runner.invoke(
436
446
  app,
437
447
  ["approve", change, str(tmp_path), "--stage", "spec"],
@@ -447,6 +457,9 @@ def test_cli_status_approve_and_stale_detection(
447
457
  )
448
458
  assert stale_status.exit_code == 0, stale_status.output
449
459
  assert "stale" in stale_status.output
460
+ assert "blocked: spec (stale)" in stale_status.output
461
+ assert "Next: devflow doctor 001" in stale_status.output
462
+ assert "implement" not in stale_status.output
450
463
 
451
464
  stale_approve = runner.invoke(
452
465
  app,