devflow-toolkit 0.3.2__tar.gz → 0.3.4__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 (77) hide show
  1. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/CHANGELOG.md +44 -0
  2. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/PKG-INFO +92 -31
  3. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/README.md +91 -30
  4. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/pyproject.toml +1 -1
  5. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/cli.py +1 -1
  6. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/approve.py +1 -1
  7. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/doctor.py +12 -0
  8. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/spec.py +43 -4
  9. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/status.py +1 -0
  10. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/discovery.py +317 -26
  11. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/recovery.py +45 -0
  12. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/spec_workflow.py +145 -12
  13. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/specification.py +9 -25
  14. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/manager.py +23 -0
  15. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/prompts/__init__.py +34 -17
  16. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/prompts/discovery.md +58 -9
  17. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/prompts/spec.greenfield.md +13 -7
  18. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/prompts/spec.md +12 -6
  19. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_cli.py +1 -1
  20. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_discovery.py +97 -8
  21. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_harness_adapters.py +67 -1
  22. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_recovery.py +44 -0
  23. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_spec_workflow.py +63 -1
  24. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/.gitignore +0 -0
  25. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/LICENSE +0 -0
  26. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/__init__.py +0 -0
  27. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/__init__.py +0 -0
  28. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/agents.py +0 -0
  29. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/base.py +0 -0
  30. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/claude_code.py +0 -0
  31. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/codex.py +0 -0
  32. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/detector.py +0 -0
  33. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/instructions.py +0 -0
  34. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/kiro.py +0 -0
  35. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/opencode.py +0 -0
  36. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/adapters/registry.py +0 -0
  37. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/__init__.py +0 -0
  38. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/harness.py +0 -0
  39. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/init.py +0 -0
  40. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/commands/recover.py +0 -0
  41. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/__init__.py +0 -0
  42. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/architecture.py +0 -0
  43. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/artifacts/__init__.py +0 -0
  44. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/artifacts/errors.py +0 -0
  45. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/artifacts/models.py +0 -0
  46. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/artifacts/store.py +0 -0
  47. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/clock.py +0 -0
  48. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/config.py +0 -0
  49. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/constitution.py +0 -0
  50. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/ports.py +0 -0
  51. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/profile_manager.py +0 -0
  52. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/project.py +0 -0
  53. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/__init__.py +0 -0
  54. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/errors.py +0 -0
  55. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/events.py +0 -0
  56. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/locator.py +0 -0
  57. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/lock.py +0 -0
  58. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/models.py +0 -0
  59. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/core/state/transitions.py +0 -0
  60. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/models/__init__.py +0 -0
  61. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/models/profile.py +0 -0
  62. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/models/project.py +0 -0
  63. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  64. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  65. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  66. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  67. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  68. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/base/profile.yaml +0 -0
  69. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  70. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  71. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  72. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  73. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_event_log.py +0 -0
  74. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_greenfield.py +0 -0
  75. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_hardening.py +0 -0
  76. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_state.py +0 -0
  77. {devflow_toolkit-0.3.2 → devflow_toolkit-0.3.4}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,50 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.4 - 2026-11-04
6
+
7
+ ### Changed
8
+
9
+ - Discovery is now strict: every question must be answered, including
10
+ questions marked `blocking: false`, and every proposed assumption
11
+ must be accepted before a specification is generated or approved.
12
+ `blocking` only prioritizes the conversation.
13
+ - Discovery now covers interpretation, authentication and
14
+ authorization, moderation, data lifecycle, validation, ordering,
15
+ administration, compatibility and out-of-scope decisions. The
16
+ discovery prompt and the deterministic planner add these questions
17
+ for user-generated content such as comments.
18
+ - `spec.md` is valid only when section 7 is exactly `None.`. When the
19
+ specification agent finds an unanswered decision, DevFlow archives
20
+ the generated document, appends the question to `discovery.yaml`
21
+ with a new `Qn` identifier, and returns the change to
22
+ `awaiting_clarification` instead of accepting the question in the
23
+ specification.
24
+ - `devflow approve --stage spec` rejects a specification whose section
25
+ 7 still lists open questions.
26
+ - Legacy changes without `discovery.yaml` keep their previous behavior.
27
+ - Package version is `0.3.4`.
28
+
29
+ ## 0.3.3 - 2026-11-04
30
+
31
+ ### Added
32
+
33
+ - Interactive `devflow spec` now stops after Discovery with a visible
34
+ checkpoint. It prints the exact `devflow spec --continue <id>
35
+ --harness <name>` command so the specification can run with a
36
+ different harness.
37
+ - `--auto` preserves the previous one-shot behavior: Discovery and the
38
+ specification run in the same invocation.
39
+ - `devflow doctor` now suggests `devflow spec --continue <id>` when
40
+ Discovery is complete but `spec.md` is missing.
41
+
42
+ ### Changed
43
+
44
+ - `devflow spec --continue` creates missing workflow state when a
45
+ complete `discovery.yaml` exists. An interrupted run no longer blocks
46
+ resume with "No workflow state found".
47
+ - Package version is `0.3.3`.
48
+
5
49
  ## 0.3.2 - 2026-11-03
