devflow-toolkit 0.4.2__py3-none-any.whl → 0.4.3__py3-none-any.whl
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/core/discovery.py +48 -6
- devflow/prompts/__init__.py +13 -2
- devflow/prompts/discovery.md +16 -1
- devflow/prompts/spec.md +6 -0
- {devflow_toolkit-0.4.2.dist-info → devflow_toolkit-0.4.3.dist-info}/METADATA +21 -7
- {devflow_toolkit-0.4.2.dist-info → devflow_toolkit-0.4.3.dist-info}/RECORD +9 -9
- {devflow_toolkit-0.4.2.dist-info → devflow_toolkit-0.4.3.dist-info}/WHEEL +0 -0
- {devflow_toolkit-0.4.2.dist-info → devflow_toolkit-0.4.3.dist-info}/entry_points.txt +0 -0
- {devflow_toolkit-0.4.2.dist-info → devflow_toolkit-0.4.3.dist-info}/licenses/LICENSE +0 -0
devflow/core/discovery.py
CHANGED
|
@@ -1856,12 +1856,7 @@ class DiscoveryPlanner:
|
|
|
1856
1856
|
"application?",
|
|
1857
1857
|
"API tokens, browser cookies and session authentication change "
|
|
1858
1858
|
"security boundaries, dependencies and user-visible behavior.",
|
|
1859
|
-
(
|
|
1860
|
-
"New JSON API with Bearer tokens.",
|
|
1861
|
-
"JWT in an HttpOnly cookie for HTML views.",
|
|
1862
|
-
"Both the JSON API and the HTML views.",
|
|
1863
|
-
"Other (describe).",
|
|
1864
|
-
),
|
|
1859
|
+
_auth_integration_options(project, words),
|
|
1865
1860
|
)
|
|
1866
1861
|
if auth_question and (words & {"jwt", "oauth", "token"}):
|
|
1867
1862
|
if not (words & {
|
|
@@ -2235,6 +2230,53 @@ def _normalize(value: str) -> str:
|
|
|
2235
2230
|
return without_accents.lower()
|
|
2236
2231
|
|
|
2237
2232
|
|
|
2233
|
+
_API_WORDS = frozenset(
|
|
2234
|
+
{
|
|
2235
|
+
"api",
|
|
2236
|
+
"json",
|
|
2237
|
+
"rest",
|
|
2238
|
+
"jwt",
|
|
2239
|
+
"token",
|
|
2240
|
+
"tokens",
|
|
2241
|
+
"bearer",
|
|
2242
|
+
"endpoint",
|
|
2243
|
+
"endpoints",
|
|
2244
|
+
"oauth",
|
|
2245
|
+
"mobile",
|
|
2246
|
+
"movil",
|
|
2247
|
+
"spa",
|
|
2248
|
+
}
|
|
2249
|
+
)
|
|
2250
|
+
|
|
2251
|
+
|
|
2252
|
+
def _auth_integration_options(
|
|
2253
|
+
project: Project,
|
|
2254
|
+
words: set[str],
|
|
2255
|
+
) -> tuple[str, ...]:
|
|
2256
|
+
"""Offer authentication options that fit the detected project."""
|
|
2257
|
+
if words & _API_WORDS:
|
|
2258
|
+
return (
|
|
2259
|
+
"New JSON API with Bearer tokens.",
|
|
2260
|
+
"JWT in an HttpOnly cookie for HTML views.",
|
|
2261
|
+
"Both the JSON API and the HTML views.",
|
|
2262
|
+
"Other (describe).",
|
|
2263
|
+
)
|
|
2264
|
+
frameworks = {value.lower() for value in project.frameworks}
|
|
2265
|
+
if "django" in frameworks:
|
|
2266
|
+
return (
|
|
2267
|
+
"Django sessions with the built-in login, logout and registration "
|
|
2268
|
+
"views and forms (recommended for level 1).",
|
|
2269
|
+
"Django sessions for the HTML views plus a JSON API with tokens.",
|
|
2270
|
+
"Other (describe).",
|
|
2271
|
+
)
|
|
2272
|
+
return (
|
|
2273
|
+
"Server-side sessions with the framework's built-in authentication "
|
|
2274
|
+
"(recommended for level 1).",
|
|
2275
|
+
"Sessions for the HTML views plus a JSON API with tokens.",
|
|
2276
|
+
"Other (describe).",
|
|
2277
|
+
)
|
|
2278
|
+
|
|
2279
|
+
|
|
2238
2280
|
def _words(text: str) -> set[str]:
|
|
2239
2281
|
return set(re.findall(r"[a-z0-9_]+", text))
|
|
2240
2282
|
|
devflow/prompts/__init__.py
CHANGED
|
@@ -85,6 +85,7 @@ def build_spec_prompt(
|
|
|
85
85
|
"execution_mode": execution_mode,
|
|
86
86
|
"project_mode": project_mode,
|
|
87
87
|
"language_note": _language_note(language),
|
|
88
|
+
"language_first": _language_first(language),
|
|
88
89
|
"architecture_note": architecture_note,
|
|
89
90
|
"discovery_note": discovery_note,
|
|
90
91
|
"mode_instructions": mode_instructions,
|
|
@@ -135,6 +136,7 @@ def build_discovery_prompt(
|
|
|
135
136
|
"harness_name": harness_name,
|
|
136
137
|
"execution_mode": execution_mode,
|
|
137
138
|
"language_note": _discovery_language_note(language),
|
|
139
|
+
"language_first": _language_first(language),
|
|
138
140
|
"mode_instructions": _discovery_mode_instructions(
|
|
139
141
|
discovery_path,
|
|
140
142
|
execution_mode,
|
|
@@ -469,6 +471,15 @@ def _language_note(language: str) -> str:
|
|
|
469
471
|
)
|
|
470
472
|
|
|
471
473
|
|
|
474
|
+
def _language_first(language: str) -> str:
|
|
475
|
+
"""Return the one-line language rule placed at the top of a prompt."""
|
|
476
|
+
target = (language or "en").strip() or "en"
|
|
477
|
+
return (
|
|
478
|
+
f"Write every message to the user in the language `{target}`, "
|
|
479
|
+
"starting with your first one."
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
|
|
472
483
|
def _discovery_language_note(language: str) -> str:
|
|
473
484
|
"""Return the prompt instruction that selects the conversation language."""
|
|
474
485
|
target = (language or "en").strip() or "en"
|
|
@@ -481,8 +492,8 @@ def _discovery_language_note(language: str) -> str:
|
|
|
481
492
|
"faithfully into the target language and write the translations into "
|
|
482
493
|
"the discovery record in place. Do not add, remove or re-scope "
|
|
483
494
|
"questions or decisions while translating. Preserve every id, "
|
|
484
|
-
"category, materiality, status, blocking flag
|
|
485
|
-
"
|
|
495
|
+
"category, materiality, status, blocking flag and evidence entry, "
|
|
496
|
+
"and keep paths, field names, category identifiers, "
|
|
486
497
|
"`Qn`/`An` identifiers, commands and digests exactly as shown. Do "
|
|
487
498
|
"not ask or answer in English unless the target language is `en`."
|
|
488
499
|
)
|
devflow/prompts/discovery.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DevFlow Discovery Task
|
|
2
2
|
|
|
3
|
+
{{language_first}}
|
|
4
|
+
|
|
3
5
|
You are the discovery agent for the project `{{project_name}}`.
|
|
4
6
|
|
|
5
7
|
## Source of Truth
|
|
@@ -151,6 +153,14 @@ user-visible behavior, security or authorization, persisted data or
|
|
|
151
153
|
migrations, an external dependency, the architecture, or would be
|
|
152
154
|
expensive to reverse.
|
|
153
155
|
|
|
156
|
+
## Exploring the Project
|
|
157
|
+
|
|
158
|
+
Search only the project's own files. Ignore virtual environments and
|
|
159
|
+
installed dependencies (`venv`, `.venv`, `env`, `node_modules`,
|
|
160
|
+
`site-packages`, build output) when listing or searching files. Read a
|
|
161
|
+
dependency's source only when one specific fact is needed as evidence,
|
|
162
|
+
and read just that part.
|
|
163
|
+
|
|
154
164
|
## Resolution Before Questions
|
|
155
165
|
|
|
156
166
|
Resolve a decision from the user's explicit answers and existing
|
|
@@ -350,10 +360,15 @@ assumption is unaccepted, and to `complete` only when nothing remains.
|
|
|
350
360
|
- Do not accept assumptions on the user's behalf. Acceptance is an
|
|
351
361
|
explicit human action.
|
|
352
362
|
- Preserve every existing id, category, materiality, status, blocking
|
|
353
|
-
flag, evidence entry
|
|
363
|
+
flag, evidence entry and the meaning of every answered decision.
|
|
354
364
|
When the target language differs, translate question, reason and
|
|
355
365
|
option text into it instead of adding, removing or re-scoping
|
|
356
366
|
decisions.
|
|
367
|
+
- A `pending` question that nobody has answered yet, including the
|
|
368
|
+
questions DevFlow generated before this session, is a proposal: you
|
|
369
|
+
may rewrite its wording and options so they fit the project, put the
|
|
370
|
+
recommended level-1 option first and add a `next_level`. Keep its id,
|
|
371
|
+
category and the subject of the decision.
|
|
357
372
|
- Never change the request, `spec_id`, `change` or `project_mode`.
|
|
358
373
|
- When you discover a requirement gap, append a new question instead
|
|
359
374
|
of hiding it in an answer or an assumption.
|
devflow/prompts/spec.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DevFlow Specification Task
|
|
2
2
|
|
|
3
|
+
{{language_first}}
|
|
4
|
+
|
|
3
5
|
<!-- devflow:mode existing -->
|
|
4
6
|
You are the specification agent for the project `{{project_name}}`.
|
|
5
7
|
<!-- /devflow:mode -->
|
|
@@ -41,6 +43,10 @@ primary design inputs. The manifest is a declaration, not evidence of
|
|
|
41
43
|
implemented code.
|
|
42
44
|
<!-- /devflow:mode -->
|
|
43
45
|
|
|
46
|
+
Search only the project's own files: ignore virtual environments and
|
|
47
|
+
installed dependencies (`venv`, `.venv`, `node_modules`,
|
|
48
|
+
`site-packages`) unless one specific fact from a dependency is needed.
|
|
49
|
+
|
|
44
50
|
## Documentation Language
|
|
45
51
|
|
|
46
52
|
{{language_note}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: devflow-toolkit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Specification workflow toolkit for AI-assisted software changes
|
|
5
5
|
Author: DevFlow contributors
|
|
6
6
|
License-Expression: MIT
|
|
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# DevFlow Toolkit
|
|
34
34
|
|
|
35
|
-
**Current version: `0.4.
|
|
35
|
+
**Current version: `0.4.3`.**
|
|
36
36
|
|
|
37
37
|
Before any code is written, you and the AI agree on what will be built
|
|
38
38
|
and approve it as a spec. The agent then implements once, on something
|
|
@@ -210,7 +210,7 @@ pip install devflow-toolkit
|
|
|
210
210
|
To install a specific built artifact instead:
|
|
211
211
|
|
|
212
212
|
```bash
|
|
213
|
-
pip install devflow_toolkit-0.4.
|
|
213
|
+
pip install devflow_toolkit-0.4.3-py3-none-any.whl
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
Verify the installation:
|
|
@@ -511,7 +511,7 @@ as an architectural constraint when it is present.
|
|
|
511
511
|
|
|
512
512
|
### Harnesses
|
|
513
513
|
|
|
514
|
-
| Harness | Status in 0.4.
|
|
514
|
+
| Harness | Status in 0.4.3 |
|
|
515
515
|
| --- | --- |
|
|
516
516
|
| OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
|
|
517
517
|
| Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
|
|
@@ -721,6 +721,20 @@ selected harness is invoked instead of being skipped with an empty
|
|
|
721
721
|
Discovery. Non-interactive runs keep the deterministic behavior for
|
|
722
722
|
concrete requests such as `Add a health endpoint`.
|
|
723
723
|
|
|
724
|
+
The planner's questions are proposals. For an authentication request,
|
|
725
|
+
the first options fit the project: Django sessions with the built-in
|
|
726
|
+
views and forms for a Django project, server-side sessions otherwise,
|
|
727
|
+
and API tokens only when the request mentions an API, tokens or a mobile
|
|
728
|
+
client. While a planner question is still pending, the Discovery agent
|
|
729
|
+
may rewrite its wording and options, put the recommended level-1 option
|
|
730
|
+
first and add a `next_level`; answered decisions are never rewritten.
|
|
731
|
+
|
|
732
|
+
Discovery and specification agents search only the project's own files
|
|
733
|
+
and skip virtual environments and installed dependencies (`venv`,
|
|
734
|
+
`.venv`, `node_modules`, `site-packages`), reading a dependency only for
|
|
735
|
+
one specific fact. Every prompt opens with the language rule, so the
|
|
736
|
+
agent answers in the configured language from its first message.
|
|
737
|
+
|
|
724
738
|
For user-generated content, Discovery must also resolve who writes it,
|
|
725
739
|
who may create, edit or delete it, moderation, authentication
|
|
726
740
|
mechanism, validation, ordering, lifecycle on parent deletion, admin
|
|
@@ -925,7 +939,7 @@ reference.
|
|
|
925
939
|
8. If artifacts exist without workflow state, diagnose with
|
|
926
940
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
927
941
|
|
|
928
|
-
Available commands in `0.4.
|
|
942
|
+
Available commands in `0.4.3`:
|
|
929
943
|
|
|
930
944
|
| Command | Status |
|
|
931
945
|
| --- | --- |
|
|
@@ -1158,7 +1172,7 @@ devflow approve 001
|
|
|
1158
1172
|
```
|
|
1159
1173
|
|
|
1160
1174
|
Approval is explicit and binds the decision to the current artifact
|
|
1161
|
-
digests. For a `0.4.
|
|
1175
|
+
digests. For a `0.4.3` change it binds `spec.md`, `discovery.yaml` and,
|
|
1162
1176
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
1163
1177
|
same approval is a no-op. If an artifact changes after validation,
|
|
1164
1178
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -1169,7 +1183,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
1169
1183
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
1170
1184
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
1171
1185
|
|
|
1172
|
-
Only the `spec` stage is available in `0.4.
|
|
1186
|
+
Only the `spec` stage is available in `0.4.3`, so `--stage` is optional
|
|
1173
1187
|
and defaults to `spec`. `--stage plan` and `--stage review` are
|
|
1174
1188
|
rejected. There are no `plan`, `implement` or
|
|
1175
1189
|
`review` commands in this release.
|
|
@@ -27,7 +27,7 @@ devflow/core/architecture.py,sha256=qllllsUVqA76LiSU6z_s4U8dxMcs6ClKXU16HxI3yOI,
|
|
|
27
27
|
devflow/core/clock.py,sha256=KZROv6o51Ln1EzK00ySCxfc7WPZqPlaQhFfjfdc_TMY,1651
|
|
28
28
|
devflow/core/config.py,sha256=0tzIMooUUz7yjywtofhmNbXumyxqcTXfTLSVkmVFSss,26843
|
|
29
29
|
devflow/core/constitution.py,sha256=rPLc8Puv9nUMC_GZwzOqvr1B-4urdxAISr655od2IPM,5333
|
|
30
|
-
devflow/core/discovery.py,sha256=
|
|
30
|
+
devflow/core/discovery.py,sha256=y8-B4ZiuvWts5JIL1Ait8fDalARYVjTL64Yr2ly_-h0,67482
|
|
31
31
|
devflow/core/file_types.py,sha256=5S5YywOaTESDiln4kP7qyJFEjxHoiF6tSBbwuXNpDDc,566
|
|
32
32
|
devflow/core/ports.py,sha256=6jlqeR40MNaz-IuZIAPimXpRKew-wMUab3KzelcTXsU,4541
|
|
33
33
|
devflow/core/profile_manager.py,sha256=QnnJka2KIKD2tCSWJkGTOUEFMgmQT0Z9Qv173JKWKHw,8937
|
|
@@ -64,12 +64,12 @@ devflow/profiles/django-backend/profile.yaml,sha256=SNj7a3yamdJx-P69GvIJmLkC2svO
|
|
|
64
64
|
devflow/profiles/django-backend/constitution/django-standards.md,sha256=0M-XmxOpEmgIadcaVdf6OVmll8Oec0jEjcJ4C8MfwhQ,2052
|
|
65
65
|
devflow/profiles/fastapi-backend/profile.yaml,sha256=5_b-zWSX0HV-tw_2ntRCSa4DyP3NUqYWmxOh55pXYmc,321
|
|
66
66
|
devflow/profiles/fastapi-backend/constitution/fastapi-standards.md,sha256=iFKib4i_9z4wBQ9thl-uftg5g-CHwvmFWzMtLgA7CBk,1949
|
|
67
|
-
devflow/prompts/__init__.py,sha256=
|
|
67
|
+
devflow/prompts/__init__.py,sha256=bwjYYZblF2_QwArEMfGeSXRBrmJDJNXntXdb7lQSRrY,22316
|
|
68
68
|
devflow/prompts/discovery-repair.md,sha256=hpw8pFaUC8OiHK_KTI2nMF45f77CqcFuDYzn9o6X5ao,1240
|
|
69
|
-
devflow/prompts/discovery.md,sha256=
|
|
70
|
-
devflow/prompts/spec.md,sha256=
|
|
71
|
-
devflow_toolkit-0.4.
|
|
72
|
-
devflow_toolkit-0.4.
|
|
73
|
-
devflow_toolkit-0.4.
|
|
74
|
-
devflow_toolkit-0.4.
|
|
75
|
-
devflow_toolkit-0.4.
|
|
69
|
+
devflow/prompts/discovery.md,sha256=LSnLhsKE6KY4NEqVspCpTALv1E4MVSYJXCN0CA0UmVs,17261
|
|
70
|
+
devflow/prompts/spec.md,sha256=ufbI2hVGYHIhQFF1VvPgqCugxsD9FnhyCxkX61raiuM,8267
|
|
71
|
+
devflow_toolkit-0.4.3.dist-info/METADATA,sha256=EL27G3Ebmex0jfcKWx8dj34Y4pytSySJf8IjCjurnkQ,58564
|
|
72
|
+
devflow_toolkit-0.4.3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
73
|
+
devflow_toolkit-0.4.3.dist-info/entry_points.txt,sha256=wPmqE1081vi8s3xf-Wfzfvpl-44IKgwx7OGoLEK3u7o,44
|
|
74
|
+
devflow_toolkit-0.4.3.dist-info/licenses/LICENSE,sha256=Wa04lstC8Goe4b9IYfEYWB2k7nokYBejZl6NdyAl8rA,1077
|
|
75
|
+
devflow_toolkit-0.4.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|