devflow-toolkit 0.4.4__tar.gz → 0.4.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.4.4 → devflow_toolkit-0.4.6}/CHANGELOG.md +68 -1
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/PKG-INFO +84 -13
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/README.md +7 -5
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/docs/REFERENCE.md +83 -12
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/pyproject.toml +1 -1
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/claude_code.py +11 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/opencode.py +15 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/harness.py +31 -7
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/reopen.py +61 -24
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/spec.py +20 -1
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/discovery.py +157 -0
- devflow_toolkit-0.4.6/src/devflow/core/model_tiers.py +62 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/ports.py +10 -0
- devflow_toolkit-0.4.6/src/devflow/core/sessions.py +66 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/spec_workflow.py +73 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/specification.py +207 -25
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/manager.py +70 -31
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/prompts/__init__.py +6 -2
- devflow_toolkit-0.4.6/src/devflow/prompts/discovery.md +272 -0
- devflow_toolkit-0.4.6/src/devflow/prompts/spec.md +230 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_security_fixes.py +219 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_spec_workflow.py +154 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_state.py +1 -1
- devflow_toolkit-0.4.4/src/devflow/prompts/discovery.md +0 -413
- devflow_toolkit-0.4.4/src/devflow/prompts/spec.md +0 -246
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/.gitignore +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/LICENSE +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/docs/PRESENTATION.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/docs/PUBLISHING.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/agents.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/antigravity.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/base.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/codex.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/detector.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/instructions.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/kiro.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/adapters/registry.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/cli.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/approve.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/config.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/doctor.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/init.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/recover.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/security.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/commands/status.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/architecture.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/artifacts/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/artifacts/errors.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/artifacts/models.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/artifacts/store.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/clock.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/config.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/constitution.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/file_types.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/profile_manager.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/project.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/recovery.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/safe_files.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/security_baseline.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/security_tools.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/errors.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/events.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/locator.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/lock.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/models.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/signing.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/core/state/transitions.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/hooks/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/hooks/claude_guard.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/models/__init__.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/models/profile.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/models/project.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/base/constitution/architecture.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/base/constitution/constitution.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/base/profile.yaml +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/django-backend/profile.yaml +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/src/devflow/prompts/discovery-repair.md +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/conftest.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_cli.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_discovery.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_discovery_decisions.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_event_log.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_greenfield.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_hardening.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_harness_adapters.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_recovery.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_security_baseline.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_security_tools.py +0 -0
- {devflow_toolkit-0.4.4 → devflow_toolkit-0.4.6}/tests/test_state_replay.py +0 -0
|
@@ -2,6 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to DevFlow Toolkit are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.4.6 - 2026-11-30
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `devflow spec --scope <path>` limits a new change to one or more
|
|
10
|
+
directories or files: the analysis and the agent stay inside them.
|
|
11
|
+
- In projects with 150 or more source files, when the request does not
|
|
12
|
+
name a module, Discovery first asks where the change happens, offering
|
|
13
|
+
the directories with the strongest matches. Answering with a path
|
|
14
|
+
limits the analysis to it.
|
|
15
|
+
- The specification run resumes the Discovery session with Claude Code
|
|
16
|
+
(`--session-id` / `--resume`) and OpenCode (`--session`) when both
|
|
17
|
+
phases use the same harness, so the agent does not start from zero and
|
|
18
|
+
the provider can reuse its cache. A non-interactive run that cannot
|
|
19
|
+
resume starts a new session. Sessions are stored in
|
|
20
|
+
`.devflow/.local/sessions.json`, ignored by git.
|
|
21
|
+
- Model lists in `init`, `harness use` and `harness models` mark each
|
|
22
|
+
model as mid-range (recommended for Discovery and specs), most capable
|
|
23
|
+
(best for implementation) or small (not recommended), and show the
|
|
24
|
+
recommended ones first.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- `context.md` gives a reading plan: the ten most relevant files, each
|
|
29
|
+
with the matching classes or functions and their line ranges, and an
|
|
30
|
+
instruction to read only those ranges. Generic words (*add*, *create*,
|
|
31
|
+
*new*...) and `AGENTS.md`, `CLAUDE.md` and `CHANGELOG.md` no longer
|
|
32
|
+
count as evidence, and files matching several request terms rank
|
|
33
|
+
higher.
|
|
34
|
+
- The Discovery prompt is about a third shorter and the specification
|
|
35
|
+
prompt slightly shorter. Both put the request, paths and digests at the
|
|
36
|
+
end so the fixed part can be cached between specs, and both ask the
|
|
37
|
+
agent to read only the constitution sections that apply.
|
|
38
|
+
|
|
39
|
+
### Upgrade notes
|
|
40
|
+
|
|
41
|
+
- In projects with 150 or more source files, a new change whose request
|
|
42
|
+
names no module now asks where the change happens. With `--no-agent`,
|
|
43
|
+
answer it in `discovery.yaml` or pass `--scope`.
|
|
44
|
+
|
|
45
|
+
### Package
|
|
46
|
+
|
|
47
|
+
- Package version is `0.4.6`.
|
|
48
|
+
|
|
49
|
+
## 0.4.5 - 2026-11-30
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- `devflow reopen` is clearer when you want to extend a specification:
|
|
54
|
+
- New `--add "what to add"`: records the new scope in Discovery and
|
|
55
|
+
reopens it, so the agent asks only about the new decisions and then
|
|
56
|
+
writes the extended spec. It implies `--discovery`.
|
|
57
|
+
- `--discovery` and `--add` work on a change that is not approved yet;
|
|
58
|
+
before, they failed with "nothing to reopen".
|
|
59
|
+
- The confirmation matches the state: it asks to withdraw the approval
|
|
60
|
+
only when there is one, and to reopen Discovery otherwise.
|
|
61
|
+
- A plain `reopen` on a change that is not approved explains that it is
|
|
62
|
+
already open and how to extend it.
|
|
63
|
+
- When `devflow spec --continue` finds the spec unchanged, it explains
|
|
64
|
+
how to extend it with `devflow reopen <id> --add`.
|
|
65
|
+
- The reopened-Discovery prompt starts from the added scope and keeps the
|
|
66
|
+
decisions already answered.
|
|
67
|
+
|
|
68
|
+
### Package
|
|
69
|
+
|
|
70
|
+
- Package version is `0.4.5`, published on TestPyPI and PyPI.
|
|
71
|
+
|
|
5
72
|
## 0.4.4 - 2026-11-30
|
|
6
73
|
|
|
7
74
|
### Security
|
|
@@ -82,7 +149,7 @@ DevFlow inside a cloned repository they do not control.
|
|
|
82
149
|
|
|
83
150
|
### Package
|
|
84
151
|
|
|
85
|
-
- Package version is `0.4.4
|
|
152
|
+
- Package version is `0.4.4`, published on TestPyPI and PyPI.
|
|
86
153
|
|
|
87
154
|
### Added
|
|
88
155
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: devflow-toolkit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
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.6`.**
|
|
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.6-py3-none-any.whl
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
Verify the installation:
|
|
@@ -527,7 +527,7 @@ as an architectural constraint when it is present.
|
|
|
527
527
|
|
|
528
528
|
### Harnesses
|
|
529
529
|
|
|
530
|
-
| Harness | Status in 0.4.
|
|
530
|
+
| Harness | Status in 0.4.6 |
|
|
531
531
|
| --- | --- |
|
|
532
532
|
| OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
|
|
533
533
|
| Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
|
|
@@ -984,14 +984,14 @@ reference.
|
|
|
984
984
|
8. If artifacts exist without workflow state, diagnose with
|
|
985
985
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
986
986
|
|
|
987
|
-
Available commands in `0.4.
|
|
987
|
+
Available commands in `0.4.6`:
|
|
988
988
|
|
|
989
989
|
| Command | Status |
|
|
990
990
|
| --- | --- |
|
|
991
991
|
| `devflow init` | Implemented |
|
|
992
992
|
| `devflow spec` | Implemented: Discovery, specification, and `--continue` |
|
|
993
993
|
| `devflow approve <id>` (stage `spec` by default) | Implemented |
|
|
994
|
-
| `devflow reopen <id>` | Implemented: withdraw a spec approval to
|
|
994
|
+
| `devflow reopen <id>` | Implemented: withdraw a spec approval, or reopen Discovery with `--discovery` / `--add` to extend the spec |
|
|
995
995
|
| `devflow status <id>` | Implemented |
|
|
996
996
|
| `devflow doctor <id>` | Implemented: read-only diagnostics |
|
|
997
997
|
| `devflow recover <id>` | Implemented: register existing artifacts |
|
|
@@ -1134,6 +1134,64 @@ remains usable in CI and on machines without an AI harness, but the draft
|
|
|
1134
1134
|
still requires human review. A request that is not ready never receives
|
|
1135
1135
|
a silent deterministic specification: Discovery stops instead.
|
|
1136
1136
|
|
|
1137
|
+
### Large projects and token usage
|
|
1138
|
+
|
|
1139
|
+
Each agent session starts from zero and reads the prompt, the context,
|
|
1140
|
+
the constitution and the code it explores. DevFlow keeps that small:
|
|
1141
|
+
|
|
1142
|
+
- **Precise reading plan.** `context.md` lists the most relevant files
|
|
1143
|
+
first (at most ten), each with the classes or functions that matched
|
|
1144
|
+
and their line ranges, for example
|
|
1145
|
+
`apps/accounts/views.py — LoginView (L4-7)`. The agent reads only
|
|
1146
|
+
those ranges and opens other files only when a decision needs them.
|
|
1147
|
+
Generic words such as *add*, *create* or *new* and agent instruction
|
|
1148
|
+
files (`AGENTS.md`, `CLAUDE.md`) are not used as evidence.
|
|
1149
|
+
- **Where the change happens.** In a project with 150 or more source
|
|
1150
|
+
files, when the request does not name a module, Discovery first asks
|
|
1151
|
+
where the change goes. The options are the directories with the
|
|
1152
|
+
strongest matches, so the question helps even someone who does not
|
|
1153
|
+
know the code. Answer with a path to limit the analysis to it, or name
|
|
1154
|
+
a module, file, class or function.
|
|
1155
|
+
- **`--scope`.** Skip that question by stating the place yourself:
|
|
1156
|
+
|
|
1157
|
+
```bash
|
|
1158
|
+
devflow spec "Add login with username and password" --scope apps/accounts
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
Repeat `--scope` for several places. The analysis and the agent stay
|
|
1162
|
+
inside them. It applies to new changes; to move an existing one, use
|
|
1163
|
+
`devflow reopen <id> --add`.
|
|
1164
|
+
- **Shorter prompts, cache-friendly.** The fixed instructions come first
|
|
1165
|
+
and the request, paths and digests last, so providers that cache
|
|
1166
|
+
prompts (Anthropic, OpenAI, Gemini) can reuse the fixed part between
|
|
1167
|
+
specs. DevFlow cannot force a provider to cache; this only makes it
|
|
1168
|
+
possible.
|
|
1169
|
+
- **One session for both phases.** With Claude Code and OpenCode, the
|
|
1170
|
+
specification run resumes the Discovery session (`--resume` /
|
|
1171
|
+
`--session`) when you use the same harness, so the agent keeps what it
|
|
1172
|
+
already read and the provider can reuse its cache. If the session
|
|
1173
|
+
cannot be resumed in a non-interactive run, DevFlow starts a new one.
|
|
1174
|
+
Codex, Kiro and Antigravity always start a new session. Sessions are
|
|
1175
|
+
recorded in `.devflow/.local/sessions.json`, which git ignores.
|
|
1176
|
+
|
|
1177
|
+
### Choosing a model
|
|
1178
|
+
|
|
1179
|
+
`devflow init`, `devflow harness use` and `devflow harness models` mark
|
|
1180
|
+
each model with a recommendation and list the recommended ones first:
|
|
1181
|
+
|
|
1182
|
+
- **mid-range** (for example Sonnet, GPT-5 mini, Gemini Flash):
|
|
1183
|
+
recommended for Discovery and specs. DevFlow already provides the
|
|
1184
|
+
stack, the code evidence and the security baseline, and validates the
|
|
1185
|
+
result.
|
|
1186
|
+
- **most capable** (for example Opus, GPT-5, Gemini Pro): best for
|
|
1187
|
+
implementation.
|
|
1188
|
+
- **small** (for example Haiku, nano, Flash Lite): not recommended; they
|
|
1189
|
+
ask poor questions and miss decisions.
|
|
1190
|
+
|
|
1191
|
+
The classification comes from the model name; unknown names are shown
|
|
1192
|
+
without a label. Use `--model` on `devflow spec` to pick a model for one
|
|
1193
|
+
run.
|
|
1194
|
+
|
|
1137
1195
|
### Check status
|
|
1138
1196
|
|
|
1139
1197
|
```bash
|
|
@@ -1217,7 +1275,7 @@ devflow approve 001
|
|
|
1217
1275
|
```
|
|
1218
1276
|
|
|
1219
1277
|
Approval is explicit and binds the decision to the current artifact
|
|
1220
|
-
digests. For a `0.4.
|
|
1278
|
+
digests. For a `0.4.6` change it binds `spec.md`, `discovery.yaml` and,
|
|
1221
1279
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
1222
1280
|
same approval is a no-op. If an artifact changes after validation,
|
|
1223
1281
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -1237,7 +1295,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
1237
1295
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
1238
1296
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
1239
1297
|
|
|
1240
|
-
Only the `spec` stage is available in `0.4.
|
|
1298
|
+
Only the `spec` stage is available in `0.4.6`, so `--stage` is optional
|
|
1241
1299
|
and defaults to `spec`. `--stage plan` and `--stage review` are
|
|
1242
1300
|
rejected. There are no `plan`, `implement` or
|
|
1243
1301
|
`review` commands in this release.
|
|
@@ -1265,16 +1323,22 @@ The generated `AGENTS.md` (or `CLAUDE.md`) tells the agent to:
|
|
|
1265
1323
|
this step. Discovery and specification prompts skip it to save tokens;
|
|
1266
1324
|
the specification still lists it in section 9.
|
|
1267
1325
|
|
|
1268
|
-
### Reopen
|
|
1326
|
+
### Reopen a specification to change or extend it
|
|
1269
1327
|
|
|
1270
1328
|
An approved specification is a contract. To change it, reopen it first;
|
|
1271
1329
|
editing `spec.md` directly only marks it `stale`.
|
|
1272
1330
|
|
|
1273
1331
|
```bash
|
|
1274
|
-
devflow reopen 001
|
|
1275
|
-
devflow reopen 001 --
|
|
1332
|
+
devflow reopen 001 # fix the spec text yourself
|
|
1333
|
+
devflow reopen 001 --add "password reset" # the agent extends the spec
|
|
1334
|
+
devflow reopen 001 --discovery # the agent asks what to change
|
|
1276
1335
|
```
|
|
1277
1336
|
|
|
1337
|
+
`--add` records what you want to add at the end of the Discovery request
|
|
1338
|
+
(`Additional scope (date): ...`) and implies `--discovery`. The agent
|
|
1339
|
+
starts from that text, asks only about the new decisions and keeps the
|
|
1340
|
+
decisions already answered unless the new scope contradicts them.
|
|
1341
|
+
|
|
1278
1342
|
`reopen` asks for confirmation (skip it with `--yes`), copies the
|
|
1279
1343
|
current `spec.md` into `history/`, records a `spec_reopened` event and
|
|
1280
1344
|
withdraws the approval. The previous approval stays in `events.jsonl`;
|
|
@@ -1297,8 +1361,13 @@ devflow spec --continue 001 # writes the new spec
|
|
|
1297
1361
|
devflow approve 001
|
|
1298
1362
|
```
|
|
1299
1363
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1364
|
+
`--discovery` and `--add` also work on a change that is not approved
|
|
1365
|
+
yet: they reopen Discovery without any approval to withdraw. A plain
|
|
1366
|
+
`devflow reopen 001` on a change that is not approved explains that it
|
|
1367
|
+
is already open and how to extend it. When `spec --continue` finds the
|
|
1368
|
+
spec unchanged, it shows the same hint. Extending a spec through
|
|
1369
|
+
Discovery needs an interactive harness, because the agent asks you the
|
|
1370
|
+
new questions.
|
|
1302
1371
|
|
|
1303
1372
|
## Generated files
|
|
1304
1373
|
|
|
@@ -1308,6 +1377,8 @@ my-project/
|
|
|
1308
1377
|
│ ├── config.yaml
|
|
1309
1378
|
│ ├── architecture.yaml # declared architecture (Greenfield)
|
|
1310
1379
|
│ ├── .specs.lock # serializes specification id assignment
|
|
1380
|
+
│ ├── .local/ # machine-local, ignored by git
|
|
1381
|
+
│ │ └── sessions.json # harness session of each change
|
|
1311
1382
|
│ ├── constitution/
|
|
1312
1383
|
│ │ ├── constitution.md
|
|
1313
1384
|
│ │ ├── code-standards.md
|
|
@@ -32,7 +32,7 @@ tokens, which cost several times more than input tokens.
|
|
|
32
32
|
The goal is not to generate code faster, but to decide better before
|
|
33
33
|
generating it. Thinking is cheap; redoing code is expensive.
|
|
34
34
|
|
|
35
|
-
Current version: `0.4.
|
|
35
|
+
Current version: `0.4.6` · Python 3.11+ · Linux and macOS
|
|
36
36
|
|
|
37
37
|
## Install
|
|
38
38
|
|
|
@@ -142,11 +142,12 @@ The `AGENTS.md` file created by `devflow init` tells the agent to check
|
|
|
142
142
|
the approval, follow your code standards, build only the listed
|
|
143
143
|
requirements and report every acceptance criterion.
|
|
144
144
|
|
|
145
|
-
### 6. Change
|
|
145
|
+
### 6. Change or extend a spec (if needed)
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
|
-
devflow reopen 001
|
|
149
|
-
devflow reopen 001 --
|
|
148
|
+
devflow reopen 001 # you edit spec.md yourself
|
|
149
|
+
devflow reopen 001 --add "password reset" # the agent extends the spec
|
|
150
|
+
devflow reopen 001 --discovery # the agent asks what to change
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
Then run `devflow spec --continue 001` and approve again. The previous
|
|
@@ -159,8 +160,9 @@ version is kept in `history/`.
|
|
|
159
160
|
| `devflow init` | Prepare the project and the agent integration |
|
|
160
161
|
| `devflow spec "…"` | Start a change with Discovery |
|
|
161
162
|
| `devflow spec --continue 001` | Resume Discovery or write the spec |
|
|
163
|
+
| `devflow spec "…" --scope apps/accounts` | Limit a new change to a module (large projects) |
|
|
162
164
|
| `devflow approve 001` | Approve the spec |
|
|
163
|
-
| `devflow reopen 001` |
|
|
165
|
+
| `devflow reopen 001 --add "…"` | Extend or change the spec with the agent |
|
|
164
166
|
| `devflow status 001` | Show where the change is and the next command |
|
|
165
167
|
|
|
166
168
|
## When something looks wrong
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DevFlow Toolkit
|
|
2
2
|
|
|
3
|
-
**Current version: `0.4.
|
|
3
|
+
**Current version: `0.4.6`.**
|
|
4
4
|
|
|
5
5
|
Before any code is written, you and the AI agree on what will be built
|
|
6
6
|
and approve it as a spec. The agent then implements once, on something
|
|
@@ -178,7 +178,7 @@ pip install devflow-toolkit
|
|
|
178
178
|
To install a specific built artifact instead:
|
|
179
179
|
|
|
180
180
|
```bash
|
|
181
|
-
pip install devflow_toolkit-0.4.
|
|
181
|
+
pip install devflow_toolkit-0.4.6-py3-none-any.whl
|
|
182
182
|
```
|
|
183
183
|
|
|
184
184
|
Verify the installation:
|
|
@@ -495,7 +495,7 @@ as an architectural constraint when it is present.
|
|
|
495
495
|
|
|
496
496
|
### Harnesses
|
|
497
497
|
|
|
498
|
-
| Harness | Status in 0.4.
|
|
498
|
+
| Harness | Status in 0.4.6 |
|
|
499
499
|
| --- | --- |
|
|
500
500
|
| OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
|
|
501
501
|
| Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
|
|
@@ -952,14 +952,14 @@ reference.
|
|
|
952
952
|
8. If artifacts exist without workflow state, diagnose with
|
|
953
953
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
954
954
|
|
|
955
|
-
Available commands in `0.4.
|
|
955
|
+
Available commands in `0.4.6`:
|
|
956
956
|
|
|
957
957
|
| Command | Status |
|
|
958
958
|
| --- | --- |
|
|
959
959
|
| `devflow init` | Implemented |
|
|
960
960
|
| `devflow spec` | Implemented: Discovery, specification, and `--continue` |
|
|
961
961
|
| `devflow approve <id>` (stage `spec` by default) | Implemented |
|
|
962
|
-
| `devflow reopen <id>` | Implemented: withdraw a spec approval to
|
|
962
|
+
| `devflow reopen <id>` | Implemented: withdraw a spec approval, or reopen Discovery with `--discovery` / `--add` to extend the spec |
|
|
963
963
|
| `devflow status <id>` | Implemented |
|
|
964
964
|
| `devflow doctor <id>` | Implemented: read-only diagnostics |
|
|
965
965
|
| `devflow recover <id>` | Implemented: register existing artifacts |
|
|
@@ -1102,6 +1102,64 @@ remains usable in CI and on machines without an AI harness, but the draft
|
|
|
1102
1102
|
still requires human review. A request that is not ready never receives
|
|
1103
1103
|
a silent deterministic specification: Discovery stops instead.
|
|
1104
1104
|
|
|
1105
|
+
### Large projects and token usage
|
|
1106
|
+
|
|
1107
|
+
Each agent session starts from zero and reads the prompt, the context,
|
|
1108
|
+
the constitution and the code it explores. DevFlow keeps that small:
|
|
1109
|
+
|
|
1110
|
+
- **Precise reading plan.** `context.md` lists the most relevant files
|
|
1111
|
+
first (at most ten), each with the classes or functions that matched
|
|
1112
|
+
and their line ranges, for example
|
|
1113
|
+
`apps/accounts/views.py — LoginView (L4-7)`. The agent reads only
|
|
1114
|
+
those ranges and opens other files only when a decision needs them.
|
|
1115
|
+
Generic words such as *add*, *create* or *new* and agent instruction
|
|
1116
|
+
files (`AGENTS.md`, `CLAUDE.md`) are not used as evidence.
|
|
1117
|
+
- **Where the change happens.** In a project with 150 or more source
|
|
1118
|
+
files, when the request does not name a module, Discovery first asks
|
|
1119
|
+
where the change goes. The options are the directories with the
|
|
1120
|
+
strongest matches, so the question helps even someone who does not
|
|
1121
|
+
know the code. Answer with a path to limit the analysis to it, or name
|
|
1122
|
+
a module, file, class or function.
|
|
1123
|
+
- **`--scope`.** Skip that question by stating the place yourself:
|
|
1124
|
+
|
|
1125
|
+
```bash
|
|
1126
|
+
devflow spec "Add login with username and password" --scope apps/accounts
|
|
1127
|
+
```
|
|
1128
|
+
|
|
1129
|
+
Repeat `--scope` for several places. The analysis and the agent stay
|
|
1130
|
+
inside them. It applies to new changes; to move an existing one, use
|
|
1131
|
+
`devflow reopen <id> --add`.
|
|
1132
|
+
- **Shorter prompts, cache-friendly.** The fixed instructions come first
|
|
1133
|
+
and the request, paths and digests last, so providers that cache
|
|
1134
|
+
prompts (Anthropic, OpenAI, Gemini) can reuse the fixed part between
|
|
1135
|
+
specs. DevFlow cannot force a provider to cache; this only makes it
|
|
1136
|
+
possible.
|
|
1137
|
+
- **One session for both phases.** With Claude Code and OpenCode, the
|
|
1138
|
+
specification run resumes the Discovery session (`--resume` /
|
|
1139
|
+
`--session`) when you use the same harness, so the agent keeps what it
|
|
1140
|
+
already read and the provider can reuse its cache. If the session
|
|
1141
|
+
cannot be resumed in a non-interactive run, DevFlow starts a new one.
|
|
1142
|
+
Codex, Kiro and Antigravity always start a new session. Sessions are
|
|
1143
|
+
recorded in `.devflow/.local/sessions.json`, which git ignores.
|
|
1144
|
+
|
|
1145
|
+
### Choosing a model
|
|
1146
|
+
|
|
1147
|
+
`devflow init`, `devflow harness use` and `devflow harness models` mark
|
|
1148
|
+
each model with a recommendation and list the recommended ones first:
|
|
1149
|
+
|
|
1150
|
+
- **mid-range** (for example Sonnet, GPT-5 mini, Gemini Flash):
|
|
1151
|
+
recommended for Discovery and specs. DevFlow already provides the
|
|
1152
|
+
stack, the code evidence and the security baseline, and validates the
|
|
1153
|
+
result.
|
|
1154
|
+
- **most capable** (for example Opus, GPT-5, Gemini Pro): best for
|
|
1155
|
+
implementation.
|
|
1156
|
+
- **small** (for example Haiku, nano, Flash Lite): not recommended; they
|
|
1157
|
+
ask poor questions and miss decisions.
|
|
1158
|
+
|
|
1159
|
+
The classification comes from the model name; unknown names are shown
|
|
1160
|
+
without a label. Use `--model` on `devflow spec` to pick a model for one
|
|
1161
|
+
run.
|
|
1162
|
+
|
|
1105
1163
|
### Check status
|
|
1106
1164
|
|
|
1107
1165
|
```bash
|
|
@@ -1185,7 +1243,7 @@ devflow approve 001
|
|
|
1185
1243
|
```
|
|
1186
1244
|
|
|
1187
1245
|
Approval is explicit and binds the decision to the current artifact
|
|
1188
|
-
digests. For a `0.4.
|
|
1246
|
+
digests. For a `0.4.6` change it binds `spec.md`, `discovery.yaml` and,
|
|
1189
1247
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
1190
1248
|
same approval is a no-op. If an artifact changes after validation,
|
|
1191
1249
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -1205,7 +1263,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
1205
1263
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
1206
1264
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
1207
1265
|
|
|
1208
|
-
Only the `spec` stage is available in `0.4.
|
|
1266
|
+
Only the `spec` stage is available in `0.4.6`, so `--stage` is optional
|
|
1209
1267
|
and defaults to `spec`. `--stage plan` and `--stage review` are
|
|
1210
1268
|
rejected. There are no `plan`, `implement` or
|
|
1211
1269
|
`review` commands in this release.
|
|
@@ -1233,16 +1291,22 @@ The generated `AGENTS.md` (or `CLAUDE.md`) tells the agent to:
|
|
|
1233
1291
|
this step. Discovery and specification prompts skip it to save tokens;
|
|
1234
1292
|
the specification still lists it in section 9.
|
|
1235
1293
|
|
|
1236
|
-
### Reopen
|
|
1294
|
+
### Reopen a specification to change or extend it
|
|
1237
1295
|
|
|
1238
1296
|
An approved specification is a contract. To change it, reopen it first;
|
|
1239
1297
|
editing `spec.md` directly only marks it `stale`.
|
|
1240
1298
|
|
|
1241
1299
|
```bash
|
|
1242
|
-
devflow reopen 001
|
|
1243
|
-
devflow reopen 001 --
|
|
1300
|
+
devflow reopen 001 # fix the spec text yourself
|
|
1301
|
+
devflow reopen 001 --add "password reset" # the agent extends the spec
|
|
1302
|
+
devflow reopen 001 --discovery # the agent asks what to change
|
|
1244
1303
|
```
|
|
1245
1304
|
|
|
1305
|
+
`--add` records what you want to add at the end of the Discovery request
|
|
1306
|
+
(`Additional scope (date): ...`) and implies `--discovery`. The agent
|
|
1307
|
+
starts from that text, asks only about the new decisions and keeps the
|
|
1308
|
+
decisions already answered unless the new scope contradicts them.
|
|
1309
|
+
|
|
1246
1310
|
`reopen` asks for confirmation (skip it with `--yes`), copies the
|
|
1247
1311
|
current `spec.md` into `history/`, records a `spec_reopened` event and
|
|
1248
1312
|
withdraws the approval. The previous approval stays in `events.jsonl`;
|
|
@@ -1265,8 +1329,13 @@ devflow spec --continue 001 # writes the new spec
|
|
|
1265
1329
|
devflow approve 001
|
|
1266
1330
|
```
|
|
1267
1331
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1332
|
+
`--discovery` and `--add` also work on a change that is not approved
|
|
1333
|
+
yet: they reopen Discovery without any approval to withdraw. A plain
|
|
1334
|
+
`devflow reopen 001` on a change that is not approved explains that it
|
|
1335
|
+
is already open and how to extend it. When `spec --continue` finds the
|
|
1336
|
+
spec unchanged, it shows the same hint. Extending a spec through
|
|
1337
|
+
Discovery needs an interactive harness, because the agent asks you the
|
|
1338
|
+
new questions.
|
|
1270
1339
|
|
|
1271
1340
|
## Generated files
|
|
1272
1341
|
|
|
@@ -1276,6 +1345,8 @@ my-project/
|
|
|
1276
1345
|
│ ├── config.yaml
|
|
1277
1346
|
│ ├── architecture.yaml # declared architecture (Greenfield)
|
|
1278
1347
|
│ ├── .specs.lock # serializes specification id assignment
|
|
1348
|
+
│ ├── .local/ # machine-local, ignored by git
|
|
1349
|
+
│ │ └── sessions.json # harness session of each change
|
|
1279
1350
|
│ ├── constitution/
|
|
1280
1351
|
│ │ ├── constitution.md
|
|
1281
1352
|
│ │ ├── code-standards.md
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
|
+
import uuid
|
|
6
7
|
import shlex
|
|
7
8
|
import sys
|
|
8
9
|
|
|
@@ -66,6 +67,10 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
66
67
|
"manual" if context.mode == "interactive" else "dontAsk"
|
|
67
68
|
)
|
|
68
69
|
model = ("--model", context.model) if context.model else ()
|
|
70
|
+
session: tuple[str, ...] = ()
|
|
71
|
+
if context.session_id:
|
|
72
|
+
flag = "--resume" if context.resume_session else "--session-id"
|
|
73
|
+
session = (flag, context.session_id)
|
|
69
74
|
# Load only the user's own settings and no MCP servers: hooks,
|
|
70
75
|
# permissions and MCP servers committed in the project's .claude/ or
|
|
71
76
|
# .mcp.json must not run with DevFlow's agent session.
|
|
@@ -75,6 +80,7 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
75
80
|
argv = (
|
|
76
81
|
self.executable,
|
|
77
82
|
*model,
|
|
83
|
+
*session,
|
|
78
84
|
*isolation,
|
|
79
85
|
"--permission-mode",
|
|
80
86
|
permission_mode,
|
|
@@ -91,6 +97,7 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
91
97
|
self.executable,
|
|
92
98
|
"-p",
|
|
93
99
|
*model,
|
|
100
|
+
*session,
|
|
94
101
|
*isolation,
|
|
95
102
|
"--output-format",
|
|
96
103
|
"text",
|
|
@@ -104,6 +111,10 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
104
111
|
)
|
|
105
112
|
return Invocation(argv=argv, cwd=root, interactive=False)
|
|
106
113
|
|
|
114
|
+
def new_session_id(self) -> str:
|
|
115
|
+
"""Claude Code accepts a UUID chosen by the caller (--session-id)."""
|
|
116
|
+
return str(uuid.uuid4())
|
|
117
|
+
|
|
107
118
|
def permission_warnings(
|
|
108
119
|
self,
|
|
109
120
|
context: RunContext,
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
import secrets
|
|
7
|
+
import string
|
|
6
8
|
import subprocess
|
|
7
9
|
import tempfile
|
|
8
10
|
|
|
@@ -126,11 +128,14 @@ class OpenCodeAdapter(HarnessAdapter):
|
|
|
126
128
|
def build_run(self, context: RunContext) -> Invocation:
|
|
127
129
|
root = context.root
|
|
128
130
|
model = ("--model", context.model) if context.model else ()
|
|
131
|
+
# `--session` continues the session, or creates it with this id.
|
|
132
|
+
session = ("--session", context.session_id) if context.session_id else ()
|
|
129
133
|
if context.mode == "interactive":
|
|
130
134
|
argv = (
|
|
131
135
|
self.executable,
|
|
132
136
|
"mini",
|
|
133
137
|
*model,
|
|
138
|
+
*session,
|
|
134
139
|
"--agent",
|
|
135
140
|
INTERACTIVE_AGENT,
|
|
136
141
|
"--prompt",
|
|
@@ -147,12 +152,22 @@ class OpenCodeAdapter(HarnessAdapter):
|
|
|
147
152
|
self.executable,
|
|
148
153
|
"run",
|
|
149
154
|
*model,
|
|
155
|
+
*session,
|
|
150
156
|
"--agent",
|
|
151
157
|
agent,
|
|
152
158
|
context.prompt,
|
|
153
159
|
)
|
|
154
160
|
return Invocation(argv=argv, cwd=root, interactive=False)
|
|
155
161
|
|
|
162
|
+
def new_session_id(self) -> str:
|
|
163
|
+
"""Return an id in OpenCode's format: ``ses_`` + 12 hex + 14 base62."""
|
|
164
|
+
alphabet = string.ascii_letters + string.digits
|
|
165
|
+
return (
|
|
166
|
+
"ses_"
|
|
167
|
+
+ secrets.token_hex(6)
|
|
168
|
+
+ "".join(secrets.choice(alphabet) for _ in range(14))
|
|
169
|
+
)
|
|
170
|
+
|
|
156
171
|
def list_models(self) -> tuple[ModelOption, ...]:
|
|
157
172
|
"""Return models reported by ``opencode models``."""
|
|
158
173
|
if not self.is_available():
|
|
@@ -25,8 +25,17 @@ from devflow.core.constitution import (
|
|
|
25
25
|
ConstitutionError,
|
|
26
26
|
ConstitutionLoader,
|
|
27
27
|
)
|
|
28
|
+
from devflow.core.model_tiers import (
|
|
29
|
+
RECOMMENDATION_TEXT,
|
|
30
|
+
TIER_LARGE,
|
|
31
|
+
TIER_MEDIUM,
|
|
32
|
+
TIER_SMALL,
|
|
33
|
+
model_tier,
|
|
34
|
+
tier_label,
|
|
35
|
+
)
|
|
28
36
|
from devflow.core.ports import (
|
|
29
37
|
HarnessPort,
|
|
38
|
+
ModelOption,
|
|
30
39
|
SetupResult,
|
|
31
40
|
build_setup_context,
|
|
32
41
|
)
|
|
@@ -57,13 +66,12 @@ def prompt_for_model(adapter: HarnessPort) -> str | None:
|
|
|
57
66
|
)
|
|
58
67
|
return answer.strip() or None
|
|
59
68
|
|
|
69
|
+
models = _by_recommendation(models)
|
|
60
70
|
typer.echo(f"Models available for {adapter.display_name}:")
|
|
61
71
|
typer.echo(" 0. Use the harness default")
|
|
62
72
|
for index, model in enumerate(models, start=1):
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
label = f" — {model.label}"
|
|
66
|
-
typer.echo(f" {index}. {model.id}{label}")
|
|
73
|
+
typer.echo(f" {index}. {_model_line(model)}")
|
|
74
|
+
typer.echo(RECOMMENDATION_TEXT)
|
|
67
75
|
while True:
|
|
68
76
|
answer = typer.prompt("Model number or id", default="0")
|
|
69
77
|
value = answer.strip()
|
|
@@ -78,6 +86,22 @@ def prompt_for_model(adapter: HarnessPort) -> str | None:
|
|
|
78
86
|
typer.echo("Choose a listed number or type a model id.")
|
|
79
87
|
|
|
80
88
|
|
|
89
|
+
def _by_recommendation(models: tuple[ModelOption, ...]) -> list[ModelOption]:
|
|
90
|
+
"""Put the models recommended for specs first, keeping their order."""
|
|
91
|
+
order = {TIER_MEDIUM: 0, TIER_LARGE: 1, None: 2, TIER_SMALL: 3}
|
|
92
|
+
return sorted(models, key=lambda item: order[model_tier(item.id)])
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _model_line(model: ModelOption) -> str:
|
|
96
|
+
label = ""
|
|
97
|
+
if model.label and model.label != model.id:
|
|
98
|
+
label = f" — {model.label}"
|
|
99
|
+
recommendation = tier_label(model.id)
|
|
100
|
+
if recommendation:
|
|
101
|
+
label += f" [{recommendation}]"
|
|
102
|
+
return f"{model.id}{label}"
|
|
103
|
+
|
|
104
|
+
|
|
81
105
|
def validate_harness_name(value: str) -> str:
|
|
82
106
|
"""Validate and normalize a harness name from the CLI."""
|
|
83
107
|
canonical = canonical_harness_name(value)
|
|
@@ -278,9 +302,9 @@ def models(
|
|
|
278
302
|
"Use --model with a model id supported by the harness."
|
|
279
303
|
)
|
|
280
304
|
return
|
|
281
|
-
for option in options:
|
|
282
|
-
|
|
283
|
-
|
|
305
|
+
for option in _by_recommendation(options):
|
|
306
|
+
console.print(escape(f"- {_model_line(option)}"), soft_wrap=True)
|
|
307
|
+
console.print(RECOMMENDATION_TEXT)
|
|
284
308
|
|
|
285
309
|
|
|
286
310
|
@harness_app.command("use")
|