devflow-toolkit 0.3.7__tar.gz → 0.3.9__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.7 → devflow_toolkit-0.3.9}/CHANGELOG.md +34 -0
  2. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/PKG-INFO +25 -12
  3. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/README.md +24 -11
  4. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/pyproject.toml +1 -1
  5. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/claude_code.py +12 -11
  6. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/cli.py +1 -1
  7. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/approve.py +1 -1
  8. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/harness.py +6 -4
  9. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/discovery.py +49 -2
  10. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/manager.py +0 -1
  11. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_discovery.py +55 -0
  12. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_harness_adapters.py +29 -5
  13. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_recovery.py +2 -2
  14. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_state.py +1 -1
  15. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/.gitignore +0 -0
  16. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/LICENSE +0 -0
  17. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/__init__.py +0 -0
  18. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/__init__.py +0 -0
  19. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/agents.py +0 -0
  20. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/base.py +0 -0
  21. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/codex.py +0 -0
  22. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/detector.py +0 -0
  23. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/instructions.py +0 -0
  24. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/kiro.py +0 -0
  25. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/opencode.py +0 -0
  26. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/adapters/registry.py +0 -0
  27. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/__init__.py +0 -0
  28. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/doctor.py +0 -0
  29. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/init.py +0 -0
  30. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/recover.py +0 -0
  31. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/spec.py +0 -0
  32. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/commands/status.py +0 -0
  33. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/__init__.py +0 -0
  34. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/architecture.py +0 -0
  35. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/artifacts/__init__.py +0 -0
  36. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/artifacts/errors.py +0 -0
  37. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/artifacts/models.py +0 -0
  38. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/artifacts/store.py +0 -0
  39. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/clock.py +0 -0
  40. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/config.py +0 -0
  41. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/constitution.py +0 -0
  42. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/ports.py +0 -0
  43. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/profile_manager.py +0 -0
  44. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/project.py +0 -0
  45. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/recovery.py +0 -0
  46. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/spec_workflow.py +0 -0
  47. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/specification.py +0 -0
  48. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/__init__.py +0 -0
  49. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/errors.py +0 -0
  50. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/events.py +0 -0
  51. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/locator.py +0 -0
  52. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/lock.py +0 -0
  53. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/models.py +0 -0
  54. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/core/state/transitions.py +0 -0
  55. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/models/__init__.py +0 -0
  56. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/models/profile.py +0 -0
  57. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/models/project.py +0 -0
  58. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  59. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  60. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  61. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  62. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  63. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/base/profile.yaml +0 -0
  64. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  65. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  66. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  67. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  68. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/prompts/__init__.py +0 -0
  69. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/prompts/discovery.md +0 -0
  70. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/prompts/spec.greenfield.md +0 -0
  71. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/src/devflow/prompts/spec.md +0 -0
  72. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_cli.py +0 -0
  73. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_event_log.py +0 -0
  74. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_greenfield.py +0 -0
  75. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_hardening.py +0 -0
  76. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_spec_workflow.py +0 -0
  77. {devflow_toolkit-0.3.7 → devflow_toolkit-0.3.9}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,40 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.9 - 2026-11-05
6
+
7
+ ### Fixed
8
+
9
+ - The deterministic Discovery planner now recognizes `seccion`/`section`
10
+ and `pantalla`/`screen` as page vocabulary, so a request such as
11
+ "Quiero crear una sección de contáctenos" raises the contact-form
12
+ submission question instead of completing with zero questions.
13
+ - Added `contactos`/`contacts` to the contact vocabulary.
14
+ - Short requests that match no known feature vocabulary now receive a
15
+ generic blocking scope question. Deterministic Discovery can no longer
16
+ declare itself complete merely because every heuristic missed.
17
+ - Interactive harness selection now fails with a clear error when no
18
+ supported harness is installed. Users must pass `--harness none` or
19
+ `--no-agent` to choose deterministic analysis explicitly.
20
+ - The `runs/` directory is created only when a run record is written,
21
+ instead of on every workflow initialization.
22
+ - Package version is `0.3.9`.
23
+
24
+ ## 0.3.8 - 2026-11-04
25
+
26
+ ### Fixed
27
+
28
+ - Interactive Claude Code runs now use Manual mode
29
+ (`--permission-mode manual`) instead of `dontAsk`. `AskUserQuestion`
30
+ is a user-interaction tool that no permission mode auto-approves, so
31
+ the allow-list introduced in `0.3.7` could not unblock the Discovery
32
+ dialog. Reads and writes under `.devflow/specs/` remain pre-approved;
33
+ shell, web, task and notebook tools remain denied. Non-interactive
34
+ runs keep the locked `dontAsk` mode.
35
+ - Claude Code now allows `Write` under `.devflow/specs/` in addition to
36
+ `Edit`.
37
+ - Package version is `0.3.8`.
38
+
5
39
  ## 0.3.7 - 2026-11-04