6
50
 
7
51
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Specification workflow toolkit for AI-assisted software changes
5
5
  Author: DevFlow contributors
6
6
  License-Expression: MIT
@@ -42,17 +42,21 @@ anyone starts implementing it. DevFlow owns the workflow state; the
42
42
  selected agent harness is only the execution backend that drafts the
43
43
  specification.
44
44
 
45
- This is the `0.3.2` MVP. It implements the **discovery and
45
+ This is the `0.3.4` MVP. It implements the **discovery and
46
46
  specification stages only**. It supports two specification contexts:
47
47
  **Existing Project** (the default) and **Greenfield**. It is not a
48
48
  complete SDD platform and does not include planning, implementation or
49
49
  review workflows.
50
50
 
51
51
  Discovery decides whether a request is ready to become a
52
- specification. A specification is only generated when every blocking
53
- question has an explicit answer and every proposed assumption has been
52
+ specification. A specification is only generated when every question
53
+ has an explicit answer and every proposed assumption has been
54
54
  explicitly accepted. Discovery is persisted, so an incomplete request
55
- can be resumed across sessions and agent harnesses.
55
+ can be resumed across sessions and agent harnesses. Discovery is also
56
+ the requirement-gathering stage: ambiguity, authentication,
57
+ permissions, moderation, data lifecycle, validation, ordering,
58
+ administration, compatibility and out-of-scope decisions must be
59
+ resolved there, not in `spec.md`.
56
60
 
57
61
  ## The problem it solves
58
62
 
@@ -114,7 +118,7 @@ pip install devflow-toolkit
114
118
  To install a specific built artifact instead:
115
119
 
116
120
  ```bash
117
- pip install devflow_toolkit-0.3.2-py3-none-any.whl
121
+ pip install devflow_toolkit-0.3.4-py3-none-any.whl
118
122
  ```
119
123
 
120
124
  Verify the installation:
@@ -278,7 +282,7 @@ as an architectural constraint when it is present.
278
282
 
279
283
  ### Harnesses
280
284
 
281
- | Harness | Status in 0.3.2 |
285
+ | Harness | Status in 0.3.4 |
282
286
  | --- | --- |
283
287
  | OpenCode | Verified end-to-end in non-interactive mode |
284
288
  | Codex | Integration files are generated, but not verified for this release |
