devflow-toolkit 0.3.5__tar.gz → 0.3.7__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.5 → devflow_toolkit-0.3.7}/CHANGELOG.md +30 -0
  2. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/PKG-INFO +29 -7
  3. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/README.md +28 -6
  4. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/pyproject.toml +1 -1
  5. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/agents.py +3 -0
  6. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/claude_code.py +18 -3
  7. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/codex.py +11 -3
  8. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/instructions.py +95 -0
  9. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/kiro.py +16 -0
  10. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/opencode.py +16 -0
  11. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/cli.py +1 -1
  12. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/approve.py +1 -1
  13. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/project.py +132 -9
  14. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/ai-rag/profile.yaml +3 -0
  15. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_cli.py +78 -0
  16. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_hardening.py +16 -0
  17. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_harness_adapters.py +67 -0
  18. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/.gitignore +0 -0
  19. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/LICENSE +0 -0
  20. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/__init__.py +0 -0
  21. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/__init__.py +0 -0
  22. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/base.py +0 -0
  23. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/detector.py +0 -0
  24. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/adapters/registry.py +0 -0
  25. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/__init__.py +0 -0
  26. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/doctor.py +0 -0
  27. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/harness.py +0 -0
  28. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/init.py +0 -0
  29. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/recover.py +0 -0
  30. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/spec.py +0 -0
  31. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/commands/status.py +0 -0
  32. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/__init__.py +0 -0
  33. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/architecture.py +0 -0
  34. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/artifacts/__init__.py +0 -0
  35. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/artifacts/errors.py +0 -0
  36. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/artifacts/models.py +0 -0
  37. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/artifacts/store.py +0 -0
  38. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/clock.py +0 -0
  39. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/config.py +0 -0
  40. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/constitution.py +0 -0
  41. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/discovery.py +0 -0
  42. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/ports.py +0 -0
  43. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/profile_manager.py +0 -0
  44. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/recovery.py +0 -0
  45. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/spec_workflow.py +0 -0
  46. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/specification.py +0 -0
  47. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/__init__.py +0 -0
  48. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/errors.py +0 -0
  49. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/events.py +0 -0
  50. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/locator.py +0 -0
  51. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/lock.py +0 -0
  52. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/manager.py +0 -0
  53. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/models.py +0 -0
  54. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/core/state/transitions.py +0 -0
  55. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/models/__init__.py +0 -0
  56. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/models/profile.py +0 -0
  57. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/models/project.py +0 -0
  58. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  59. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  60. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  61. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  62. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/base/profile.yaml +0 -0
  63. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  64. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  65. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  66. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  67. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/prompts/__init__.py +0 -0
  68. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/prompts/discovery.md +0 -0
  69. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/prompts/spec.greenfield.md +0 -0
  70. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/src/devflow/prompts/spec.md +0 -0
  71. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_discovery.py +0 -0
  72. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_event_log.py +0 -0
  73. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_greenfield.py +0 -0
  74. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_recovery.py +0 -0
  75. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_spec_workflow.py +0 -0
  76. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_state.py +0 -0
  77. {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.7}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.7 - 2026-11-04
6
+
7
+ ### Fixed
8
+
9
+ - Interactive Claude Code sessions now allow the `AskUserQuestion` tool.
10
+ The adapter runs Claude Code with `--permission-mode dontAsk`, which
11
+ denied the tool and prevented Discovery from opening its question
12
+ dialog. The tool is explicitly allowed in interactive mode and remains
13
+ unavailable in non-interactive runs.
14
+ - Package version is `0.3.7`.
15
+
16
+ ## 0.3.6 - 2026-11-04
17
+
18
+ ### Added
19
+
20
+ - Stack detection now reads packages installed in a local virtual
21
+ environment (`.venv`, `venv` or `env`) when dependency manifests are
22
+ absent. Django, FastAPI and the RAG/vector stack can therefore be
23
+ detected without versioning `requirements.txt` or `pyproject.toml`.
24
+ - RAG detection recognizes `qdrant-client`, `weaviate-client`,
25
+ `pinecone-client` and `pgvector`, including the `vector-database`
26
+ capability and the `ai-rag` profile.
27
+ - Generated harness integration files are added to a managed block in
28
+ `.gitignore`. Existing entries are preserved, the block is shared
29
+ across harnesses, and unmanaged user files are never ignored.
30
+
31
+ ### Changed
32
+
33
+ - Package version is `0.3.6`.
34
+
5
35
  ## 0.3.5 - 2026-11-04
6
36
 
7
37
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.5
3
+ Version: 0.3.7
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.5` MVP. It implements the **discovery and
45
+ This is the `0.3.7` 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.5-py3-none-any.whl
121
+ pip install devflow_toolkit-0.3.7-py3-none-any.whl
122
122
  ```
123
123
 
124
124
  Verify the installation:
@@ -142,6 +142,15 @@ copies the applicable constitution documents, writes
142
142
  `.devflow/config.yaml` and generates the integration for the selected
143
143
  harness.
144
144
 