6
40
 
7
41
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: Specification workflow toolkit for AI-assisted software changes
5
5
  Author: DevFlow contributors
6
6
  License-Expression: MIT
@@ -42,7 +42,7 @@ 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.7` MVP. It implements the **discovery and
45
+ This is the `0.3.9` 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
@@ -118,7 +118,7 @@ pip install devflow-toolkit
118
118
  To install a specific built artifact instead:
119
119
 
120
120
  ```bash
121
- pip install devflow_toolkit-0.3.7-py3-none-any.whl
121
+ pip install devflow_toolkit-0.3.9-py3-none-any.whl
122
122
  ```
123
123
 
124
124
  Verify the installation:
@@ -183,6 +183,12 @@ If an explicitly selected harness is not installed, `init` still records
183
183
  the selection but prints a warning. Subsequent `spec` runs fall back to
184
184
  deterministic static analysis until the executable is available.
185
185
 
186
+ When an interactive `spec` run asks you to choose a harness and none of
187
+ the supported executables is installed, the command fails with a clear
188
+ error instead of silently switching to deterministic analysis. Pass
189
+ `--harness none` or `--no-agent` to opt into deterministic output
190
+ explicitly.
191
+
186
192
  ## Configuration
187
193
 
188
194
  `.devflow/config.yaml` stores project settings. It references the
@@ -291,7 +297,7 @@ as an architectural constraint when it is present.
291
297
 
292
298
  ### Harnesses
293
299
 
294
- | Harness | Status in 0.3.7 |
300
+ | Harness | Status in 0.3.9 |
295
301
  | --- | --- |
296
302
  | OpenCode | Verified end-to-end in non-interactive mode |
297
303
  | Codex | Integration files are generated, but not verified for this release |
@@ -340,10 +346,12 @@ not treated as the only permission boundary.
340
346
  When a harness cannot enforce a restriction technically, DevFlow prints
341
347
  a warning instead of claiming that the restriction is guaranteed.
342
348
 
343
- For Claude Code, interactive runs explicitly allow the
344
- `AskUserQuestion` tool even though the adapter uses `dontAsk` mode, so
345
- Discovery can ask the user directly. Non-interactive runs do not allow
346
- the tool.
349
+ For Claude Code, interactive runs use Manual mode
350
+ (`--permission-mode manual`) so Discovery can open the
351
+ `AskUserQuestion` dialog. Reads and writes under `.devflow/specs/` are
352
+ pre-approved, while shell, web and task tools remain denied.
353
+ Non-interactive runs keep the locked `dontAsk` mode and do not allow the
354
+ question tool.
347
355
 
348
356
  ## Discovery
349
357
 
@@ -395,6 +403,12 @@ Every question, blocking or not, must be answered before
395
403
  `discovery.yaml` can be `complete` and before a specification can be
396
404
  generated.
397
405
 
406
+ The deterministic planner recognizes contact pages, forms, comments,
407
+ authentication, persistence, deployments and architecture boundaries in
408
+ English and Spanish. If a short request does not match any known feature
409
+ vocabulary, the planner adds a generic blocking scope question instead
410
+ of marking Discovery complete with no questions.
411
+
398
412
  For user-generated content, Discovery must also resolve who writes it,
399
413
  who may create, edit or delete it, moderation, authentication
400
414
  mechanism, validation, ordering, lifecycle on parent deletion, admin
@@ -454,7 +468,7 @@ specification that still lists open questions.
454
468
  8. If artifacts exist without workflow state, diagnose with
455
469
  `devflow doctor <id>` and repair with `devflow recover <id>`.
456
470
 
457
- Available commands in `0.3.7`:
471
+ Available commands in `0.3.9`:
458
472
 
459
473
  | Command | Status |
460
474
  | --- | --- |
@@ -642,7 +656,7 @@ devflow approve 001 --stage spec
642
656
  ```