@@ -361,18 +365,25 @@ assumptions:
361
365
  ```
362
366
 
363
367
  Each question has a `category` and an explicit `blocking` flag. The
364
- blocking categories are scope, user-visible behaviour, data and
365
- persistence, security and authentication, external integrations,
366
- architecture boundaries, new dependencies and deployment. A question
367
- may remain pending when it is genuinely non-blocking; it does not
368
- prevent specification generation.
368
+ categories are scope, user-visible behaviour, data and persistence,
369
+ security and authentication, external integrations, architecture
370
+ boundaries, new dependencies and deployment. The `blocking` flag
371
+ prioritizes the conversation; it does not make a question optional.
372
+ Every question, blocking or not, must be answered before
373
+ `discovery.yaml` can be `complete` and before a specification can be
374
+ generated.
375
+
376
+ For user-generated content, Discovery must also resolve who writes it,
377
+ who may create, edit or delete it, moderation, authentication
378
+ mechanism, validation, ordering, lifecycle on parent deletion, admin
379
+ registration, compatibility and explicit out-of-scope items.
369
380
 
370
381
  An assumption proposed by DevFlow uses `source: agent_default` and
371
382
  starts as `pending_acceptance`. It never becomes accepted automatically.
372
383
  A human must set `status: accepted` with `accepted_by` and `accepted_at`,
373
384
  or reject it and record a different decision.
374
385
 
375
- While blocking decisions remain:
386
+ While any question or assumption remains unresolved:
376
387
 
377
388
  - `discovery.yaml` and `context.md` are written;
378
389
  - no `spec.md` is generated;
@@ -393,26 +404,35 @@ specification stale, preserves it under `history/`, and generates a new
393
404
  specification bound to the new Discovery digest.
394
405
 
395
406
  The deterministic `--no-agent` path follows the same rules. It generates
396
- Discovery, records it, and stops when a blocking decision remains. It
397
- never invents an answer to continue.
407
+ Discovery, records it, and stops when any question or assumption
408
+ remains unresolved. It never invents an answer to continue.
398
409
 
399
410
  Changes created with `0.2.0` that have no `discovery.yaml` remain
400
411
  approvable as legacy changes, with an explicit warning. New changes
401
412
  require Discovery.
402
413
 
414
+ A generated specification is valid only when section 7 is exactly
415
+ `None.`. If the specification agent discovers a decision that Discovery
416
+ did not cover, DevFlow rejects the generated document, archives it,
417
+ appends the question to `discovery.yaml`, and returns the change to
418
+ `awaiting_clarification`. The question must be answered before a new
419
+ specification is generated. `devflow approve --stage spec` rejects a
420
+ specification that still lists open questions.
421
+
403
422
  ## Workflow
404
423
 
405
424
  1. Initialize the project with `devflow init`.
406
425
  2. Create a change and run Discovery.
407
- 3. Answer blocking questions and accept or reject assumptions.
426
+ 3. Answer every question and accept or reject assumptions.
408
427
  4. Generate the specification with `devflow spec --continue <id>`.
409
- 5. Review `spec.md` and resolve any remaining non-blocking questions.
428
+ 5. Review `spec.md`. It must have `None.` in section 7; unresolved
429
+ questions belong in Discovery.
410
430
  6. Record the approval.
411
431
  7. Inspect the state, artifacts and approval digests.
412
432
  8. If artifacts exist without workflow state, diagnose with
413
433
  `devflow doctor <id>` and repair with `devflow recover <id>`.
414
434
 
415
- Available commands in `0.3.2`:
435
+ Available commands in `0.3.4`:
416
436
 
417
437
  | Command | Status |
418
438
  | --- | --- |
@@ -452,13 +472,34 @@ The command:
452
472
  proposed assumptions;
453
473
  5. writes the deterministic evidence or declared architecture to
454
474
  `context.md`;
455
- 6. stops without `spec.md` when a blocking decision remains;
456
- 7. if Discovery is complete, invokes the selected harness with the
457
- shared DevFlow prompt, validates the returned specification, and
475
+ 6. stops without `spec.md` when any question or assumption remains
476
+ unresolved;
477
+ 7. in an interactive run, stops after Discovery is complete and prints
478
+ the next command, so you can choose the harness for the
479
+ specification;
480
+ 8. on `--continue` (or with `--auto`) invokes the selected harness with
481
+ the specification prompt, validates the returned specification, and
458
482
  binds it to the Discovery digest;
459
- 8. writes `spec.md` and registers the Discovery and specification
483
+ 9. writes `spec.md` and registers the Discovery and specification
460
484
  digests in the event log and the workflow projection.
461
485
 
486
+ An interactive `devflow spec` therefore uses two harness invocations:
487
+ one for Discovery and one for the specification. The first run stops at
488
+ the Discovery checkpoint. The second run resumes with the harness you
489
+ choose:
490
+
491
+ ```bash
492
+ devflow spec "Add a GET /patients endpoint"
493
+ devflow spec --continue 006 . --harness opencode
494
+ ```
495
+
496
+ Use `--auto` to run both phases in a single invocation, as earlier
497
+ releases did:
498
+
499
+ ```bash
500
+ devflow spec "Add a GET /patients endpoint" --auto
501
+ ```
502
+
462
503
  Resume an existing change:
463
504
 
464
505
  ```bash