145
+ The stack is detected from `pyproject.toml`, `requirements*.txt` and
146
+ `package.json`. When those manifests are absent or incomplete, DevFlow
147
+ also reads the packages installed in a local virtual environment
148
+ (`.venv`, `venv` or `env`). This keeps Django, FastAPI and the
149
+ RAG/vector stack (`langchain`, `llama-index`, `chromadb`,
150
+ `qdrant-client`, `weaviate-client`, `pinecone-client`, `pgvector` and
151
+ `sentence-transformers`) detectable without versioning a dependency
152
+ manifest.
153
+
145
154
  Common options:
146
155
 
147
156
  ```bash
@@ -282,7 +291,7 @@ as an architectural constraint when it is present.
282
291
 
283
292
  ### Harnesses
284
293
 
285
- | Harness | Status in 0.3.5 |
294
+ | Harness | Status in 0.3.7 |
286
295
  | --- | --- |
287
296
  | OpenCode | Verified end-to-end in non-interactive mode |
288
297
  | Codex | Integration files are generated, but not verified for this release |
@@ -308,6 +317,14 @@ also select the model used by the agent, for example:
308
317
  DevFlow creates `opencode.json` only when it does not exist and never
309
318
  replaces an existing OpenCode configuration.
310
319
 
320
+ DevFlow records the files it generates for the selected harness in a
321
+ managed block inside `.gitignore`, for example `CLAUDE.md`, `AGENTS.md`,
322
+ `opencode.json` and the DevFlow agents. Existing ignore entries are
323
+ preserved, and the block is shared across harnesses, so switching
324
+ adapters keeps earlier generated files ignored. Unmanaged files that
325
+ DevFlow did not create are never added. DevFlow does not ignore
326
+ `.devflow/` or the constitution.
327
+
311
328
  ### Permissions
312
329
 
313
330
  `allow_workflow_write` controls writes to DevFlow artifacts.
@@ -323,6 +340,11 @@ not treated as the only permission boundary.
323
340
  When a harness cannot enforce a restriction technically, DevFlow prints
324
341
  a warning instead of claiming that the restriction is guaranteed.
325
342
 
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.
347
+
326
348
  ## Discovery
327
349
 
328
350
  Discovery is separate from specification. The project context decides
@@ -432,7 +454,7 @@ specification that still lists open questions.
432
454
  8. If artifacts exist without workflow state, diagnose with
433
455
  `devflow doctor <id>` and repair with `devflow recover <id>`.
434
456
 
435
- Available commands in `0.3.5`:
457
+ Available commands in `0.3.7`:
436
458
 
437
459
  | Command | Status |
438
460
  | --- | --- |
@@ -620,7 +642,7 @@ devflow approve 001 --stage spec
620
642
  ```
621
643
 
622
644
  Approval is explicit and binds the decision to the current artifact
623
- digests. For a `0.3.5` change it binds `spec.md`, `discovery.yaml` and,
645
+ digests. For a `0.3.7` change it binds `spec.md`, `discovery.yaml` and,
624
646
  when a manifest applies, the architecture manifest digest. Repeating the
625
647
  same approval is a no-op. If an artifact changes after validation,
626
648
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -631,7 +653,7 @@ and names the pending questions and assumptions. Approval also rejects a
631
653
  specification whose section 7 still lists open questions. Legacy `0.2.0`
632
654
  changes without `discovery.yaml` remain approvable with a warning.
633
655
 
634
- Only the `spec` stage is available in `0.3.5`. `--stage plan` and
656
+ Only the `spec` stage is available in `0.3.7`. `--stage plan` and
635
657
  `--stage review` are rejected. There are no `plan`, `implement` or
636
658
  `review` commands in this release.
637
659
 
@@ -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.5` MVP. It implements the **discovery and
13
+ This is the `0.3.7` 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.5-py3-none-any.whl
89
+ pip install devflow_toolkit-0.3.7-py3-none-any.whl
90
90
  ```
91
91
 
92
92
  Verify the installation:
@@ -110,6 +110,15 @@ copies the applicable constitution documents, writes
110
110
  `.devflow/config.yaml` and generates the integration for the selected
111
111
  harness.
112
112
 
113
+ The stack is detected from `pyproject.toml`, `requirements*.txt` and
114
+ `package.json`. When those manifests are absent or incomplete, DevFlow
115
+ also reads the packages installed in a local virtual environment
116
+ (`.venv`, `venv` or `env`). This keeps Django, FastAPI and the
117
+ RAG/vector stack (`langchain`, `llama-index`, `chromadb`,
118
+ `qdrant-client`, `weaviate-client`, `pinecone-client`, `pgvector` and
119
+ `sentence-transformers`) detectable without versioning a dependency
120
+ manifest.
121
+
113
122
  Common options:
114
123
 