643
657
 
644
658
  Approval is explicit and binds the decision to the current artifact
645
- digests. For a `0.3.7` change it binds `spec.md`, `discovery.yaml` and,
659
+ digests. For a `0.3.9` change it binds `spec.md`, `discovery.yaml` and,
646
660
  when a manifest applies, the architecture manifest digest. Repeating the
647
661
  same approval is a no-op. If an artifact changes after validation,
648
662
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -653,7 +667,7 @@ and names the pending questions and assumptions. Approval also rejects a
653
667
  specification whose section 7 still lists open questions. Legacy `0.2.0`
654
668
  changes without `discovery.yaml` remain approvable with a warning.
655
669
 
656
- Only the `spec` stage is available in `0.3.7`. `--stage plan` and
670
+ Only the `spec` stage is available in `0.3.9`. `--stage plan` and
657
671
  `--stage review` are rejected. There are no `plan`, `implement` or
658
672
  `review` commands in this release.
659
673
 
@@ -677,7 +691,6 @@ my-project/
677
691
  │ ├── spec.md # only when Discovery is complete
678
692
  │ ├── workflow.yaml # projection of events.jsonl
679
693
  │ ├── events.jsonl # append-only source of truth
680
- │ ├── runs/ # agent run metadata
681
694
  │ └── .lock # per-change advisory lock
682
695
  ├── AGENTS.md
683
696
  ├── opencode.json # when OpenCode is selected
@@ -10,7 +10,7 @@ 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.7` MVP. It implements the **discovery and
13
+ This is the `0.3.9` 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
@@ -86,7 +86,7 @@ pip install devflow-toolkit
86
86
  To install a specific built artifact instead:
87
87
 
88
88
  ```bash
89
- pip install devflow_toolkit-0.3.7-py3-none-any.whl
89
+ pip install devflow_toolkit-0.3.9-py3-none-any.whl
90
90
  ```
91
91
 
92
92
  Verify the installation:
@@ -151,6 +151,12 @@ If an explicitly selected harness is not installed, `init` still records
151
151
  the selection but prints a warning. Subsequent `spec` runs fall back to
152
152
  deterministic static analysis until the executable is available.
153
153
 
154
+ When an interactive `spec` run asks you to choose a harness and none of
155
+ the supported executables is installed, the command fails with a clear
156
+ error instead of silently switching to deterministic analysis. Pass
157
+ `--harness none` or `--no-agent` to opt into deterministic output
158
+ explicitly.
159
+
154
160
  ## Configuration
155
161
 
156
162
  `.devflow/config.yaml` stores project settings. It references the
@@ -259,7 +265,7 @@ as an architectural constraint when it is present.
259
265
 
260
266
  ### Harnesses
261
267
 
262
- | Harness | Status in 0.3.7 |
268
+ | Harness | Status in 0.3.9 |
263
269
  | --- | --- |
264
270
  | OpenCode | Verified end-to-end in non-interactive mode |
265
271
  | Codex | Integration files are generated, but not verified for this release |
@@ -308,10 +314,12 @@ not treated as the only permission boundary.
308
314
  When a harness cannot enforce a restriction technically, DevFlow prints
309
315
  a warning instead of claiming that the restriction is guaranteed.
310
316
 
311
- For Claude Code, interactive runs explicitly allow the
312
- `AskUserQuestion` tool even though the adapter uses `dontAsk` mode, so
313
- Discovery can ask the user directly. Non-interactive runs do not allow
314
- the tool.
317
+ For Claude Code, interactive runs use Manual mode
318
+ (`--permission-mode manual`) so Discovery can open the
319
+ `AskUserQuestion` dialog. Reads and writes under `.devflow/specs/` are
320
+ pre-approved, while shell, web and task tools remain denied.
321
+ Non-interactive runs keep the locked `dontAsk` mode and do not allow the
322
+ question tool.
315
323
 
316
324
  ## Discovery
317
325
 
@@ -363,6 +371,12 @@ Every question, blocking or not, must be answered before
363
371
  `discovery.yaml` can be `complete` and before a specification can be
364
372
  generated.
365
373
 
374
+ The deterministic planner recognizes contact pages, forms, comments,
375
+ authentication, persistence, deployments and architecture boundaries in
376
+ English and Spanish. If a short request does not match any known feature
377
+ vocabulary, the planner adds a generic blocking scope question instead
378
+ of marking Discovery complete with no questions.
379
+
366
380
  For user-generated content, Discovery must also resolve who writes it,
367
381
  who may create, edit or delete it, moderation, authentication
368
382
  mechanism, validation, ordering, lifecycle on parent deletion, admin
@@ -422,7 +436,7 @@ specification that still lists open questions.
422
436
  8. If artifacts exist without workflow state, diagnose with
423
437
  `devflow doctor <id>` and repair with `devflow recover <id>`.
424
438
 
425
- Available commands in `0.3.7`:
439
+ Available commands in `0.3.9`:
426
440
 
427
441
  | Command | Status |
428
442
  | --- | --- |
@@ -610,7 +624,7 @@ devflow approve 001 --stage spec
610
624
  ```