@@ -466,10 +507,13 @@ devflow spec --continue 006
466
507
  ```
467
508
 
468
509
  `--continue` is not a new specification. It reuses the stored request
469
- and project mode, loads Discovery, and stops until blocking decisions
470
- are resolved. It reuses a current validated specification when the
471
- Discovery digest still matches; otherwise it archives the old
472
- specification and generates a new one.
510
+ and project mode, loads Discovery, and stops until every question is
511
+ answered and every assumption is accepted. It reuses a current
512
+ validated specification when the Discovery digest still matches;
513
+ otherwise it archives the old specification and generates a new one. If
514
+ an interrupted run left a complete `discovery.yaml` without
515
+ `workflow.yaml`, `--continue` creates the missing state and registers
516
+ Discovery before generating the specification.
473
517
 
474
518
  For an existing project, DevFlow inspects relevant code and
475
519
  dependencies. For Greenfield, it uses the declared architecture and
@@ -479,13 +523,18 @@ Useful options:
479
523
 
480
524
  ```bash
481
525
  devflow spec "Description" --harness opencode --mode non-interactive
526
+ devflow spec "Description" --auto
482
527
  devflow spec "Description" --no-agent
483
528
  devflow spec "Description" --language es
484
529
  devflow spec "Change in a real project" --project-mode existing
485
530
  devflow spec "Create a new service" --project-mode greenfield
486
- devflow spec --continue 006
531
+ devflow spec --continue 006 --harness opencode
487
532
  ```
488
533
 
534
+ `--auto` keeps the older one-shot flow: Discovery and the specification
535
+ run in the same invocation. Without it, an interactive run stops at the
536
+ Discovery checkpoint.
537
+
489
538
  `spec --language <code>` overrides the configured language for that run
490
539
  without changing `.devflow/config.yaml`. The deterministic `--no-agent`
491
540
  draft remains in English; the language setting applies to specifications
@@ -524,6 +573,17 @@ devflow doctor 001
524
573
  `doctor` checks the workflow, Discovery and specification, reports
525
574
  orphan artifacts, and exits non-zero when the change is unhealthy.
526
575
 
576
+ If Discovery is complete but the specification is missing (for example,
577
+ an interrupted interactive run), `doctor` prints the resume command:
578
+
579
+ ```bash
580
+ devflow spec --continue 001
581
+ ```
582
+
583
+ `--continue` creates the missing workflow state, registers the existing
584
+ Discovery digest and generates the specification without repeating
585
+ Discovery.
586
+
527
587
  If `discovery.yaml` is complete and `spec.md` is structurally valid,
528
588
  register the existing artifacts without regenerating them:
529
589
 
@@ -554,17 +614,18 @@ devflow approve 001 --stage spec
554
614
  ```
555
615
 
556
616
  Approval is explicit and binds the decision to the current artifact
557
- digests. For a `0.3.2` change it binds `spec.md`, `discovery.yaml` and,
617
+ digests. For a `0.3.4` change it binds `spec.md`, `discovery.yaml` and,
558
618
  when a manifest applies, the architecture manifest digest. Repeating the
559
619
  same approval is a no-op. If an artifact changes after validation,
560
620
  DevFlow marks it stale and refuses approval until it is regenerated and
561
621
  validated again.
562
622
 
563
623
  Discovery must be complete before approval. If it is not, approval fails
564
- and names the pending questions and assumptions. Legacy `0.2.0` changes
565
- without `discovery.yaml` remain approvable with a warning.
624
+ and names the pending questions and assumptions. Approval also rejects a
625
+ specification whose section 7 still lists open questions. Legacy `0.2.0`
626
+ changes without `discovery.yaml` remain approvable with a warning.
566
627
 
567
- Only the `spec` stage is available in `0.3.2`. `--stage plan` and
628
+ Only the `spec` stage is available in `0.3.4`. `--stage plan` and
568
629
  `--stage review` are rejected. There are no `plan`, `implement` or
569
630
  `review` commands in this release.
570
631
 
@@ -10,17 +10,21 @@ anyone starts implementing it. DevFlow owns the workflow state; the
10
10
  selected agent harness is only the execution backend that drafts the
11
11
  specification.
12
12
 