115
124
  ```bash
@@ -250,7 +259,7 @@ as an architectural constraint when it is present.
250
259
 
251
260
  ### Harnesses
252
261
 
253
- | Harness | Status in 0.3.5 |
262
+ | Harness | Status in 0.3.7 |
254
263
  | --- | --- |
255
264
  | OpenCode | Verified end-to-end in non-interactive mode |
256
265
  | Codex | Integration files are generated, but not verified for this release |
@@ -276,6 +285,14 @@ also select the model used by the agent, for example:
276
285
  DevFlow creates `opencode.json` only when it does not exist and never
277
286
  replaces an existing OpenCode configuration.
278
287
 
288
+ DevFlow records the files it generates for the selected harness in a
289
+ managed block inside `.gitignore`, for example `CLAUDE.md`, `AGENTS.md`,
290
+ `opencode.json` and the DevFlow agents. Existing ignore entries are
291
+ preserved, and the block is shared across harnesses, so switching
292
+ adapters keeps earlier generated files ignored. Unmanaged files that
293
+ DevFlow did not create are never added. DevFlow does not ignore
294
+ `.devflow/` or the constitution.
295
+
279
296
  ### Permissions
280
297
 
281
298
  `allow_workflow_write` controls writes to DevFlow artifacts.
@@ -291,6 +308,11 @@ not treated as the only permission boundary.
291
308
  When a harness cannot enforce a restriction technically, DevFlow prints
292
309
  a warning instead of claiming that the restriction is guaranteed.
293
310
 
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.
315
+
294
316
  ## Discovery
295
317
 
296
318
  Discovery is separate from specification. The project context decides
@@ -400,7 +422,7 @@ specification that still lists open questions.
400
422
  8. If artifacts exist without workflow state, diagnose with
401
423
  `devflow doctor <id>` and repair with `devflow recover <id>`.
402
424
 
403
- Available commands in `0.3.5`:
425
+ Available commands in `0.3.7`:
404
426
 
405
427
  | Command | Status |
406
428
  | --- | --- |
@@ -588,7 +610,7 @@ devflow approve 001 --stage spec
588
610
  ```
589
611
 
590
612
  Approval is explicit and binds the decision to the current artifact
591
- digests. For a `0.3.5` change it binds `spec.md`, `discovery.yaml` and,
613
+ digests. For a `0.3.7` change it binds `spec.md`, `discovery.yaml` and,
592
614
  when a manifest applies, the architecture manifest digest. Repeating the
593
615
  same approval is a no-op. If an artifact changes after validation,
594
616
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -599,7 +621,7 @@ and names the pending questions and assumptions. Approval also rejects a
599
621
  specification whose section 7 still lists open questions. Legacy `0.2.0`
600
622
  changes without `discovery.yaml` remain approvable with a warning.
601
623
 
602
- Only the `spec` stage is available in `0.3.5`. `--stage plan` and
624
+ Only the `spec` stage is available in `0.3.7`. `--stage plan` and
603
625
  `--stage review` are rejected. There are no `plan`, `implement` or
604
626
  `review` commands in this release.
605
627
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.5"
7
+ version = "0.3.7"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -8,6 +8,7 @@ from pathlib import Path
8
8
  from devflow.adapters.instructions import (
9
9
  MANAGED_MARKER as _MANAGED_MARKER,
10
10
  render_agent_instructions,
11
+ write_gitignore_entries,
11
12
  write_text_managed,
12
13
  )
13
14
  from devflow.core.config import DevFlowConfig
@@ -46,4 +47,6 @@ class AgentsFileWriter:
46
47
  def write(self, root: Path, content: str) -> AgentsWriteResult:
47
48
  """Write AGENTS.md without overwriting unmanaged user content."""
48
49
  result = write_text_managed(root / "AGENTS.md", content, root=root)
50
+ if result.status != "skipped":
51
+ write_gitignore_entries(root, ("AGENTS.md",))
49
52
  return AgentsWriteResult(path=result.path, status=result.status)
@@ -14,6 +14,7 @@ from devflow.adapters.base import (
14
14
  )
15
15
  from devflow.adapters.instructions import (
16
16
  render_agent_instructions,
17
+ write_gitignore_entries,
17
18
  write_text_managed,
18
19
  )
19
20
 
@@ -38,9 +39,16 @@ class ClaudeCodeAdapter(HarnessAdapter):
38
39
  content,
39
40
  root=context.root,
40
41
  )
41
- return SetupResult(
42
- changes=(FileChange(path=result.path, status=result.status),)
43
- )
42
+ changes = [FileChange(path=result.path, status=result.status)]
43
+ if result.status != "skipped":
44
+ ignored = write_gitignore_entries(
45
+ context.root,
46
+ ("CLAUDE.md",),
47
+ )
48
+ changes.append(
49
+ FileChange(path=ignored.path, status=ignored.status)
50
+ )
51
+ return SetupResult(changes=tuple(changes))
44
52
 
45
53
  def build_run(self, context: RunContext) -> Invocation:
46
54
  settings = json.dumps(
@@ -54,6 +62,8 @@ class ClaudeCodeAdapter(HarnessAdapter):
54
62
  self.executable,
55
63
  "--permission-mode",
56
64
  "dontAsk",
65
+ "--allowedTools",
66
+ "AskUserQuestion",
57
67
  "--settings",
58
68
  settings,
59
69
  context.prompt,
@@ -108,6 +118,11 @@ class ClaudeCodeAdapter(HarnessAdapter):
108
118
  if context.permissions.allow_project_read:
109
119
  allow.extend(["Read", "Grep", "Glob"])
110
120
 
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
+
111
126
  if context.permissions.allow_source_code_changes:
112
127
  allow.extend(["Edit", "Bash"])
113
128
  elif context.permissions.allow_spec_write:
@@ -12,6 +12,7 @@ from devflow.adapters.base import (
12
12
  )
13
13
  from devflow.adapters.instructions import (
14
14
  render_agent_instructions,
15
+ write_gitignore_entries,
15
16
  write_text_managed,
16
17
  )
17
18
 
@@ -35,9 +36,16 @@ class CodexAdapter(HarnessAdapter):
35
36
  content,
36
37
  root=context.root,
37
38
  )