611
625
 
612
626
  Approval is explicit and binds the decision to the current artifact
613
- digests. For a `0.3.7` change it binds `spec.md`, `discovery.yaml` and,
627
+ digests. For a `0.3.9` change it binds `spec.md`, `discovery.yaml` and,
614
628
  when a manifest applies, the architecture manifest digest. Repeating the
615
629
  same approval is a no-op. If an artifact changes after validation,
616
630
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -621,7 +635,7 @@ and names the pending questions and assumptions. Approval also rejects a
621
635
  specification whose section 7 still lists open questions. Legacy `0.2.0`
622
636
  changes without `discovery.yaml` remain approvable with a warning.
623
637
 
624
- Only the `spec` stage is available in `0.3.7`. `--stage plan` and
638
+ Only the `spec` stage is available in `0.3.9`. `--stage plan` and
625
639
  `--stage review` are rejected. There are no `plan`, `implement` or
626
640
  `review` commands in this release.
627
641
 
@@ -645,7 +659,6 @@ my-project/
645
659
  │ ├── spec.md # only when Discovery is complete
646
660
  │ ├── workflow.yaml # projection of events.jsonl
647
661
  │ ├── events.jsonl # append-only source of truth
648
- │ ├── runs/ # agent run metadata
649
662
  │ └── .lock # per-change advisory lock
650
663
  ├── AGENTS.md
651
664
  ├── opencode.json # when OpenCode is selected
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.7"
7
+ version = "0.3.9"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -56,14 +56,15 @@ class ClaudeCodeAdapter(HarnessAdapter):
56
56
  separators=(",", ":"),
57
57
  )
58
58
  root = context.root
59
+ permission_mode = (
60
+ "manual" if context.mode == "interactive" else "dontAsk"
61
+ )
59
62
 
60
63
  if context.mode == "interactive":