13
- This is the `0.3.2` MVP. It implements the **discovery and
13
+ This is the `0.3.4` MVP. It implements the **discovery and
14
14
  specification stages only**. It supports two specification contexts:
15
15
  **Existing Project** (the default) and **Greenfield**. It is not a
16
16
  complete SDD platform and does not include planning, implementation or
17
17
  review workflows.
18
18
 
19
19
  Discovery decides whether a request is ready to become a
20
- specification. A specification is only generated when every blocking
21
- question has an explicit answer and every proposed assumption has been
20
+ specification. A specification is only generated when every question
21
+ has an explicit answer and every proposed assumption has been
22
22
  explicitly accepted. Discovery is persisted, so an incomplete request
23
- can be resumed across sessions and agent harnesses.
23
+ can be resumed across sessions and agent harnesses. Discovery is also
24
+ the requirement-gathering stage: ambiguity, authentication,
25
+ permissions, moderation, data lifecycle, validation, ordering,
26
+ administration, compatibility and out-of-scope decisions must be
27
+ resolved there, not in `spec.md`.
24
28
 
25
29
  ## The problem it solves
26
30
 
@@ -82,7 +86,7 @@ pip install devflow-toolkit
82
86
  To install a specific built artifact instead:
83
87
 
84
88
  ```bash
85
- pip install devflow_toolkit-0.3.2-py3-none-any.whl
89
+ pip install devflow_toolkit-0.3.4-py3-none-any.whl
86
90
  ```
87
91
 
88
92
  Verify the installation:
@@ -246,7 +250,7 @@ as an architectural constraint when it is present.
246
250
 
247
251
  ### Harnesses
248
252
 
249
- | Harness | Status in 0.3.2 |
253
+ | Harness | Status in 0.3.4 |
250
254
  | --- | --- |
251
255
  | OpenCode | Verified end-to-end in non-interactive mode |
252
256
  | Codex | Integration files are generated, but not verified for this release |