38
- return SetupResult(
39
- changes=(FileChange(path=result.path, status=result.status),)
40
- )
39
+ changes = [FileChange(path=result.path, status=result.status)]
40
+ if result.status != "skipped":
41
+ ignored = write_gitignore_entries(
42
+ context.root,
43
+ ("AGENTS.md",),
44
+ )
45
+ changes.append(
46
+ FileChange(path=ignored.path, status=ignored.status)
47
+ )
48
+ return SetupResult(changes=tuple(changes))
41
49
 
42
50
  def build_run(self, context: RunContext) -> Invocation:
43
51
  root = context.root
@@ -6,6 +6,7 @@ import json
6
6
  import os
7
7
  import stat
8
8
  import tempfile
9
+ from collections.abc import Sequence
9
10
  from dataclasses import dataclass
10
11
  from pathlib import Path
11
12
  from typing import Any
@@ -15,6 +16,8 @@ from devflow.models.profile import Profile
15
16
  from devflow.models.project import Project
16
17
 
17
18
  MANAGED_MARKER = "<!-- devflow:managed -->"
19
+ GITIGNORE_BEGIN = "# devflow:managed:begin"
20
+ GITIGNORE_END = "# devflow:managed:end"
18
21
 
19
22
 
20
23
  class ManagedWriteError(OSError):
@@ -261,3 +264,95 @@ def write_json_if_missing(
261
264
  target = _managed_path(root, target)
262
265
  _write_atomic(target, json.dumps(data, indent=2) + "\n")
263
266
  return ManagedWriteResult(path=target, status="created")
267
+
268
+
269
+ def _normalize_gitignore_entries(entries: Sequence[str]) -> list[str]:
270
+ """Return unique, root-anchored ignore patterns."""
271
+ normalized: list[str] = []
272
+ for entry in entries:
273
+ value = str(entry).strip()
274
+ if not value or value.startswith("#"):
275
+ continue
276
+ if not value.startswith("/"):
277
+ value = f"/{value}"
278
+ if value not in normalized:
279
+ normalized.append(value)
280
+ return normalized
281
+
282
+
283
+ def _render_gitignore_block(entries: Sequence[str]) -> str:
284
+ """Render the managed .gitignore block."""
285
+ lines = [
286
+ GITIGNORE_BEGIN,
287
+ "# Generated by DevFlow for agent harness integration.",
288
+ *entries,
289
+ GITIGNORE_END,
290
+ ]
291
+ return "\n".join(lines) + "\n"
292
+
293
+
294
+ def write_gitignore_entries(
295
+ root: Path,
296
+ entries: Sequence[str],
297
+ ) -> ManagedWriteResult:
298
+ """Ignore DevFlow-generated harness files inside a managed block.
299
+
300
+ Existing user entries are preserved. Patterns already inside the
301
+ managed block are kept when the selected harness changes.
302
+ """
303
+ path = root / ".gitignore"
304
+ desired = _normalize_gitignore_entries(entries)
305
+ if not desired:
306
+ return ManagedWriteResult(path=path, status="skipped")
307
+ if path.is_symlink():
308
+ return ManagedWriteResult(path=path, status="skipped")
309
+
310
+ target = _managed_path(root, path)
311
+ if not target.exists():
312
+ target.parent.mkdir(parents=True, exist_ok=True)
313
+ _write_atomic(target, _render_gitignore_block(desired))
314
+ return ManagedWriteResult(path=target, status="created")
315
+
316
+ try:
317
+ existing = target.read_text(encoding="utf-8")
318
+ except OSError:
319
+ return ManagedWriteResult(path=target, status="skipped")
320
+
321
+ begin = existing.find(GITIGNORE_BEGIN)
322
+ end = existing.find(GITIGNORE_END)
323
+ if begin == -1 and end == -1:
324
+ prefix = existing
325
+ if prefix and not prefix.endswith("\n"):
326
+ prefix += "\n"
327
+ if prefix:
328
+ prefix += "\n"
329
+ updated = prefix + _render_gitignore_block(desired)
330
+ elif begin == -1 or end == -1 or end < begin:
331
+ return ManagedWriteResult(path=target, status="skipped")
332
+ else:
333
+ current = existing[
334
+ begin + len(GITIGNORE_BEGIN) : end
335
+ ].splitlines()
336
+ merged = _normalize_gitignore_entries(
337
+ [
338
+ line
339
+ for line in current
340
+ if line.strip() and not line.strip().startswith("#")
341
+ ]
342
+ + desired
343
+ )
344
+ suffix = existing[end + len(GITIGNORE_END) :]
345
+ if suffix.startswith("\r\n"):
346
+ suffix = suffix[2:]
347
+ elif suffix.startswith("\n"):
348
+ suffix = suffix[1:]
349
+ updated = (
350
+ existing[:begin]
351
+ + _render_gitignore_block(merged)
352
+ + suffix
353
+ )
354
+
355
+ if updated == existing:
356
+ return ManagedWriteResult(path=target, status="unchanged")
357
+ _write_atomic(target, updated)
358
+ return ManagedWriteResult(path=target, status="updated")
@@ -13,6 +13,7 @@ from devflow.adapters.base import (
13
13
  from devflow.adapters.instructions import (
14
14
  MANAGED_MARKER,
15
15
  render_agent_instructions,
16
+ write_gitignore_entries,
16
17
  write_json_managed,
17
18
  write_text_managed,
18
19
  )
@@ -31,6 +32,7 @@ class KiroAdapter(HarnessAdapter):
31
32
  def setup(self, context: SetupContext) -> SetupResult:
32
33
  changes: list[FileChange] = []
33
34
  warnings: list[str] = []
35
+ ignored: list[str] = []
34
36
 
35
37
  steering = context.root / ".kiro" / "steering"
36
38
  for document in context.constitution.documents:
@@ -41,6 +43,8 @@ class KiroAdapter(HarnessAdapter):
41
43
  root=context.root,
42
44
  )
43
45
  changes.append(FileChange(path=result.path, status=result.status))
46
+ if result.status != "skipped":
47
+ ignored.append(f".kiro/steering/devflow-{document.name}")
44
48
  if result.status == "skipped":
45
49
  warnings.append(
46
50
  f"Kiro steering file {result.path.relative_to(context.root)} "
@@ -64,6 +68,8 @@ class KiroAdapter(HarnessAdapter):
64
68
  status=workflow_result.status,
65
69
  )
66
70
  )
