devflow-toolkit 0.3.5__tar.gz → 0.3.6__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.
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/CHANGELOG.md +19 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/PKG-INFO +24 -7
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/README.md +23 -6
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/pyproject.toml +1 -1
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/agents.py +3 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/claude_code.py +11 -3
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/codex.py +11 -3
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/instructions.py +95 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/kiro.py +16 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/opencode.py +16 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/cli.py +1 -1
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/approve.py +1 -1
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/project.py +132 -9
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/ai-rag/profile.yaml +3 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_cli.py +78 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_hardening.py +16 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_harness_adapters.py +53 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/.gitignore +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/LICENSE +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/base.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/detector.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/adapters/registry.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/doctor.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/harness.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/init.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/recover.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/spec.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/commands/status.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/architecture.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/artifacts/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/artifacts/errors.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/artifacts/models.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/artifacts/store.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/clock.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/config.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/constitution.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/discovery.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/ports.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/profile_manager.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/recovery.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/spec_workflow.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/specification.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/errors.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/events.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/locator.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/lock.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/manager.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/models.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/core/state/transitions.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/models/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/models/profile.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/models/project.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/base/constitution/architecture.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/base/constitution/constitution.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/base/profile.yaml +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/django-backend/profile.yaml +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/prompts/__init__.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/prompts/discovery.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/prompts/spec.greenfield.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/prompts/spec.md +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_discovery.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_event_log.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_greenfield.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_recovery.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_spec_workflow.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_state.py +0 -0
- {devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/tests/test_state_replay.py +0 -0
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to DevFlow Toolkit are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.3.6 - 2026-11-04
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Stack detection now reads packages installed in a local virtual
|
|
10
|
+
environment (`.venv`, `venv` or `env`) when dependency manifests are
|
|
11
|
+
absent. Django, FastAPI and the RAG/vector stack can therefore be
|
|
12
|
+
detected without versioning `requirements.txt` or `pyproject.toml`.
|
|
13
|
+
- RAG detection recognizes `qdrant-client`, `weaviate-client`,
|
|
14
|
+
`pinecone-client` and `pgvector`, including the `vector-database`
|
|
15
|
+
capability and the `ai-rag` profile.
|
|
16
|
+
- Generated harness integration files are added to a managed block in
|
|
17
|
+
`.gitignore`. Existing entries are preserved, the block is shared
|
|
18
|
+
across harnesses, and unmanaged user files are never ignored.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Package version is `0.3.6`.
|
|
23
|
+
|
|
5
24
|
## 0.3.5 - 2026-11-04
|
|
6
25
|
|
|
7
26
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: devflow-toolkit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
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.
|
|
45
|
+
This is the `0.3.6` 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.
|
|
121
|
+
pip install devflow_toolkit-0.3.6-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.
|
|
294
|
+
| Harness | Status in 0.3.6 |
|
|
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.
|
|
@@ -432,7 +449,7 @@ specification that still lists open questions.
|
|
|
432
449
|
8. If artifacts exist without workflow state, diagnose with
|
|
433
450
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
434
451
|
|
|
435
|
-
Available commands in `0.3.
|
|
452
|
+
Available commands in `0.3.6`:
|
|
436
453
|
|
|
437
454
|
| Command | Status |
|
|
438
455
|
| --- | --- |
|
|
@@ -620,7 +637,7 @@ devflow approve 001 --stage spec
|
|
|
620
637
|
```
|
|
621
638
|
|
|
622
639
|
Approval is explicit and binds the decision to the current artifact
|
|
623
|
-
digests. For a `0.3.
|
|
640
|
+
digests. For a `0.3.6` change it binds `spec.md`, `discovery.yaml` and,
|
|
624
641
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
625
642
|
same approval is a no-op. If an artifact changes after validation,
|
|
626
643
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -631,7 +648,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
631
648
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
632
649
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
633
650
|
|
|
634
|
-
Only the `spec` stage is available in `0.3.
|
|
651
|
+
Only the `spec` stage is available in `0.3.6`. `--stage plan` and
|
|
635
652
|
`--stage review` are rejected. There are no `plan`, `implement` or
|
|
636
653
|
`review` commands in this release.
|
|
637
654
|
|
|
@@ -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.
|
|
13
|
+
This is the `0.3.6` 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.
|
|
89
|
+
pip install devflow_toolkit-0.3.6-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.
|
|
262
|
+
| Harness | Status in 0.3.6 |
|
|
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.
|
|
@@ -400,7 +417,7 @@ specification that still lists open questions.
|
|
|
400
417
|
8. If artifacts exist without workflow state, diagnose with
|
|
401
418
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
402
419
|
|
|
403
|
-
Available commands in `0.3.
|
|
420
|
+
Available commands in `0.3.6`:
|
|
404
421
|
|
|
405
422
|
| Command | Status |
|
|
406
423
|
| --- | --- |
|
|
@@ -588,7 +605,7 @@ devflow approve 001 --stage spec
|
|
|
588
605
|
```
|
|
589
606
|
|
|
590
607
|
Approval is explicit and binds the decision to the current artifact
|
|
591
|
-
digests. For a `0.3.
|
|
608
|
+
digests. For a `0.3.6` change it binds `spec.md`, `discovery.yaml` and,
|
|
592
609
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
593
610
|
same approval is a no-op. If an artifact changes after validation,
|
|
594
611
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -599,7 +616,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
599
616
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
600
617
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
601
618
|
|
|
602
|
-
Only the `spec` stage is available in `0.3.
|
|
619
|
+
Only the `spec` stage is available in `0.3.6`. `--stage plan` and
|
|
603
620
|
`--stage review` are rejected. There are no `plan`, `implement` or
|
|
604
621
|
`review` commands in this release.
|
|
605
622
|
|
|
@@ -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
|
-
|
|
42
|
-
|
|
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(
|
|
@@ -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
|
-
|
|
39
|
-
|
|
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."
|
|
@@ -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.
|
|
60
|
+
f"Stage '{stage}' is not available in DevFlow 0.3.6. "
|
|
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
|
|
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
|
|
|
@@ -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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/django-backend/profile.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{devflow_toolkit-0.3.5 → devflow_toolkit-0.3.6}/src/devflow/profiles/fastapi-backend/profile.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|