61
64
  argv = (
62
65
  self.executable,
63
66
  "--permission-mode",
64
- "dontAsk",
65
- "--allowedTools",
66
- "AskUserQuestion",
67
+ permission_mode,
67
68
  "--settings",
68
69
  settings,
69
70
  context.prompt,
@@ -79,7 +80,7 @@ class ClaudeCodeAdapter(HarnessAdapter):
79
80
  "--output-format",
80
81
  "text",
81
82
  "--permission-mode",
82
- "dontAsk",
83
+ permission_mode,
83
84
  "--tools",
84
85
  ",".join(tools),
85
86
  "--settings",
@@ -118,15 +119,15 @@ class ClaudeCodeAdapter(HarnessAdapter):
118
119
  if context.permissions.allow_project_read:
119
120
  allow.extend(["Read", "Grep", "Glob"])
120
121
 
121
- if context.mode == "interactive":
122
- # Discovery needs to ask the user directly. ``dontAsk`` denies
123
- # every prompt unless the tool is explicitly allowed.
124
- allow.append("AskUserQuestion")
125
-
126
122
  if context.permissions.allow_source_code_changes:
127
- allow.extend(["Edit", "Bash"])
123
+ allow.extend(["Edit", "Write", "Bash"])
128
124
  elif context.permissions.allow_spec_write:
129
- allow.append("Edit(.devflow/specs/**)")
125
+ allow.extend(
126
+ [
127
+ "Edit(.devflow/specs/**)",
128
+ "Write(.devflow/specs/**)",
129
+ ]
130
+ )
130
131
 
131
132
  deny.extend(["WebFetch", "WebSearch", "Task"])
132
133
  if not context.permissions.allow_source_code_changes:
@@ -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.7"
38
+ current_version = "0.3.9"
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.7. "
60
+ f"Stage '{stage}' is not available in DevFlow 0.3.9. "
61
61
  "Only the 'spec' stage can be approved."
62
62
  )
63
63
  raise UnsupportedStageError(msg)
@@ -53,10 +53,12 @@ def resolve_harness(
53
53
  if force_prompt and allow_prompt:
54
54
  names = [harness.name for harness in detected]
55
55
  if not names:
56
- return None, [
57
- "No supported agent harness was found on PATH. DevFlow will use "
58
- "deterministic static analysis.",
59
- ]
56
+ msg = (
57
+ "No supported agent harness was found on PATH. Install a harness "
58
+ "(codex, opencode, claude-code or kiro) or pass --harness none / "
59
+ "--no-agent to use deterministic static analysis explicitly."
60
+ )
61
+ raise ConfigError(msg)
60
62
  default = canonical if canonical in names else names[0]
61
63
  chosen = _prompt_for_harness(
62
64
  names,
@@ -114,13 +114,23 @@ _VAGUE_TERMS = {
114
114
  "soporte",
115
115
  }
116
116
 
117
- _CONTACT_WORDS = {"contact", "contacto", "contactenos"}
117
+ _CONTACT_WORDS = {
118
+ "contact",
119
+ "contacto",
120
+ "contactos",
121
+ "contacts",
122
+ "contactenos",
123
+ }
118
124
  _FORM_WORDS = {"form", "formulario"}
119
125
  _PAGE_WORDS = {
120
126
  "page",
121
127
  "pagina",
122
- "template",
128
+ "pantalla",
123
129
  "plantilla",
130
+ "screen",
131
+ "seccion",
132
+ "section",
133
+ "template",
124
134
  "view",
125
135
  "vista",
126
136
  }
@@ -385,6 +395,23 @@ _ARCHITECTURE_WORDS = {
385
395
  "refactor",
386
396
  }
387
397
 
398
+ # Vocabulary the planner understands well enough to decide that a request
399
+ # does not need a generic scope question. When a request contains none of
400
+ # these signals, a deterministic run must not silently declare Discovery
401
+ # complete just because no heuristic matched.
402
+ _PLANNER_SIGNAL_WORDS = (
403
+ _CONTACT_WORDS
404
+ | _FORM_WORDS
405
+ | _PAGE_WORDS
406
+ | _AUTH_WORDS
407
+ | _AUTH_INTEGRATION_WORDS
408
+ | _DATA_WORDS
409
+ | _COMMENT_WORDS
410
+ | _DEPLOYMENT_WORDS
411
+ | _ARCHITECTURE_WORDS
412
+ | _VAGUE_TERMS
413
+ )
414
+
388
415
 
389
416
  class DiscoveryError(Exception):
390
417
  """Raised when discovery data is missing or malformed."""
@@ -1497,6 +1524,26 @@ class DiscoveryPlanner:
1497
1524
  ),
1498
1525
  )
1499
1526
 