@@ -329,18 +333,25 @@ assumptions:
329
333
  ```
330
334
 
331
335
  Each question has a `category` and an explicit `blocking` flag. The
332
- blocking categories are scope, user-visible behaviour, data and
333
- persistence, security and authentication, external integrations,
334
- architecture boundaries, new dependencies and deployment. A question
335
- may remain pending when it is genuinely non-blocking; it does not
336
- prevent specification generation.
336
+ categories are scope, user-visible behaviour, data and persistence,
337
+ security and authentication, external integrations, architecture
338
+ boundaries, new dependencies and deployment. The `blocking` flag
339
+ prioritizes the conversation; it does not make a question optional.
340
+ Every question, blocking or not, must be answered before
341
+ `discovery.yaml` can be `complete` and before a specification can be
342
+ generated.
343
+
344
+ For user-generated content, Discovery must also resolve who writes it,
345
+ who may create, edit or delete it, moderation, authentication
346
+ mechanism, validation, ordering, lifecycle on parent deletion, admin
347
+ registration, compatibility and explicit out-of-scope items.
337
348
 
338
349
  An assumption proposed by DevFlow uses `source: agent_default` and
339
350
  starts as `pending_acceptance`. It never becomes accepted automatically.
340
351
  A human must set `status: accepted` with `accepted_by` and `accepted_at`,
341
352
  or reject it and record a different decision.
342
353
 
343
- While blocking decisions remain:
354
+ While any question or assumption remains unresolved:
344
355
 
345
356
  - `discovery.yaml` and `context.md` are written;
346
357
  - no `spec.md` is generated;
@@ -361,26 +372,35 @@ specification stale, preserves it under `history/`, and generates a new
361
372
  specification bound to the new Discovery digest.
362
373
 
363
374
  The deterministic `--no-agent` path follows the same rules. It generates
364
- Discovery, records it, and stops when a blocking decision remains. It
365
- never invents an answer to continue.
375
+ Discovery, records it, and stops when any question or assumption
376
+ remains unresolved. It never invents an answer to continue.
366
377
 
367
378
  Changes created with `0.2.0` that have no `discovery.yaml` remain
368
379
  approvable as legacy changes, with an explicit warning. New changes
369
380
  require Discovery.
370
381
 
382
+ A generated specification is valid only when section 7 is exactly
383
+ `None.`. If the specification agent discovers a decision that Discovery
384
+ did not cover, DevFlow rejects the generated document, archives it,
385
+ appends the question to `discovery.yaml`, and returns the change to
386
+ `awaiting_clarification`. The question must be answered before a new
387
+ specification is generated. `devflow approve --stage spec` rejects a
388
+ specification that still lists open questions.
389
+
371
390
  ## Workflow
372
391
 
373
392
  1. Initialize the project with `devflow init`.
374
393
  2. Create a change and run Discovery.
375
- 3. Answer blocking questions and accept or reject assumptions.
394
+ 3. Answer every question and accept or reject assumptions.
376
395
  4. Generate the specification with `devflow spec --continue <id>`.
377
- 5. Review `spec.md` and resolve any remaining non-blocking questions.
396
+ 5. Review `spec.md`. It must have `None.` in section 7; unresolved
397
+ questions belong in Discovery.
378
398
  6. Record the approval.
379
399
  7. Inspect the state, artifacts and approval digests.
380
400
  8. If artifacts exist without workflow state, diagnose with
381
401
  `devflow doctor <id>` and repair with `devflow recover <id>`.
382
402
 
383
- Available commands in `0.3.2`:
403
+ Available commands in `0.3.4`:
384
404
 
385
405
  | Command | Status |
386
406
  | --- | --- |
@@ -420,13 +440,34 @@ The command:
420
440
  proposed assumptions;
421
441
  5. writes the deterministic evidence or declared architecture to
422
442
  `context.md`;
423
- 6. stops without `spec.md` when a blocking decision remains;
424
- 7. if Discovery is complete, invokes the selected harness with the
425
- shared DevFlow prompt, validates the returned specification, and
443
+ 6. stops without `spec.md` when any question or assumption remains
444
+ unresolved;
445
+ 7. in an interactive run, stops after Discovery is complete and prints
446
+ the next command, so you can choose the harness for the
447
+ specification;
448
+ 8. on `--continue` (or with `--auto`) invokes the selected harness with
449
+ the specification prompt, validates the returned specification, and
426
450
  binds it to the Discovery digest;
427
- 8. writes `spec.md` and registers the Discovery and specification
451
+ 9. writes `spec.md` and registers the Discovery and specification
428
452
  digests in the event log and the workflow projection.
429
453
 
454
+ An interactive `devflow spec` therefore uses two harness invocations:
455
+ one for Discovery and one for the specification. The first run stops at
456
+ the Discovery checkpoint. The second run resumes with the harness you
457
+ choose:
458
+
459
+ ```bash
460
+ devflow spec "Add a GET /patients endpoint"
461
+ devflow spec --continue 006 . --harness opencode
462
+ ```
463
+
464
+ Use `--auto` to run both phases in a single invocation, as earlier
465
+ releases did:
466
+
467
+ ```bash
468
+ devflow spec "Add a GET /patients endpoint" --auto
469
+ ```
470
+
430
471
  Resume an existing change:
431
472
 
432
473
  ```bash
@@ -434,10 +475,13 @@ devflow spec --continue 006
434
475
  ```
435
476
 
436
477
  `--continue` is not a new specification. It reuses the stored request
437
- and project mode, loads Discovery, and stops until blocking decisions
438
- are resolved. It reuses a current validated specification when the
439
- Discovery digest still matches; otherwise it archives the old
440
- specification and generates a new one.
478
+ and project mode, loads Discovery, and stops until every question is
479
+ answered and every assumption is accepted. It reuses a current
480
+ validated specification when the Discovery digest still matches;
481
+ otherwise it archives the old specification and generates a new one. If
482
+ an interrupted run left a complete `discovery.yaml` without
483
+ `workflow.yaml`, `--continue` creates the missing state and registers
484
+ Discovery before generating the specification.
441
485
 
442
486
  For an existing project, DevFlow inspects relevant code and
443
487
  dependencies. For Greenfield, it uses the declared architecture and
@@ -447,13 +491,18 @@ Useful options:
447
491
 
448
492
  ```bash
449
493
  devflow spec "Description" --harness opencode --mode non-interactive
494
+ devflow spec "Description" --auto
450
495
  devflow spec "Description" --no-agent
451
496
  devflow spec "Description" --language es
452
497
  devflow spec "Change in a real project" --project-mode existing
453
498
  devflow spec "Create a new service" --project-mode greenfield
