devflow-toolkit 0.4.1__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/config.py CHANGED
@@ -20,8 +20,6 @@ from devflow.models.project import (
20
20
  CONFIG_RELATIVE_PATH = Path(".devflow") / "config.yaml"
21
21
  DEFAULT_CONSTITUTION_PATH = Path(".devflow") / "constitution"
22
22
  DEFAULT_SPECIFICATIONS_PATH = Path(".devflow") / "specs"
23
- DEFAULT_PLANS_PATH = Path(".devflow") / "plans"
24
- DEFAULT_TEMPLATES_PATH = Path(".devflow") / "templates"
25
23
  DEFAULT_DOCUMENTATION_LANGUAGE = "en"
26
24
  MAX_DISCOVERY_BUDGET = 100
27
25
  # follow_up, maximum and max_rounds written by `devflow init` before
@@ -247,8 +245,6 @@ class DevFlowConfig:
247
245
  technologies: dict[str, list[str]]
248
246
  constitution: ConstitutionSettings
249
247
  specifications_path: Path
250
- plans_path: Path
251
- templates_path: Path
252
248
  documentation_language: str
253
249
  agent: AgentSettings
254
250
  discovery: DiscoverySettings = DiscoverySettings()
@@ -318,11 +314,9 @@ class ConfigManager:
318
314
  data.get("specifications"),
319
315
  "specifications",
320
316
  )
321
- plans = self._mapping(data.get("plans"), "plans")
322
- templates = self._mapping(
323
- data.get("templates", {}),
324
- "templates",
325
- )
317
+ # `plans` and `templates` were written by `devflow init` before
318
+ # 0.4.2. Nothing uses them, so older files keep loading and the keys
319
+ # are ignored.
326
320
  documentation = self._mapping(
327
321
  data.get("documentation", {}),
328
322
  "documentation",
@@ -351,14 +345,6 @@ class ConfigManager:
351
345
  ),
352
346
  "specifications.path",
353
347
  )
354
- plans_path = self._relative_path(
355
- plans.get("path", DEFAULT_PLANS_PATH.as_posix()),
356
- "plans.path",
357
- )
358
- templates_path = self._relative_path(
359
- templates.get("path", DEFAULT_TEMPLATES_PATH.as_posix()),
360
- "templates.path",
361
- )
362
348
 
363
349
  technologies = self._technologies(data.get("technologies", {}))
364
350
 
@@ -417,8 +403,6 @@ class ConfigManager:
417
403
  ),
418
404
  ),
419
405
  specifications_path=specifications_path,
420
- plans_path=plans_path,
421
- templates_path=templates_path,
422
406
  documentation_language=documentation_language,
423
407
  agent=agent_settings,
424
408
  discovery=discovery_settings,
@@ -490,12 +474,6 @@ class ConfigManager:
490
474
  "specifications": {
491
475
  "path": DEFAULT_SPECIFICATIONS_PATH.as_posix(),
492
476
  },
493
- "plans": {
494
- "path": DEFAULT_PLANS_PATH.as_posix(),
495
- },
496
- "templates": {
497
- "path": DEFAULT_TEMPLATES_PATH.as_posix(),
498
- },
499
477
  "documentation": {
500
478
  "language": language,
501
479
  },
@@ -658,8 +636,6 @@ class ConfigManager:
658
636
  for path in (
659
637
  config.constitution.path,
660
638
  config.specifications_path,
661
- config.plans_path,
662
- config.templates_path,
663
639
  ):
664
640
  resolved = path.resolve()
665
641
  try:
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
 
@@ -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, evidence entry and "
485
- "option count, and keep paths, field names, category identifiers, "
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
  )
@@ -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, option count and the meaning of every decision.
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.1
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.1`.**
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.1-py3-none-any.whl
213
+ pip install devflow_toolkit-0.4.3-py3-none-any.whl
214
214
  ```
215
215
 
216
216
  Verify the installation:
@@ -425,10 +425,6 @@ constitution:
425
425
  - django-standards.md
426
426
  specifications:
427
427
  path: .devflow/specs
428
- plans:
429
- path: .devflow/plans
430
- templates:
431
- path: .devflow/templates
432
428
  agent:
433
429
  harness: opencode
434
430
  model: provider/model-name
@@ -515,7 +511,7 @@ as an architectural constraint when it is present.
515
511
 
516
512
  ### Harnesses
517
513
 
518
- | Harness | Status in 0.4.1 |
514
+ | Harness | Status in 0.4.3 |
519
515
  | --- | --- |
520
516
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
521
517
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -725,6 +721,20 @@ selected harness is invoked instead of being skipped with an empty
725
721
  Discovery. Non-interactive runs keep the deterministic behavior for
726
722
  concrete requests such as `Add a health endpoint`.
727
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
+
728
738
  For user-generated content, Discovery must also resolve who writes it,
729
739
  who may create, edit or delete it, moderation, authentication
