devflow-toolkit 0.3.15__py3-none-any.whl → 0.3.17__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/adapters/antigravity.py +7 -5
- devflow/adapters/codex.py +2 -0
- devflow/adapters/opencode.py +5 -3
- devflow/cli.py +1 -1
- devflow/commands/approve.py +1 -1
- devflow/commands/spec.py +1 -0
- devflow/commands/status.py +3 -1
- devflow/core/config.py +126 -0
- devflow/core/discovery.py +343 -40
- devflow/core/ports.py +3 -0
- devflow/core/spec_workflow.py +33 -5
- devflow/core/specification.py +80 -109
- devflow/profiles/base/constitution/code-standards.md +5 -4
- devflow/profiles/base/constitution/constitution.md +25 -8
- devflow/prompts/__init__.py +225 -54
- devflow/prompts/discovery.md +203 -104
- devflow/prompts/spec.md +108 -11
- {devflow_toolkit-0.3.15.dist-info → devflow_toolkit-0.3.17.dist-info}/METADATA +99 -25
- {devflow_toolkit-0.3.15.dist-info → devflow_toolkit-0.3.17.dist-info}/RECORD +22 -23
- devflow/prompts/spec.greenfield.md +0 -159
- {devflow_toolkit-0.3.15.dist-info → devflow_toolkit-0.3.17.dist-info}/WHEEL +0 -0
- {devflow_toolkit-0.3.15.dist-info → devflow_toolkit-0.3.17.dist-info}/entry_points.txt +0 -0
- {devflow_toolkit-0.3.15.dist-info → devflow_toolkit-0.3.17.dist-info}/licenses/LICENSE +0 -0
devflow/adapters/antigravity.py
CHANGED
|
@@ -256,11 +256,13 @@ class AntigravityAdapter(HarnessAdapter):
|
|
|
256
256
|
if interactive:
|
|
257
257
|
body.extend(
|
|
258
258
|
[
|
|
259
|
-
"During interactive Discovery, call the `ask_question` tool
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"
|
|
259
|
+
"During interactive Discovery, call the `ask_question` tool "
|
|
260
|
+
"once per round with every independent pending decision, and "
|
|
261
|
+
"use it for assumption acceptance. Respect the batch size "
|
|
262
|
+
"from the task prompt instead of asking one question at a "
|
|
263
|
+
"time. Present the recorded options in the dialog instead of "
|
|
264
|
+
"asking in free-form prose, and wait for the user's selection "
|
|
265
|
+
"before recording anything.",
|
|
264
266
|
"",
|
|
265
267
|
]
|
|
266
268
|
)
|
devflow/adapters/codex.py
CHANGED
|
@@ -23,6 +23,8 @@ class CodexAdapter(HarnessAdapter):
|
|
|
23
23
|
name = "codex"
|
|
24
24
|
display_name = "Codex"
|
|
25
25
|
executable = "codex"
|
|
26
|
+
# Codex describes request_user_input as one to three short questions.
|
|
27
|
+
max_questions_per_call = 3
|
|
26
28
|
|
|
27
29
|
def setup(self, context: SetupContext) -> SetupResult:
|
|
28
30
|
content = render_agent_instructions(
|
devflow/adapters/opencode.py
CHANGED
|
@@ -194,11 +194,13 @@ class OpenCodeAdapter(HarnessAdapter):
|
|
|
194
194
|
if interactive:
|
|
195
195
|
body.extend(
|
|
196
196
|
[
|
|
197
|
-
"During interactive Discovery, call the `question` tool
|
|
198
|
-
"every pending
|
|
197
|
+
"During interactive Discovery, call the `question` tool once "
|
|
198
|
+
"per round with every independent pending decision, and use "
|
|
199
|
+
"it for assumption acceptance. Respect the batch size from "
|
|
200
|
+
"the task prompt instead of asking one question at a time. "
|
|
199
201
|
"Present the recorded options in the dialog instead of asking "
|
|
200
202
|
"in free-form prose, and wait for the user's selection before "
|
|
201
|
-
"recording
|
|
203
|
+
"recording anything.",
|
|
202
204
|
"",
|
|
203
205
|
]
|
|
204
206
|
)
|
devflow/cli.py
CHANGED
devflow/commands/approve.py
CHANGED
|
@@ -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.17. "
|
|
61
61
|
"Only the 'spec' stage can be approved."
|
|
62
62
|
)
|
|
63
63
|
raise UnsupportedStageError(msg)
|
devflow/commands/spec.py
CHANGED
|
@@ -248,6 +248,7 @@ def _create_specification(
|
|
|
248
248
|
console.print(
|
|
249
249
|
f"[bold]Discovery:[/bold] {result.discovery.status} "
|
|
250
250
|
f"({len(result.discovery.pending_questions)} pending, "
|
|
251
|
+
f"{len(result.discovery.pending_material)} material, "
|
|
251
252
|
f"{len(result.discovery.pending_assumptions)} assumptions)"
|
|
252
253
|
)
|
|
253
254
|
if result.discovery_digest:
|
devflow/commands/status.py
CHANGED
|
@@ -130,6 +130,7 @@ def _print_discovery(
|
|
|
130
130
|
f" status: {discovery.status} · "
|
|
131
131
|
f"{len(discovery.pending_questions)} pending · "
|
|
132
132
|
f"{len(discovery.pending_blocking)} blocking · "
|
|
133
|
+
f"{len(discovery.pending_material)} material · "
|
|
133
134
|
f"{len(discovery.pending_assumptions)} assumptions"
|
|
134
135
|
)
|
|
135
136
|
for question in discovery.questions:
|
|
@@ -140,7 +141,8 @@ def _print_discovery(
|
|
|
140
141
|
else " (pending)"
|
|
141
142
|
)
|
|
142
143
|
console.print(
|
|
143
|
-
f" {question.id} [{question.category},
|
|
144
|
+
f" {question.id} [{question.category}, "
|
|
145
|
+
f"{question.effective_materiality}, {marker}] "
|
|
144
146
|
f"{question.status}{answer}",
|
|
145
147
|
soft_wrap=True,
|
|
146
148
|
)
|
devflow/core/config.py
CHANGED
|
@@ -23,6 +23,7 @@ DEFAULT_SPECIFICATIONS_PATH = Path(".devflow") / "specs"
|
|
|
23
23
|
DEFAULT_PLANS_PATH = Path(".devflow") / "plans"
|
|
24
24
|
DEFAULT_TEMPLATES_PATH = Path(".devflow") / "templates"
|
|
25
25
|
DEFAULT_DOCUMENTATION_LANGUAGE = "en"
|
|
26
|
+
MAX_DISCOVERY_BUDGET = 100
|
|
26
27
|
|
|
27
28
|
_LANGUAGE_ALIASES = {
|
|
28
29
|
"aleman": "de",
|
|
@@ -207,6 +208,19 @@ class AgentSettings:
|
|
|
207
208
|
permissions: AgentPermissions = AgentPermissions()
|
|
208
209
|
|
|
209
210
|
|
|
211
|
+
@dataclass(frozen=True)
|
|
212
|
+
class DiscoverySettings:
|
|
213
|
+
"""Deterministic limits for the Discovery decision loop."""
|
|
214
|
+
|
|
215
|
+
question_budget_initial: int = 6
|
|
216
|
+
question_budget_follow_up: int = 3
|
|
217
|
+
question_budget_maximum: int = 12
|
|
218
|
+
max_rounds: int = 3
|
|
219
|
+
batch_size: int = 6
|
|
220
|
+
assumptions_enabled: bool = True
|
|
221
|
+
require_explicit_acceptance: bool = True
|
|
222
|
+
|
|
223
|
+
|
|
210
224
|
@dataclass(frozen=True)
|
|
211
225
|
class DevFlowConfig:
|
|
212
226
|
"""Validated DevFlow configuration for a project."""
|
|
@@ -224,6 +238,7 @@ class DevFlowConfig:
|
|
|
224
238
|
templates_path: Path
|
|
225
239
|
documentation_language: str
|
|
226
240
|
agent: AgentSettings
|
|
241
|
+
discovery: DiscoverySettings = DiscoverySettings()
|
|
227
242
|
|
|
228
243
|
@property
|
|
229
244
|
def agent_harness(self) -> str:
|
|
@@ -296,6 +311,11 @@ class ConfigManager:
|
|
|
296
311
|
)
|
|
297
312
|
agent = self._mapping(data.get("agent", {}), "agent")
|
|
298
313
|
agent_settings = self._agent_settings(agent)
|
|
314
|
+
discovery = self._mapping(
|
|
315
|
+
data.get("discovery", {}),
|
|
316
|
+
"discovery",
|
|
317
|
+
)
|
|
318
|
+
discovery_settings = self._discovery_settings(discovery)
|
|
299
319
|
|
|
300
320
|
profiles = self._string_list(
|
|
301
321
|
data.get("profiles", []),
|
|
@@ -383,6 +403,7 @@ class ConfigManager:
|
|
|
383
403
|
templates_path=templates_path,
|
|
384
404
|
documentation_language=documentation_language,
|
|
385
405
|
agent=agent_settings,
|
|
406
|
+
discovery=discovery_settings,
|
|
386
407
|
)
|
|
387
408
|
|
|
388
409
|
def create(
|
|
@@ -459,6 +480,21 @@ class ConfigManager:
|
|
|
459
480
|
"documentation": {
|
|
460
481
|
"language": language,
|
|
461
482
|
},
|
|
483
|
+
"discovery": {
|
|
484
|
+
"question_budget": {
|
|
485
|
+
"initial": 6,
|
|
486
|
+
"follow_up": 3,
|
|
487
|
+
"maximum": 12,
|
|
488
|
+
},
|
|
489
|
+
"interaction": {
|
|
490
|
+
"batch_size": 6,
|
|
491
|
+
"max_rounds": 3,
|
|
492
|
+
},
|
|
493
|
+
"assumptions": {
|
|
494
|
+
"enabled": True,
|
|
495
|
+
"require_explicit_acceptance": True,
|
|
496
|
+
},
|
|
497
|
+
},
|
|
462
498
|
"agent": {
|
|
463
499
|
"harness": harness,
|
|
464
500
|
"execution": {
|
|
@@ -684,6 +720,78 @@ class ConfigManager:
|
|
|
684
720
|
),
|
|
685
721
|
)
|
|
686
722
|
|
|
723
|
+
def _discovery_settings(
|
|
724
|
+
self,
|
|
725
|
+
discovery: dict[str, Any],
|
|
726
|
+
) -> DiscoverySettings:
|
|
727
|
+
budget = self._mapping(
|
|
728
|
+
discovery.get("question_budget", {}),
|
|
729
|
+
"discovery.question_budget",
|
|
730
|
+
)
|
|
731
|
+
interaction = self._mapping(
|
|
732
|
+
discovery.get("interaction", {}),
|
|
733
|
+
"discovery.interaction",
|
|
734
|
+
)
|
|
735
|
+
assumptions = self._mapping(
|
|
736
|
+
discovery.get("assumptions", {}),
|
|
737
|
+
"discovery.assumptions",
|
|
738
|
+
)
|
|
739
|
+
initial = self._bounded_integer(
|
|
740
|
+
budget.get("initial", 6),
|
|
741
|
+
"discovery.question_budget.initial",
|
|
742
|
+
minimum=0,
|
|
743
|
+
maximum=100,
|
|
744
|
+
)
|
|
745
|
+
follow_up = self._bounded_integer(
|
|
746
|
+
budget.get("follow_up", 3),
|
|
747
|
+
"discovery.question_budget.follow_up",
|
|
748
|
+
minimum=0,
|
|
749
|
+
maximum=100,
|
|
750
|
+
)
|
|
751
|
+
maximum = self._bounded_integer(
|
|
752
|
+
budget.get("maximum", 12),
|
|
753
|
+
"discovery.question_budget.maximum",
|
|
754
|
+
minimum=0,
|
|
755
|
+
maximum=MAX_DISCOVERY_BUDGET,
|
|
756
|
+
)
|
|
757
|
+
if maximum and initial > maximum:
|
|
758
|
+
msg = (
|
|
759
|
+
"discovery.question_budget.initial cannot exceed "
|
|
760
|
+
"discovery.question_budget.maximum."
|
|
761
|
+
)
|
|
762
|
+
raise ConfigError(msg)
|
|
763
|
+
if maximum and follow_up > maximum:
|
|
764
|
+
msg = (
|
|
765
|
+
"discovery.question_budget.follow_up cannot exceed "
|
|
766
|
+
"discovery.question_budget.maximum."
|
|
767
|
+
)
|
|
768
|
+
raise ConfigError(msg)
|
|
769
|
+
return DiscoverySettings(
|
|
770
|
+
question_budget_initial=initial,
|
|
771
|
+
question_budget_follow_up=follow_up,
|
|
772
|
+
question_budget_maximum=maximum,
|
|
773
|
+
max_rounds=self._bounded_integer(
|
|
774
|
+
interaction.get("max_rounds", 3),
|
|
775
|
+
"discovery.interaction.max_rounds",
|
|
776
|
+
minimum=1,
|
|
777
|
+
maximum=20,
|
|
778
|
+
),
|
|
779
|
+
batch_size=self._bounded_integer(
|
|
780
|
+
interaction.get("batch_size", 6),
|
|
781
|
+
"discovery.interaction.batch_size",
|
|
782
|
+
minimum=1,
|
|
783
|
+
maximum=20,
|
|
784
|
+
),
|
|
785
|
+
assumptions_enabled=self._boolean(
|
|
786
|
+
assumptions.get("enabled", True),
|
|
787
|
+
"discovery.assumptions.enabled",
|
|
788
|
+
),
|
|
789
|
+
require_explicit_acceptance=self._boolean(
|
|
790
|
+
assumptions.get("require_explicit_acceptance", True),
|
|
791
|
+
"discovery.assumptions.require_explicit_acceptance",
|
|
792
|
+
),
|
|
793
|
+
)
|
|
794
|
+
|
|
687
795
|
def _write_atomic(self, content: str) -> None:
|
|
688
796
|
target = self._target_path()
|
|
689
797
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -739,6 +847,24 @@ class ConfigManager:
|
|
|
739
847
|
raise ConfigError(msg)
|
|
740
848
|
return value
|
|
741
849
|
|
|
850
|
+
def _bounded_integer(
|
|
851
|
+
self,
|
|
852
|
+
value: Any,
|
|
853
|
+
field: str,
|
|
854
|
+
*,
|
|
855
|
+
minimum: int,
|
|
856
|
+
maximum: int,
|
|
857
|
+
) -> int:
|
|
858
|
+
if isinstance(value, bool) or not isinstance(value, int):
|
|
859
|
+
msg = f"{field} must be an integer."
|
|
860
|
+
raise ConfigError(msg)
|
|
861
|
+
if value < minimum or value > maximum:
|
|
862
|
+
msg = (
|
|
863
|
+
f"{field} must be between {minimum} and {maximum}."
|
|
864
|
+
)
|
|
865
|
+
raise ConfigError(msg)
|
|
866
|
+
return value
|
|
867
|
+
|
|
742
868
|
def _technologies(self, value: Any) -> dict[str, list[str]]:
|
|
743
869
|
if value is None:
|
|
744
870
|
return {}
|