71
+ if workflow_result.status != "skipped":
72
+ ignored.append(".kiro/steering/devflow-spec-workflow.md")
67
73
 
68
74
  agents = context.root / ".kiro" / "agents"
69
75
  interactive = write_json_managed(
@@ -94,6 +100,16 @@ class KiroAdapter(HarnessAdapter):
94
100
  "and was left untouched."
95
101
  )
96
102
 
103
+ if interactive.status != "skipped":
104
+ ignored.append(f".kiro/agents/{INTERACTIVE_AGENT}.json")
105
+ if readonly.status != "skipped":
106
+ ignored.append(f".kiro/agents/{READONLY_AGENT}.json")
107
+ if ignored:
108
+ gitignore = write_gitignore_entries(context.root, ignored)
109
+ changes.append(
110
+ FileChange(path=gitignore.path, status=gitignore.status)
111
+ )
112
+
97
113
  return SetupResult(changes=tuple(changes), warnings=tuple(warnings))
98
114
 
99
115
  def build_run(self, context: RunContext) -> Invocation:
@@ -15,6 +15,7 @@ from devflow.adapters.base import (
15
15
  from devflow.adapters.instructions import (
16
16
  MANAGED_MARKER,
17
17
  render_agent_instructions,
18
+ write_gitignore_entries,
18
19
  write_json_if_missing,
19
20
  write_text_managed,
20
21
  )
@@ -91,6 +92,21 @@ class OpenCodeAdapter(HarnessAdapter):
91
92
  FileChange(path=readonly.path, status=readonly.status)
92
93
  )
93
94
 
95
+ ignored: list[str] = []
96
+ if result.status != "skipped":
97
+ ignored.append("AGENTS.md")
98
+ if config_result.status != "skipped":
99
+ ignored.append("opencode.json")
100
+ if interactive.status != "skipped":
101
+ ignored.append(f".opencode/agents/{INTERACTIVE_AGENT}.md")
102
+ if readonly.status != "skipped":
103
+ ignored.append(f".opencode/agents/{READONLY_AGENT}.md")
104
+ if ignored:
105
+ gitignore = write_gitignore_entries(context.root, ignored)
106
+ changes.append(
107
+ FileChange(path=gitignore.path, status=gitignore.status)
108
+ )
109
+
94
110
  if result.status == "skipped":
95
111
  warnings.append(
96
112
  "AGENTS.md contains unmanaged content and was left untouched."
@@ -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.5"
38
+ current_version = "0.3.7"
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.5. "
60
+ f"Stage '{stage}' is not available in DevFlow 0.3.7. "
61
61
  "Only the 'spec' stage can be approved."
62
62
  )
63
63
  raise UnsupportedStageError(msg)
@@ -11,6 +11,8 @@ from typing import Any, Iterator
11
11
 
12
12
  from devflow.models.project import Project
13
13
 