730
740
  mechanism, validation, ordering, lifecycle on parent deletion, admin
@@ -929,7 +939,7 @@ reference.
929
939
  8. If artifacts exist without workflow state, diagnose with
930
940
  `devflow doctor <id>` and repair with `devflow recover <id>`.
931
941
 
932
- Available commands in `0.4.1`:
942
+ Available commands in `0.4.3`:
933
943
 
934
944
  | Command | Status |
935
945
  | --- | --- |
@@ -1162,7 +1172,7 @@ devflow approve 001
1162
1172
  ```
1163
1173
 
1164
1174
  Approval is explicit and binds the decision to the current artifact
1165
- digests. For a `0.4.1` change it binds `spec.md`, `discovery.yaml` and,
1175
+ digests. For a `0.4.3` change it binds `spec.md`, `discovery.yaml` and,
1166
1176
  when a manifest applies, the architecture manifest digest. Repeating the
1167
1177
  same approval is a no-op. If an artifact changes after validation,
1168
1178
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -1173,7 +1183,7 @@ and names the pending questions and assumptions. Approval also rejects a
1173
1183
  specification whose section 7 still lists open questions. Legacy `0.2.0`
1174
1184
  changes without `discovery.yaml` remain approvable with a warning.
1175
1185
 
1176
- Only the `spec` stage is available in `0.4.1`, so `--stage` is optional
1186
+ Only the `spec` stage is available in `0.4.3`, so `--stage` is optional
1177
1187
  and defaults to `spec`. `--stage plan` and `--stage review` are
1178
1188
  rejected. There are no `plan`, `implement` or
1179
1189
  `review` commands in this release.
@@ -1256,12 +1266,18 @@ my-project/
1256
1266
  │ ├── spec.md # only when Discovery is complete
1257
1267
  │ ├── workflow.yaml # projection of events.jsonl
1258
1268
  │ ├── events.jsonl # append-only source of truth
1269
+ │ ├── history/ # earlier versions of spec.md
1259
1270
  │ └── .lock # per-change advisory lock
1260
1271
  ├── AGENTS.md
1261
1272
  ├── opencode.json # when OpenCode is selected
1262
1273
  └── .opencode/agents/ # when OpenCode is selected
1263
1274
  ```
1264
1275
 
1276
+ DevFlow creates only `constitution/` and `specs/` inside `.devflow/`.
1277
+ Projects initialized before `0.4.2` may also have empty `plans/` and
1278
+ `templates/` folders and matching keys in `config.yaml`; nothing uses
1279
+ them, so they can be deleted.
1280
+
1265
1281
  All managed files are identifiable: Markdown files contain
1266
1282
  `<!-- devflow:managed -->`, and JSON files contain `"devflowManaged":
1267
1283
  true`. Unmanaged files with the same names are left untouched and
@@ -25,9 +25,9 @@ devflow/commands/status.py,sha256=7psMpY_vFFSOQUia39_0W1-tnCijg1tQLgAX5aMduNo,84
25
25
  devflow/core/__init__.py,sha256=hN7i4-PDaZ7y4P8qRpZl_lJvIiPyQaN1TDGnw2BecYU,427
26
26
  devflow/core/architecture.py,sha256=qllllsUVqA76LiSU6z_s4U8dxMcs6ClKXU16HxI3yOI,13692
27
27
  devflow/core/clock.py,sha256=KZROv6o51Ln1EzK00ySCxfc7WPZqPlaQhFfjfdc_TMY,1651
28
- devflow/core/config.py,sha256=zeMxMAUlvLo06pOUZ6mCh0cQBG21iNfbCom62uYQQzE,27502
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=rm2-7Eq8APFQ6hetQWXcsJ8KB1yEKVDVVHHwr-XJNLM,66507
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=kTm7xjlvHLgkH9zYV7e51iPlZqRKJqL0ufA67-chcPc,21949
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=j6xP67cyie6rQ56_DZErdsbTJa-29vK72-Lg0rQdkY4,16595
70
- devflow/prompts/spec.md,sha256=5N4tuB_StJYMENAO-WtxXDL1D7B3x0xhHXu9VWoBBEE,8049
71
- devflow_toolkit-0.4.1.dist-info/METADATA,sha256=rNF8UUADaOXtPDYOYgB5ZTUMaA774jkQ7SyDlCRVV4w,57477
72
- devflow_toolkit-0.4.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
73
- devflow_toolkit-0.4.1.dist-info/entry_points.txt,sha256=wPmqE1081vi8s3xf-Wfzfvpl-44IKgwx7OGoLEK3u7o,44
74
- devflow_toolkit-0.4.1.dist-info/licenses/LICENSE,sha256=Wa04lstC8Goe4b9IYfEYWB2k7nokYBejZl6NdyAl8rA,1077
75
- devflow_toolkit-0.4.1.dist-info/RECORD,,
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,,