454
- devflow spec --continue 006
499
+ devflow spec --continue 006 --harness opencode
455
500
  ```
456
501
 
502
+ `--auto` keeps the older one-shot flow: Discovery and the specification
503
+ run in the same invocation. Without it, an interactive run stops at the
504
+ Discovery checkpoint.
505
+
457
506
  `spec --language <code>` overrides the configured language for that run
458
507
  without changing `.devflow/config.yaml`. The deterministic `--no-agent`
459
508
  draft remains in English; the language setting applies to specifications
@@ -492,6 +541,17 @@ devflow doctor 001
492
541
  `doctor` checks the workflow, Discovery and specification, reports
493
542
  orphan artifacts, and exits non-zero when the change is unhealthy.
494
543
 
544
+ If Discovery is complete but the specification is missing (for example,
545
+ an interrupted interactive run), `doctor` prints the resume command:
546
+
547
+ ```bash
548
+ devflow spec --continue 001
549
+ ```
550
+
551
+ `--continue` creates the missing workflow state, registers the existing
552
+ Discovery digest and generates the specification without repeating
553
+ Discovery.
554
+
495
555
  If `discovery.yaml` is complete and `spec.md` is structurally valid,
496
556
  register the existing artifacts without regenerating them:
497
557
 
@@ -522,17 +582,18 @@ devflow approve 001 --stage spec
522
582
  ```
523
583
 
524
584
  Approval is explicit and binds the decision to the current artifact
525
- digests. For a `0.3.2` change it binds `spec.md`, `discovery.yaml` and,
585
+ digests. For a `0.3.4` change it binds `spec.md`, `discovery.yaml` and,
526
586
  when a manifest applies, the architecture manifest digest. Repeating the
527
587
  same approval is a no-op. If an artifact changes after validation,
528
588
  DevFlow marks it stale and refuses approval until it is regenerated and
529
589
  validated again.
530
590
 
531
591
  Discovery must be complete before approval. If it is not, approval fails
532
- and names the pending questions and assumptions. Legacy `0.2.0` changes
533
- without `discovery.yaml` remain approvable with a warning.
592
+ and names the pending questions and assumptions. Approval also rejects a
593
+ specification whose section 7 still lists open questions. Legacy `0.2.0`
594
+ changes without `discovery.yaml` remain approvable with a warning.
534
595
 
535
- Only the `spec` stage is available in `0.3.2`. `--stage plan` and
596
+ Only the `spec` stage is available in `0.3.4`. `--stage plan` and
536
597
  `--stage review` are rejected. There are no `plan`, `implement` or
537
598
  `review` commands in this release.
538
599
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -35,7 +35,7 @@ def version() -> None:
35
35
  try:
36
36
  current_version = package_version("devflow-toolkit")
37
37
  except PackageNotFoundError:
38
- current_version = "0.3.2"
38
+ current_version = "0.3.4"
39
39
  console.print(f"DevFlow v{current_version}")
40
40
 
41
41
 
@@ -57,7 +57,7 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
57
57
  normalized = stage.strip().lower()
58
58
  if normalized != "spec":
59
59
  msg = (
60
- f"Stage '{stage}' is not available in DevFlow 0.3.2. "
60
+ f"Stage '{stage}' is not available in DevFlow 0.3.4. "
61
61
  "Only the 'spec' stage can be approved."
62
62
  )
63
63
  raise UnsupportedStageError(msg)
@@ -91,6 +91,18 @@ def _doctor(spec_id: str, path: Path) -> bool:
91
91
  "[bold]Next:[/bold] "
92
92
  f"devflow recover {location.spec_id} {root}"
93
93
  )
94
+ elif inspection.can_resume:
95
+ console.print(
96
+ "\n[bold yellow]Diagnosis: Discovery is complete but the "
97
+ "specification is missing.[/bold yellow]"
98
+ )
99
+ console.print(
100
+ "[bold]Next:[/bold] "
101
+ f"devflow spec --continue {location.spec_id} {root}"
102
+ )
103
+ console.print(
104
+ "[dim]The existing Discovery record will be reused.[/dim]"
105
+ )
94
106
  else:
95
107
  console.print(
96
108
  "\n[bold yellow]Diagnosis: needs attention.[/bold yellow]"