14
+ VIRTUALENV_DIRECTORIES = (".venv", "venv", "env")
15
+
14
16
  SKIP_DIRECTORIES = {
15
17
  ".git",
16
18
  ".venv",
@@ -62,6 +64,10 @@ FRAMEWORK_DEPENDENCIES = {
62
64
  "chromadb": "ChromaDB",
63
65
  "faiss-cpu": "FAISS",
64
66
  "sentence-transformers": "Sentence Transformers",
67
+ "qdrant-client": "Qdrant",
68
+ "weaviate-client": "Weaviate",
69
+ "pinecone-client": "Pinecone",
70
+ "pgvector": "pgvector",
65
71
  "openai": "OpenAI",
66
72
  "anthropic": "Anthropic",
67
73
  }
@@ -85,6 +91,26 @@ FRONTEND_FRAMEWORKS = {
85
91
  "Next.js",
86
92
  }
87
93
 
94
+ AI_FRAMEWORKS = {
95
+ "LangChain",
96
+ "LlamaIndex",
97
+ "ChromaDB",
98
+ "FAISS",
99
+ "Sentence Transformers",
100
+ "Qdrant",
101
+ "Weaviate",
102
+ "Pinecone",
103
+ "pgvector",
104
+ }
105
+
106
+ VECTOR_DEPENDENCIES = {
107
+ "chromadb",
108
+ "qdrant-client",
109
+ "weaviate-client",
110
+ "pinecone-client",
111
+ "pgvector",
112
+ }
113
+
88
114
  BACKEND_FRAMEWORKS = {
89
115
  "Django",
90
116
  "Django REST Framework",
@@ -242,6 +268,12 @@ class ProjectDetector:
242
268
  manifests.append(path.relative_to(resolved).as_posix())
243
269
  dependencies.update(self._read_requirements(path))
244
270
 
271
+ venv_dependencies, venv_manifests = self._virtualenv_dependencies(
272
+ resolved,
273
+ )
274
+ dependencies.update(venv_dependencies)
275
+ manifests.extend(venv_manifests)
276
+
245
277
  source_files = [
246
278
  path.relative_to(resolved).as_posix()
247
279
  for path in iter_project_files(
@@ -415,6 +447,101 @@ class ProjectDetector:
415
447
  dependencies.add(name)
416
448
  return dependencies
417
449
 
450
+ def _virtualenv_dependencies(
451
+ self,
452
+ root: Path,
453
+ ) -> tuple[set[str], list[str]]:
454
+ """Read installed distributions from a local virtual environment.
455
+
456
+ Dependency manifests are optional in many projects; the virtual
457
+ environment is often the only place where the real stack is
458
+ recorded. Only well-known local directory names are inspected.
459
+ """
460
+ dependencies: set[str] = set()
461
+ manifests: list[str] = []
462
+ for name in VIRTUALENV_DIRECTORIES:
463
+ directory = root / name
464
+ if (
465
+ not directory.is_dir()
466
+ or directory.is_symlink()
467
+ or _is_symlink_escape(directory, root)
468
+ ):
469
+ continue
470
+ for site_packages in self._site_packages(directory):
471
+ installed = self._installed_distributions(site_packages)
472
+ if not installed:
473
+ continue
474
+ dependencies.update(installed)
475
+ manifests.append(
476
+ f"{site_packages.relative_to(root).as_posix()} "
477
+ "(installed packages)"
478
+ )
479
+ return dependencies, manifests
480
+
481
+ def _site_packages(self, directory: Path) -> list[Path]:
482
+ """Return contained site-packages directories of a virtualenv."""
483
+ candidates: list[Path] = []
484
+ for pattern in (
485
+ "lib/python*/site-packages",
486
+ "lib64/python*/site-packages",
487
+ "Lib/site-packages",
488
+ ):
489
+ candidates.extend(directory.glob(pattern))
490
+ paths: dict[Path, Path] = {}
491
+ for path in candidates:
492
+ if (
493
+ not path.is_dir()
494
+ or path.is_symlink()
495
+ or _is_symlink_escape(path, directory)
496
+ ):
497
+ continue
498
+ paths.setdefault(path.resolve(), path)
499
+ return sorted(paths.values())
500
+
501
+ def _installed_distributions(self, site_packages: Path) -> set[str]:
502
+ """Return canonical package names from dist-info and egg-info."""
503
+ names: set[str] = set()
504
+ try:
505
+ entries = sorted(site_packages.iterdir())
506
+ except OSError:
507
+ return names
508
+
509
+ for entry in entries:
510
+ if entry.is_symlink():
511
+ continue
512
+ if entry.name.endswith(".dist-info"):
513
+ name = self._metadata_name(entry / "METADATA")
514
+ if name is None:
515
+ name = entry.name[: -len(".dist-info")].rsplit("-", 1)[0]
516
+ names.add(canonicalize_dependency(name))
517
+ elif entry.name.endswith(".egg-info"):
518
+ name = self._metadata_name(entry / "PKG-INFO")
519
+ if name is None:
520
+ name = entry.name[: -len(".egg-info")].rsplit("-", 1)[0]
521
+ names.add(canonicalize_dependency(name))
522
+
523
+ return {name for name in names if name}
524
+
525
+ def _metadata_name(self, path: Path) -> str | None:
526
+ """Read the ``Name`` field from a package metadata file."""
527
+ if not path.is_file() or path.is_symlink():
528
+ return None
529
+ try:
530
+ with path.open(
531
+ encoding="utf-8",
532
+ errors="replace",
533
+ ) as handle:
534
+ for _ in range(40):
535
+ line = handle.readline()
536
+ if not line:
537
+ break
538
+ if line.lower().startswith("name:"):
539
+ value = line.split(":", 1)[1].strip()
540
+ return value or None
541
+ except OSError:
542
+ return None
543
+ return None
544
+
418
545
  def _detect_languages(
419
546
  self,
420
547
  root: Path,
@@ -484,7 +611,10 @@ class ProjectDetector:
484
611
  ):
485
612
  databases.append(label)
486
613
 
487
- if "chromadb" in dependencies:
614
+ if any(
615
+ self._has_dependency(dependencies, name)
616
+ for name in VECTOR_DEPENDENCIES
617
+ ):
488
618
  if "vector-database" not in databases:
489
619
  databases.append("vector-database")
490
620
  return databases
@@ -499,14 +629,7 @@ class ProjectDetector:
499
629
  for framework in frameworks
500
630
  )
501
631
  ai = any(
502
- framework
503
- in {
504
- "LangChain",
505
- "LlamaIndex",
506
- "ChromaDB",
507
- "FAISS",
508
- "Sentence Transformers",
509
- }
632
+ framework in AI_FRAMEWORKS
510
633
  for framework in frameworks
511
634
  )
512
635
 
@@ -10,6 +10,9 @@ detection:
10
10
  - chromadb
11
11
  - faiss-cpu
12
12
  - qdrant-client
13
+ - weaviate-client
14
+ - pinecone-client
15
+ - pgvector
13
16
  - sentence-transformers
14
17
  indicators:
15
18
  - vector_database
@@ -8,6 +8,7 @@ import yaml
8
8
  from typer.testing import CliRunner
9
9
 
10
10
  from devflow.cli import app
11
+ from devflow.core.project import ProjectDetector
11
12
 
12
13
  runner = CliRunner()
13
14
 
@@ -70,6 +71,83 @@ def test_register_patient() -> None:
70
71
  )
71
72
 
72
73
 
74
+ def _venv_package(
75
+ root: Path,
76
+ name: str,
77
+ version: str = "1.0.0",
78
+ ) -> None:
79
+ site_packages = (
80
+ root
81
+ / ".venv"
82
+ / "lib"
83
+ / "python3.12"
84
+ / "site-packages"
85
+ )
86
+ metadata = site_packages / f"{name}-{version}.dist-info"
87
+ metadata.mkdir(parents=True, exist_ok=True)
88
+ (metadata / "METADATA").write_text(
89
+ "Metadata-Version: 2.1\n"
90
+ f"Name: {name}\n"
91
+ f"Version: {version}\n",
92
+ encoding="utf-8",
93
+ )
94
+
95
+
96
+ def test_init_detects_django_from_local_virtualenv(
97
+ tmp_path: Path,
98
+ ) -> None:
99
+ _venv_package(tmp_path, "Django", "5.1.2")
100
+ _write(tmp_path / "manage.py", "")
101
+ _write(
102
+ tmp_path / "biblioteca_project" / "settings.py",
103
+ "INSTALLED_APPS = []\n",
104
+ )
105
+
106
+ result = runner.invoke(
107
+ app,
108
+ ["init", str(tmp_path), "--yes", "--harness", "none"],
109
+ )
110
+
111
+ assert result.exit_code == 0, result.output
112
+ project = ProjectDetector().detect(tmp_path)
113
+ assert project.frameworks == ["Django"]
114
+ assert project.project_type == "backend"
115
+ config = yaml.safe_load(
116
+ (tmp_path / ".devflow" / "config.yaml").read_text(
117
+ encoding="utf-8"
118
+ )
119
+ )
120
+ assert config["project"]["type"] == "backend"
121
+ assert config["profiles"] == ["django-backend"]
122
+
123
+
124
+ def test_init_detects_rag_stack_from_local_virtualenv(
125
+ tmp_path: Path,
126
+ ) -> None:
127
+ for name in ("langchain", "qdrant-client", "sentence-transformers"):
128
+ _venv_package(tmp_path, name)
129
+ _write(tmp_path / "main.py", "")
130
+
131
+ result = runner.invoke(
132
+ app,
133
+ ["init", str(tmp_path), "--yes", "--harness", "none"],
134
+ )
135
+
136
+ assert result.exit_code == 0, result.output
137
+ project = ProjectDetector().detect(tmp_path)
138
+ frameworks = set(project.frameworks)
139
+ assert {"LangChain", "Qdrant", "Sentence Transformers"} <= frameworks
140
+ assert project.project_type == "ai"
141
+ assert "vector-database" in project.databases
142
+ config = yaml.safe_load(
143
+ (tmp_path / ".devflow" / "config.yaml").read_text(
144
+ encoding="utf-8"
145
+ )
146
+ )
147
+ assert config["project"]["type"] == "ai"
148
+ assert "ai-rag" in config["profiles"]
149
+
150
+
73
151
  def test_init_detects_django_and_installs_only_its_guidelines(
74
152
  tmp_path: Path,
75
153
  ) -> None:
@@ -16,6 +16,7 @@ from devflow.adapters.base import (
16
16
  from devflow.core.ports import Invocation
17
17
  from devflow.adapters.instructions import (
18
18
  ManagedWriteError,
19
+ write_gitignore_entries,
19
20
  write_json_if_missing,
20
21
  write_text_managed,
21
22
  )
@@ -178,6 +179,21 @@ def test_managed_write_skips_symlink_and_stays_atomic(
178
179
  assert not list(root.glob(".CLAUDE.md-*"))
179
180
 
180
181
 
182
+ def test_gitignore_write_skips_symlink(
183
+ tmp_path: Path,
184
+ ) -> None:
185
+ root = tmp_path / "project"
186
+ root.mkdir()
187
+ outside = tmp_path / "outside.gitignore"
188
+ outside.write_text("user content\n", encoding="utf-8")
189
+ (root / ".gitignore").symlink_to(outside)
190
+
191
+ result = write_gitignore_entries(root, ("CLAUDE.md",))
192
+
193
+ assert result.status == "skipped"
194
+ assert outside.read_text(encoding="utf-8") == "user content\n"
195
+
196
+
181
197
  def test_managed_write_rejects_escaping_directory(
182
198
  tmp_path: Path,
183
199
  ) -> None:
@@ -219,6 +219,59 @@ def test_init_generates_only_selected_harness_files(
219
219
  ).read_text(encoding="utf-8")
220
220
 
221
221
 
222
+ def test_init_ignores_generated_harness_files(
223
+ tmp_path: Path,
224
+ ) -> None:
225
+ _project(tmp_path)
226
+ _write(tmp_path / ".gitignore", "*.pyc\n")
227
+
228
+ assert _init(tmp_path, "--harness", "claude-code").exit_code == 0
229
+ gitignore = tmp_path / ".gitignore"
230
+ content = gitignore.read_text(encoding="utf-8")
231
+
232
+ assert content.startswith("*.pyc\n")
233
+ assert "/CLAUDE.md" in content
234
+ assert "/.devflow" not in content
235
+
236
+ assert _init(tmp_path, "--harness", "codex").exit_code == 0
237
+ content = gitignore.read_text(encoding="utf-8")
238
+
239
+ assert "/CLAUDE.md" in content
240
+ assert "/AGENTS.md" in content
241
+ assert content.count("# devflow:managed:begin") == 1
242
+
243
+ assert _init(tmp_path, "--harness", "codex").exit_code == 0
244
+ assert gitignore.read_text(encoding="utf-8") == content
245
+
246
+
247
+ def test_opencode_generated_files_are_ignored(
248
+ tmp_path: Path,
249
+ ) -> None:
250
+ _project(tmp_path)
251
+ assert _init(tmp_path, "--harness", "opencode").exit_code == 0
252
+
253
+ content = (tmp_path / ".gitignore").read_text(encoding="utf-8")
254
+ for entry in (
255
+ "/AGENTS.md",
256
+ "/opencode.json",
257
+ "/.opencode/agents/devflow-spec.md",
258
+ "/.opencode/agents/devflow-spec-readonly.md",
259
+ ):
260
+ assert entry in content
261
+
262
+
263
+ def test_unmanaged_agents_file_is_not_ignored(
264
+ tmp_path: Path,
265
+ ) -> None:
266
+ _project(tmp_path)
267
+ _write(tmp_path / "AGENTS.md", "# Custom agent rules\n")
268
+
269
+ assert _init(tmp_path, "--harness", "codex").exit_code == 0
270
+
271
+ gitignore = tmp_path / ".gitignore"
272
+ assert not gitignore.exists()
273
+
274
+
222
275
  def test_opencode_integration_scopes_edits_to_specs(
223
276
  tmp_path: Path,
224
277
  ) -> None:
@@ -396,6 +449,19 @@ def test_codex_non_interactive_is_read_only(
396
449
  assert invocation.interactive is False
397
450
 
398
451
 
452
+ def test_claude_interactive_allows_questions(
453
+ tmp_path: Path,
454
+ ) -> None:
455
+ context = _run_context(tmp_path, mode="interactive")
456
+ invocation = ClaudeCodeAdapter().build_run(context)
457
+ argv = invocation.argv
458
+
459
+ assert argv[argv.index("--permission-mode") + 1] == "dontAsk"
460
+ assert argv[argv.index("--allowedTools") + 1] == "AskUserQuestion"
461
+ settings = json.loads(argv[argv.index("--settings") + 1])
462
+ assert "AskUserQuestion" in settings["permissions"]["allow"]
463
+
464
+
399
465
  def test_claude_non_interactive_restricts_tools(
400
466
  tmp_path: Path,
401
467
  ) -> None:
@@ -406,6 +472,7 @@ def test_claude_non_interactive_restricts_tools(
406
472
  assert argv[argv.index("--tools") + 1] == "Read,Grep,Glob"
407
473
  settings = json.loads(argv[argv.index("--settings") + 1])
408
474
  assert "Edit(.devflow/specs/**)" in settings["permissions"]["allow"]
475
+ assert "AskUserQuestion" not in settings["permissions"]["allow"]
409
476
  assert "Bash" in settings["permissions"]["deny"]
410
477
 
411
478
 
File without changes