1527
+ if (
1528
+ not questions
1529
+ and len(keywords) < 6
1530
+ and not (words & _PLANNER_SIGNAL_WORDS)
1531
+ ):
1532
+ add_question(
1533
+ "functional_scope",
1534
+ "What exact user-visible behavior should this change add, and "
1535
+ "how should it be verified?",
1536
+ "The request is short and does not match a known feature "
1537
+ "pattern, so DevFlow cannot confirm the scope, the expected "
1538
+ "behavior or the acceptance criteria without an explicit "
1539
+ "decision.",
1540
+ (
1541
+ "Describe the intended behavior and acceptance criteria.",
1542
+ "Reuse an existing feature (describe it).",
1543
+ "Other (describe).",
1544
+ ),
1545
+ )
1546
+
1500
1547
  questions = questions[:10]
1501
1548
  question_ids = {question.id for question in questions}
1502
1549
  assumptions = [
@@ -195,7 +195,6 @@ class WorkflowStateManager:
195
195
  change: str | None = None,
196
196
  ) -> WorkflowState:
197
197
  location.directory.mkdir(parents=True, exist_ok=True)
198
- location.runs_path.mkdir(parents=True, exist_ok=True)
199
198
  state = WorkflowState(
200
199
  spec_id=spec_id or location.spec_id,
201
200
  change=change or location.change,
@@ -241,6 +241,61 @@ def test_planner_blocks_a_contact_form_and_proposes_assumption(
241
241
  assert len(document.blockers()) == 2
242
242
 
243
243
 
244
+ def test_planner_blocks_a_contact_section_in_spanish(
245
+ tmp_path: Path,
246
+ ) -> None:
247
+ document = DiscoveryPlanner().build(
248
+ request="Quiero crear una seccion de contactenos",
249
+ spec_id="001",
250
+ change="001-quiero-crear-una-seccion-de-contactenos",
251
+ project_mode="existing",
252
+ project=Project(
253
+ root=tmp_path,
254
+ name="demo",
255
+ project_type="unknown",
256
+ ),
257
+ profiles=(),
258
+ reference_paths=(),
259
+ category_paths={},
260
+ has_tests=True,
261
+ architecture=None,
262
+ now="2026-11-02T00:00:00Z",
263
+ )
264
+
265
+ assert document.status == DISCOVERY_AWAITING
266
+ assert not document.is_complete
267
+ assert document.questions[0].category == "functional_scope"
268
+ assert "contact form" in document.questions[0].question
269
+
270
+
271
+ def test_planner_asks_a_generic_scope_question_for_unknown_requests(
272
+ tmp_path: Path,
273
+ ) -> None:
274
+ document = DiscoveryPlanner().build(
275
+ request="Quiero implementar algo bonito",
276
+ spec_id="001",
277
+ change="001-quiero-implementar-algo-bonito",
278
+ project_mode="existing",
279
+ project=Project(
280
+ root=tmp_path,
281
+ name="demo",
282
+ project_type="unknown",
283
+ ),
284
+ profiles=(),
285
+ reference_paths=(),
286
+ category_paths={},
287
+ has_tests=True,
288
+ architecture=None,
289
+ now="2026-11-02T00:00:00Z",
290
+ )
291
+
292
+ assert document.status == DISCOVERY_AWAITING
293
+ assert not document.is_complete
294
+ assert len(document.questions) == 1
295
+ assert document.questions[0].category == "functional_scope"
296
+ assert document.questions[0].blocking is True
297
+
298
+
244
299
  def test_planner_blocks_comment_api_without_authorship_decision(
245
300
  tmp_path: Path,
246
301
  ) -> None:
@@ -8,6 +8,7 @@ import stat
8
8
  import sys
9
9
  from pathlib import Path
10
10
 
11
+ import pytest
11
12
  import yaml
12
13
  from typer.testing import CliRunner
13
14
 
@@ -23,7 +24,7 @@ from devflow.adapters.detector import (
23
24
  from devflow.cli import app
24
25
  from devflow.commands import harness as harness_module
25
26
  from devflow.commands.harness import resolve_harness
26
- from devflow.core.config import AgentPermissions
27
+ from devflow.core.config import AgentPermissions, ConfigError
27
28
 
28
29
  runner = CliRunner()
29
30
 
@@ -449,17 +450,20 @@ def test_codex_non_interactive_is_read_only(
449
450
  assert invocation.interactive is False
450
451
 
451
452
 
452
- def test_claude_interactive_allows_questions(
453
+ def test_claude_interactive_uses_manual_mode_for_questions(
453
454
  tmp_path: Path,
454
455
  ) -> None:
455
456
  context = _run_context(tmp_path, mode="interactive")
456
457
  invocation = ClaudeCodeAdapter().build_run(context)
457
458
  argv = invocation.argv
458
459
 
459
- assert argv[argv.index("--permission-mode") + 1] == "dontAsk"
460
- assert argv[argv.index("--allowedTools") + 1] == "AskUserQuestion"
460
+ assert argv[argv.index("--permission-mode") + 1] == "manual"
461
+ assert "--allowedTools" not in argv
461
462
  settings = json.loads(argv[argv.index("--settings") + 1])
462
- assert "AskUserQuestion" in settings["permissions"]["allow"]
463
+ allow = settings["permissions"]["allow"]
464
+ assert "AskUserQuestion" not in allow
465
+ assert "Edit(.devflow/specs/**)" in allow
466
+ assert "Write(.devflow/specs/**)" in allow
463
467
 
464
468
 
465
469
  def test_claude_non_interactive_restricts_tools(
@@ -470,8 +474,10 @@ def test_claude_non_interactive_restricts_tools(
470
474
  argv = invocation.argv
471
475
 
472
476
  assert argv[argv.index("--tools") + 1] == "Read,Grep,Glob"
477
+ assert argv[argv.index("--permission-mode") + 1] == "dontAsk"
473
478
  settings = json.loads(argv[argv.index("--settings") + 1])
474
479
  assert "Edit(.devflow/specs/**)" in settings["permissions"]["allow"]
480
+ assert "Write(.devflow/specs/**)" in settings["permissions"]["allow"]
475
481
  assert "AskUserQuestion" not in settings["permissions"]["allow"]
476
482
  assert "Bash" in settings["permissions"]["deny"]
477
483
 
@@ -686,6 +692,24 @@ def test_resolve_harness_prompts_even_with_configured_harness(
686
692
  assert calls == [(["opencode", "codex"], "opencode", True)]
687
693
 
688
694
 
695
+ def test_resolve_harness_fails_loudly_when_no_harness_is_installed(
696
+ monkeypatch: object,
697
+ ) -> None:
698
+ monkeypatch.setattr(
699
+ harness_module,
700
+ "detect_harnesses",
701
+ lambda: (),
702
+ )
703
+
704
+ with pytest.raises(ConfigError, match="No supported agent harness"):
705
+ resolve_harness(
706
+ "auto",
707
+ allow_prompt=True,
708
+ require_installed=True,
709
+ force_prompt=True,
710
+ )
711
+
712
+
689
713
  def test_init_rejects_unknown_harness_and_mode(
690
714
  tmp_path: Path,
691
715
  ) -> None:
@@ -48,7 +48,7 @@ def _orphan(root: Path) -> Path:
48
48
  change = _change(root)
49
49
  for name in ("workflow.yaml", "events.jsonl"):
50
50
  (change / name).unlink()
51
- shutil.rmtree(change / "runs")
51
+ shutil.rmtree(change / "runs", ignore_errors=True)
52
52
  return change
53
53
 
54
54
 
@@ -95,7 +95,7 @@ def test_recover_registers_existing_artifacts(tmp_path: Path) -> None:
95
95
  assert "Recovered" in result.output
96
96
  assert (change / "workflow.yaml").is_file()
97
97
  assert (change / "events.jsonl").is_file()
98
- assert (change / "runs").is_dir()
98
+ assert not (change / "runs").exists()
99
99
  assert (change / "spec.md").read_text(encoding="utf-8") == spec_before
100
100
 
101
101
  status_result = runner.invoke(
@@ -194,7 +194,7 @@ def test_initialize_change_writes_projection_and_event_log(
194
194
  assert state.created_at == "2026-10-30T12:00:00Z"
195
195
  assert directory.joinpath("events.jsonl").is_file()
196
196
  assert directory.joinpath("workflow.yaml").is_file()
197
- assert directory.joinpath("runs").is_dir()
197
+ assert not directory.joinpath("runs").exists()
198
198
  events = directory.joinpath("events.jsonl").read_text(
199
199
  encoding="utf-8"
200
200
  )
File without changes