okstra 0.235.0 → 0.237.0
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.
- package/dist/lib/host-registry-client.d.mts +9 -2
- package/dist/lib/host-registry-client.mjs +29 -3
- package/dist/lib/host-registry-client.mjs.map +1 -1
- package/dist/lib/runtime-payload.mjs +1 -0
- package/dist/lib/runtime-payload.mjs.map +1 -1
- package/docs/architecture/storage-model.md +1 -0
- package/docs/architecture.md +2 -2
- package/docs/cli.md +6 -0
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/bin/lib/okstra/usage.sh +8 -8
- package/runtime/bin/okstra-qwen-exec.sh +5 -0
- package/runtime/prompts/lead/convergence.md +4 -1
- package/runtime/prompts/lead/okstra-lead-contract.md +4 -4
- package/runtime/prompts/profiles/_clarification-recommendation.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +10 -1
- package/runtime/prompts/wizard/prompts.ko.json +16 -4
- package/runtime/python/okstra_ctl/adapters/providers/antigravity/adapter.py +10 -2
- package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +16 -1
- package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +20 -5
- package/runtime/python/okstra_ctl/adapters/providers/kimi/adapter.py +17 -9
- package/runtime/python/okstra_ctl/adapters/providers/qwen/adapter.py +88 -0
- package/runtime/python/okstra_ctl/adapters/providers/qwen/manifest.json +1 -0
- package/runtime/python/okstra_ctl/adapters/providers/qwen/settings.json +12 -0
- package/runtime/python/okstra_ctl/adapters/providers/zai/adapter.py +8 -2
- package/runtime/python/okstra_ctl/approval_decisions.py +22 -2
- package/runtime/python/okstra_ctl/business_flow/contracts.py +11 -0
- package/runtime/python/okstra_ctl/business_flow/engine.py +90 -32
- package/runtime/python/okstra_ctl/business_flow/hooks.py +4 -2
- package/runtime/python/okstra_ctl/business_flow/source.py +39 -7
- package/runtime/python/okstra_ctl/business_flow/store.py +94 -28
- package/runtime/python/okstra_ctl/convergence.py +95 -5
- package/runtime/python/okstra_ctl/convergence_critic_verify_prompt.py +11 -10
- package/runtime/python/okstra_ctl/convergence_engine.py +30 -15
- package/runtime/python/okstra_ctl/convergence_reverify_prompt.py +9 -2
- package/runtime/python/okstra_ctl/coverage_census.py +75 -12
- package/runtime/python/okstra_ctl/entrypoints/hosts.py +1 -1
- package/runtime/python/okstra_ctl/lead_progress.py +1 -1
- package/runtime/python/okstra_ctl/manager_cli.py +42 -5
- package/runtime/python/okstra_ctl/manager_launch.py +60 -1
- package/runtime/python/okstra_ctl/manager_store.py +45 -0
- package/runtime/python/okstra_ctl/model_discovery.py +1 -1
- package/runtime/python/okstra_ctl/models.py +2 -2
- package/runtime/python/okstra_ctl/phases/discussion/profile.md +2 -2
- package/runtime/python/okstra_ctl/phases/error_analysis/profile.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_option_selection/profile.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +2 -1
- package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +2 -2
- package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +3 -3
- package/runtime/python/okstra_ctl/phases/requirements_discovery/profile.md +5 -5
- package/runtime/python/okstra_ctl/plan_item_evidence.py +25 -1
- package/runtime/python/okstra_ctl/registry/provider_registry.py +1 -1
- package/runtime/python/okstra_ctl/render_final_report.py +1 -1
- package/runtime/python/okstra_ctl/run.py +1 -1
- package/runtime/python/okstra_ctl/run_context.py +18 -3
- package/runtime/python/okstra_ctl/schema_excerpt.py +14 -9
- package/runtime/python/okstra_ctl/verdict_blocks.py +7 -2
- package/runtime/python/okstra_ctl/wizard/cli.py +14 -2
- package/runtime/python/okstra_ctl/wizard/engine.py +28 -1
- package/runtime/python/okstra_ctl/wizard/ids.py +8 -0
- package/runtime/python/okstra_ctl/wizard/picker_navigation.py +64 -2
- package/runtime/python/okstra_ctl/wizard/roles.py +194 -45
- package/runtime/python/okstra_ctl/wizard/sources.py +10 -1
- package/runtime/python/okstra_ctl/wizard/state.py +71 -21
- package/runtime/python/okstra_ctl/wizard/statefile.py +8 -3
- package/runtime/python/okstra_ctl/wizard/steps_roles.py +6 -3
- package/runtime/python/okstra_ctl/wizard/worker_settings.py +129 -25
- package/runtime/python/okstra_ctl/worker_audit_ledger.py +50 -8
- package/runtime/python/okstra_ctl/worker_prompt_body.py +26 -2
- package/runtime/python/okstra_ctl/worker_prompt_headers.py +12 -9
- package/runtime/python/okstra_token_usage/claude.py +5 -1
- package/runtime/python/okstra_token_usage/collect.py +3 -3
- package/runtime/python/okstra_token_usage/pricing.py +1 -0
- package/runtime/skills/_fragments/wizard-relay-protocol.md +1 -1
- package/runtime/skills/okstra-discussion/SKILL.md +1 -1
- package/runtime/skills/okstra-manager/SKILL.md +8 -2
- package/runtime/skills/okstra-run/SKILL.md +2 -2
- package/runtime/skills/okstra-setup/SKILL.md +34 -5
- package/runtime/skills/okstra-setup/references/project-config.md +19 -0
- package/runtime/templates/worker-prompt-preamble.md +12 -2
|
@@ -8,6 +8,7 @@ from okstra_project import project_json_path
|
|
|
8
8
|
from okstra_ctl.assignment_environment import load_assignment_context
|
|
9
9
|
from okstra_ctl.assignment_resolver import AssignmentContext
|
|
10
10
|
from okstra_ctl.dispatch_state import detect_terminal_backend
|
|
11
|
+
from okstra_ctl.registry.provider_registry import provider_display_order
|
|
11
12
|
from okstra_ctl.domain.worker_defaults import (
|
|
12
13
|
WorkerDefaultError,
|
|
13
14
|
WorkerDefaultsConflict,
|
|
@@ -22,13 +23,21 @@ from okstra_ctl.worker_defaults import (
|
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
from .prompts import _msg
|
|
25
|
-
from .roles import
|
|
26
|
+
from .roles import (
|
|
27
|
+
_executable_role_models,
|
|
28
|
+
_host_session_context,
|
|
29
|
+
_provider_of,
|
|
30
|
+
free_input_providers,
|
|
31
|
+
resolve_typed_models,
|
|
32
|
+
)
|
|
26
33
|
from .state import Option, Prompt, WizardError, WizardState
|
|
27
34
|
|
|
28
35
|
_INHERIT = "__inherit__"
|
|
29
36
|
_DISABLE = "__disable__"
|
|
30
37
|
_SCREENS_AFTER_SCOPE_PICK = 2
|
|
31
38
|
_SCREENS_AFTER_MODEL_EDIT = 2
|
|
39
|
+
_SCREENS_FOR_ACTION_PICK = 1
|
|
40
|
+
_CHOOSE_MODELS = "__choose_models__"
|
|
32
41
|
_SCREENS_AFTER_ROLE_MENU = 1
|
|
33
42
|
_SCREENS_AFTER_REVIEW = 0
|
|
34
43
|
|
|
@@ -66,7 +75,9 @@ def remaining_settings_screens(state: WizardState) -> int:
|
|
|
66
75
|
if state.worker_settings_scope is None:
|
|
67
76
|
return _SCREENS_AFTER_SCOPE_PICK
|
|
68
77
|
if state.worker_settings_role:
|
|
69
|
-
|
|
78
|
+
if state.worker_settings_choosing:
|
|
79
|
+
return _SCREENS_AFTER_MODEL_EDIT
|
|
80
|
+
return _SCREENS_AFTER_MODEL_EDIT + _SCREENS_FOR_ACTION_PICK
|
|
70
81
|
return _SCREENS_AFTER_ROLE_MENU
|
|
71
82
|
|
|
72
83
|
|
|
@@ -155,12 +166,14 @@ def worker_settings_summary(state: WizardState) -> str:
|
|
|
155
166
|
return "\n".join(lines)
|
|
156
167
|
|
|
157
168
|
|
|
158
|
-
def
|
|
159
|
-
|
|
169
|
+
def _settings_candidates(
|
|
170
|
+
state: WizardState,
|
|
171
|
+
) -> tuple[StaticRoleRequirement, list[str], list[str], bool]:
|
|
172
|
+
"""(requirement, candidates in provider order, preferred models, disabled now)."""
|
|
160
173
|
role = state.worker_settings_role
|
|
161
174
|
requirement = common_worker_requirements(Path(state.workspace_root))[role]
|
|
162
175
|
context = _settings_context(state)
|
|
163
|
-
|
|
176
|
+
executable = _executable_role_models(
|
|
164
177
|
state, RoleProfile((requirement,)), requirement, context
|
|
165
178
|
)
|
|
166
179
|
scopes = _draft_scopes(state)
|
|
@@ -168,43 +181,102 @@ def _settings_model_prompt(state: WizardState) -> Prompt:
|
|
|
168
181
|
role, scopes.get("project", {}), scopes.get("global", {})
|
|
169
182
|
)
|
|
170
183
|
current = selected[0] if selected and isinstance(selected[0], list) else []
|
|
171
|
-
preferred = list(dict.fromkeys(model for model in current if model in
|
|
184
|
+
preferred = list(dict.fromkeys(model for model in current if model in executable))
|
|
172
185
|
if not preferred:
|
|
173
|
-
preferred = list(
|
|
174
|
-
|
|
175
|
-
multi = requirement.max_count > 1
|
|
176
|
-
if not multi:
|
|
186
|
+
preferred = list(executable[: requirement.recommended_count])
|
|
187
|
+
if requirement.max_count <= 1:
|
|
177
188
|
preferred = preferred[:1]
|
|
189
|
+
disabled = requirement.min_count == 0 and (
|
|
190
|
+
not executable or (selected is not None and selected[0] == [])
|
|
191
|
+
)
|
|
192
|
+
candidates = sorted(
|
|
193
|
+
executable, key=lambda model: provider_display_order(_provider_of(model))
|
|
194
|
+
)
|
|
195
|
+
return requirement, candidates, preferred, disabled
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _settings_action_prompt(state: WizardState) -> Prompt:
|
|
199
|
+
"""First screen of a role edit: choose models, or end it without models."""
|
|
200
|
+
requirement, candidates, _preferred, disabled = _settings_candidates(state)
|
|
201
|
+
inherit = not candidates and not disabled
|
|
178
202
|
options = [
|
|
179
|
-
Option(
|
|
203
|
+
Option(
|
|
204
|
+
_CHOOSE_MODELS, _text(state, "choose_models"),
|
|
205
|
+
recommended=bool(candidates) and not disabled,
|
|
206
|
+
),
|
|
207
|
+
*_settings_without_models(state, requirement, disabled=disabled, inherit=inherit),
|
|
180
208
|
]
|
|
181
|
-
|
|
182
|
-
|
|
209
|
+
options.sort(key=lambda option: not option.recommended)
|
|
210
|
+
return Prompt(
|
|
211
|
+
step="worker_settings_action",
|
|
212
|
+
kind="pick",
|
|
213
|
+
options=options,
|
|
214
|
+
label=_text(
|
|
215
|
+
state,
|
|
216
|
+
"action_label",
|
|
217
|
+
role=_text(state, f"role_{state.worker_settings_role}"),
|
|
218
|
+
minimum=str(requirement.min_count),
|
|
219
|
+
maximum=str(requirement.max_count),
|
|
220
|
+
),
|
|
183
221
|
)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _settings_without_models(
|
|
225
|
+
state: WizardState,
|
|
226
|
+
requirement: StaticRoleRequirement,
|
|
227
|
+
*,
|
|
228
|
+
disabled: bool,
|
|
229
|
+
inherit: bool,
|
|
230
|
+
) -> list[Option]:
|
|
231
|
+
"""Rows that end a role edit without models: disable, inherit or clear, cancel."""
|
|
232
|
+
rows = []
|
|
187
233
|
if requirement.min_count == 0:
|
|
188
|
-
|
|
189
|
-
inherited =
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
234
|
+
rows.append(Option(_DISABLE, _text(state, "disabled"), recommended=disabled))
|
|
235
|
+
inherited = "inherit" if state.worker_settings_scope == "project" else "clear"
|
|
236
|
+
rows.append(Option(_INHERIT, _text(state, inherited), recommended=inherit))
|
|
237
|
+
rows.append(Option("cancel", _text(state, "cancel")))
|
|
238
|
+
return rows
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _settings_model_prompt(state: WizardState) -> Prompt:
|
|
242
|
+
"""The role's models in provider order; the engine shows them as vendor tabs."""
|
|
243
|
+
text = partial(_text, state)
|
|
244
|
+
requirement, candidates, preferred, _disabled = _settings_candidates(state)
|
|
245
|
+
options = [Option(model, model, recommended=model in preferred) for model in candidates]
|
|
194
246
|
return Prompt(
|
|
195
247
|
step="worker_settings_models",
|
|
196
248
|
kind="pick",
|
|
197
|
-
multi=
|
|
249
|
+
multi=requirement.max_count > 1,
|
|
198
250
|
options=options,
|
|
199
251
|
label=text(
|
|
200
252
|
"models_label",
|
|
201
|
-
role=text(f"role_{
|
|
253
|
+
role=text(f"role_{state.worker_settings_role}"),
|
|
202
254
|
minimum=str(requirement.min_count),
|
|
203
255
|
maximum=str(requirement.max_count),
|
|
204
256
|
),
|
|
205
257
|
)
|
|
206
258
|
|
|
207
259
|
|
|
260
|
+
def _settings_model_input_prompt(state: WizardState) -> Prompt:
|
|
261
|
+
draft = state.worker_settings_draft
|
|
262
|
+
assert draft is not None
|
|
263
|
+
_requirement, candidates, _preferred, _disabled = _settings_candidates(state)
|
|
264
|
+
return Prompt(
|
|
265
|
+
step="worker_settings_model_input",
|
|
266
|
+
kind="text",
|
|
267
|
+
label=_text(
|
|
268
|
+
state,
|
|
269
|
+
"model_input_label",
|
|
270
|
+
role=_text(state, f"role_{state.worker_settings_role}"),
|
|
271
|
+
providers=", ".join(draft["providers"]),
|
|
272
|
+
chosen=", ".join(draft["models"]) or "-",
|
|
273
|
+
candidates=", ".join(
|
|
274
|
+
model for model in candidates if _provider_of(model) in draft["providers"]
|
|
275
|
+
),
|
|
276
|
+
),
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
|
|
208
280
|
def next_worker_settings_prompt(state: WizardState) -> Prompt:
|
|
209
281
|
if state.worker_settings_saved:
|
|
210
282
|
return Prompt(step="done", kind="done", label=worker_settings_summary(state))
|
|
@@ -235,6 +307,10 @@ def next_worker_settings_prompt(state: WizardState) -> Prompt:
|
|
|
235
307
|
],
|
|
236
308
|
)
|
|
237
309
|
if state.worker_settings_role:
|
|
310
|
+
if state.worker_settings_draft is not None:
|
|
311
|
+
return _settings_model_input_prompt(state)
|
|
312
|
+
if not state.worker_settings_choosing:
|
|
313
|
+
return _settings_action_prompt(state)
|
|
238
314
|
return _settings_model_prompt(state)
|
|
239
315
|
return Prompt(
|
|
240
316
|
step="worker_settings_roles",
|
|
@@ -265,6 +341,25 @@ def _stage_worker_models(state: WizardState, value: str) -> None:
|
|
|
265
341
|
_validate_staged_models(state, requirement, models, _settings_context(state))
|
|
266
342
|
state.worker_settings_updates[role] = models
|
|
267
343
|
state.worker_settings_role = ""
|
|
344
|
+
state.worker_settings_choosing = False
|
|
345
|
+
state.worker_settings_draft = None
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def _stage_picked_worker_models(state: WizardState, value: str) -> None:
|
|
349
|
+
picked = [part.strip() for part in value.split(",") if part.strip()]
|
|
350
|
+
chosen, typed_from = free_input_providers(picked)
|
|
351
|
+
if typed_from:
|
|
352
|
+
state.worker_settings_draft = {"models": chosen, "providers": typed_from}
|
|
353
|
+
return
|
|
354
|
+
_stage_worker_models(state, value)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def _stage_typed_worker_models(state: WizardState, value: str) -> None:
|
|
358
|
+
draft = state.worker_settings_draft
|
|
359
|
+
assert draft is not None
|
|
360
|
+
_requirement, candidates, _preferred, _disabled = _settings_candidates(state)
|
|
361
|
+
typed = resolve_typed_models(value, draft["providers"], candidates)
|
|
362
|
+
_stage_worker_models(state, ",".join(dict.fromkeys([*draft["models"], *typed])))
|
|
268
363
|
|
|
269
364
|
|
|
270
365
|
def _save_worker_settings(state: WizardState) -> None:
|
|
@@ -321,8 +416,17 @@ def submit_worker_settings(state: WizardState, prompt: Prompt, value: str) -> st
|
|
|
321
416
|
state.worker_settings_role = value
|
|
322
417
|
else:
|
|
323
418
|
raise WizardError(_text(state, "choose_role"))
|
|
419
|
+
elif prompt.step == "worker_settings_action":
|
|
420
|
+
if value == _CHOOSE_MODELS:
|
|
421
|
+
state.worker_settings_choosing = True
|
|
422
|
+
elif value in (_INHERIT, _DISABLE):
|
|
423
|
+
_stage_worker_models(state, value)
|
|
424
|
+
else:
|
|
425
|
+
raise WizardError(_text(state, "choose_action"))
|
|
324
426
|
elif prompt.step == "worker_settings_models":
|
|
325
|
-
|
|
427
|
+
_stage_picked_worker_models(state, value)
|
|
428
|
+
elif prompt.step == "worker_settings_model_input":
|
|
429
|
+
_stage_typed_worker_models(state, value)
|
|
326
430
|
elif prompt.step == "worker_settings_save":
|
|
327
431
|
if value == "save":
|
|
328
432
|
_save_worker_settings(state)
|
|
@@ -104,7 +104,54 @@ def _cited_file_paths(content: str) -> set[str]:
|
|
|
104
104
|
return paths
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
# A file that a citation, an evidence note or an Opened list names:
|
|
108
|
+
# `src/a_b.ts:4-9`, **src/a.ts**, [packet](.okstra/x/p.md:3), /abs/src/a.ts.
|
|
109
|
+
# A name counts only with a directory or a line, so prose such as `e.g.` or a
|
|
110
|
+
# version number is not a file. Bracketed and parenthesised segments are route
|
|
111
|
+
# directories (Next.js `[slug]`, `[[...slug]]`, `(group)`); without them the
|
|
112
|
+
# path was cut at the bracket and a file the worker opened read as unopened.
|
|
113
|
+
_PATH_CHAR = r"(?:[\w.@-]|\[{1,2}[\w.@-]+\]{1,2}|\([\w.@-]+\))"
|
|
114
|
+
_NAMED_FILE_RE = re.compile(
|
|
115
|
+
# A match never starts inside a run of path characters — after a segment's
|
|
116
|
+
# closing bracket or at the inner `[` of `[[` either — so a failed scan ends
|
|
117
|
+
# at the run's end once instead of restarting at every bracket.
|
|
118
|
+
rf"(?<![\w./@\])-])(?!(?<=\[)\[)(?P<path>{_PATH_CHAR}*(?:/{_PATH_CHAR}+)*\.[A-Za-z]\w*"
|
|
119
|
+
rf"|(?:{_PATH_CHAR}+/)+(?:Dockerfile|Justfile|Makefile|Procfile|Rakefile))"
|
|
120
|
+
r"(?P<line>:\d+(?:-\d+)?)?"
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def named_files(text: str) -> tuple[str, ...]:
|
|
125
|
+
"""The file paths *text* names, in order, without line suffixes."""
|
|
126
|
+
paths: dict[str, None] = {}
|
|
127
|
+
for match in _NAMED_FILE_RE.finditer(text):
|
|
128
|
+
path = match.group("path")
|
|
129
|
+
if match.group("line") or "/" in path:
|
|
130
|
+
paths.setdefault(path, None)
|
|
131
|
+
return tuple(paths)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def recorded_as_opened(path: str, ledger: frozenset[str] | set[str]) -> bool:
|
|
135
|
+
"""Whether a ledger row names *path*, project-relative or absolute on either side.
|
|
136
|
+
|
|
137
|
+
A bare filename matches only when exactly one row has that name.
|
|
138
|
+
"""
|
|
139
|
+
if path in ledger:
|
|
140
|
+
return True
|
|
141
|
+
if "/" not in path:
|
|
142
|
+
return len([row for row in ledger if row.rsplit("/", 1)[-1] == path]) == 1
|
|
143
|
+
return any(path.endswith("/" + row) or row.endswith("/" + path) for row in ledger)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def ledger_required(prompt_path: Path) -> bool:
|
|
147
|
+
"""Whether the prompt asked its worker for an Evidence read ledger."""
|
|
148
|
+
try:
|
|
149
|
+
return EVIDENCE_LEDGER_HEADER in prompt_path.read_text(encoding="utf-8").splitlines()
|
|
150
|
+
except OSError:
|
|
151
|
+
return False
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def audit_evidence_read_paths(content: str) -> set[str]:
|
|
108
155
|
return {
|
|
109
156
|
match.group("path")
|
|
110
157
|
for match in _EVIDENCE_READ_RE.finditer(content)
|
|
@@ -230,19 +277,14 @@ def _evidence_read_ledger_failures(
|
|
|
230
277
|
) -> list[str]:
|
|
231
278
|
if worker_role == "report-writer-worker":
|
|
232
279
|
return []
|
|
233
|
-
|
|
234
|
-
try:
|
|
235
|
-
prompt_content = prompt_path.read_text(encoding="utf-8")
|
|
236
|
-
except OSError:
|
|
237
|
-
return []
|
|
238
|
-
if EVIDENCE_LEDGER_HEADER not in prompt_content.splitlines():
|
|
280
|
+
if not ledger_required(_worker_prompt_path(run_dir, worker_role, task_type, seq)):
|
|
239
281
|
return []
|
|
240
282
|
try:
|
|
241
283
|
audit_content = audit_path.read_text(encoding="utf-8")
|
|
242
284
|
except OSError as exc:
|
|
243
285
|
return [f"worker audit sidecar unreadable: {audit_path.name} ({exc})"]
|
|
244
286
|
|
|
245
|
-
read_paths =
|
|
287
|
+
read_paths = audit_evidence_read_paths(audit_content)
|
|
246
288
|
missing_paths = sorted(_cited_file_paths(result_content) - read_paths)
|
|
247
289
|
return [
|
|
248
290
|
f"worker `{worker_role}` result `{result_name}` cites "
|
|
@@ -3,7 +3,25 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
from typing import Any, Mapping, Sequence
|
|
5
5
|
|
|
6
|
-
from .worker_prompt_policy import PromptPlan
|
|
6
|
+
from .worker_prompt_policy import ANALYSIS_DUTY_BY_TASK_TYPE, PromptPlan
|
|
7
|
+
|
|
8
|
+
# The duty contract ahead of this body is shared across task types and says what
|
|
9
|
+
# a result must be, not what to open in which order; a worker that follows only
|
|
10
|
+
# its wording reads the packet and writes. Requirements discovery is answered
|
|
11
|
+
# from code, so its analysers get the order of work in front of the inputs.
|
|
12
|
+
_INVESTIGATION_PROCEDURE: dict[str, tuple[str, ...]] = {
|
|
13
|
+
"requirements-discovery": (
|
|
14
|
+
"1. List every open question in the brief and every expected end-state "
|
|
15
|
+
"row (EB, PB, EO) the packet carries.",
|
|
16
|
+
"2. For each, open the code that answers it: the endpoint or handler, the "
|
|
17
|
+
"service, the repository or query, the model or type (installed dependency "
|
|
18
|
+
"packages included) and the existing tests or specs. Read the bodies, not "
|
|
19
|
+
"only the file names.",
|
|
20
|
+
"3. Record every file you open as an `Evidence read` row in the audit sidecar.",
|
|
21
|
+
"4. Judge every Coverage Census cell from what you opened.",
|
|
22
|
+
"5. Run the preamble's \"Before writing the result\" check, then write the result.",
|
|
23
|
+
),
|
|
24
|
+
}
|
|
7
25
|
|
|
8
26
|
|
|
9
27
|
def analysis_worker_label(worker_id: str) -> str:
|
|
@@ -28,6 +46,11 @@ def analysis_prompt_body(
|
|
|
28
46
|
) -> list[str]:
|
|
29
47
|
"""Render the provider-neutral body for an initial analysis audience."""
|
|
30
48
|
label = analysis_worker_label(worker_id)
|
|
49
|
+
task_type = _require_string(manifest, "taskType")
|
|
50
|
+
procedure = (
|
|
51
|
+
_INVESTIGATION_PROCEDURE.get(task_type, ())
|
|
52
|
+
if plan.duty_audience == ANALYSIS_DUTY_BY_TASK_TYPE.get(task_type) else ()
|
|
53
|
+
)
|
|
31
54
|
pane_role = {
|
|
32
55
|
"implementation-executor": "executor",
|
|
33
56
|
"implementation-verifier": "verifier",
|
|
@@ -40,8 +63,9 @@ def analysis_prompt_body(
|
|
|
40
63
|
"",
|
|
41
64
|
"## Task",
|
|
42
65
|
f"- Task key: `{_require_string(manifest, 'taskKey')}`",
|
|
43
|
-
f"- Task type: `{
|
|
66
|
+
f"- Task type: `{task_type}`",
|
|
44
67
|
"",
|
|
68
|
+
*(["## Investigation procedure", *procedure, ""] if procedure else []),
|
|
45
69
|
"## Inputs",
|
|
46
70
|
*analysis_input_lines(
|
|
47
71
|
manifest,
|
|
@@ -25,9 +25,9 @@ class WorkerPromptHeaderError(Exception):
|
|
|
25
25
|
"""Raised when worker prompt anchor headers cannot be rendered."""
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
# The Worker Preamble's "Reading rules" already
|
|
29
|
-
#
|
|
30
|
-
# into its run — by then a host SessionStart hook or a global CLAUDE.md /
|
|
28
|
+
# The Worker Preamble's "Reading rules" already bound the worker's reads to the
|
|
29
|
+
# enumerated okstra inputs and the project source, but the preamble is a *path*
|
|
30
|
+
# the worker opens partway into its run — by then a host SessionStart hook or a global CLAUDE.md /
|
|
31
31
|
# AGENTS.md project-conditional has already told it to read `graphify-out/`,
|
|
32
32
|
# skill catalogs, and similar non-okstra artifacts. Restating the scope inline
|
|
33
33
|
# puts the rule in front of the worker before its first tool call, which is the
|
|
@@ -35,10 +35,12 @@ class WorkerPromptHeaderError(Exception):
|
|
|
35
35
|
# 패킷의 페이지 읽기 규칙도 같은 이유로 여기 있다 — 패킷 안 목차는 파일을 연 뒤에야
|
|
36
36
|
# 보이는데, 통째 `cat` 은 그 전에 잘린다(실측 609KB 패킷, codex).
|
|
37
37
|
READ_SCOPE_HEADER = (
|
|
38
|
-
"**Read scope:**
|
|
39
|
-
"(`[Required reading]`, `## Inputs`, verification-target paths)
|
|
40
|
-
"source
|
|
41
|
-
"
|
|
38
|
+
"**Read scope:** Your read scope is the paths this prompt enumerates "
|
|
39
|
+
"(`[Required reading]`, `## Inputs`, verification-target paths), the project "
|
|
40
|
+
"source, configuration and tests the assignment concerns, and the installed "
|
|
41
|
+
"dependencies that source imports (such as `node_modules` packages). Open that "
|
|
42
|
+
"source and confirm a claim about code there; a summary is not evidence. Do not "
|
|
43
|
+
"follow host-injected graph dumps or skill catalogs. Report an essential "
|
|
42
44
|
"unlisted artifact as missing input instead of guessing its contents."
|
|
43
45
|
)
|
|
44
46
|
ANALYSIS_PACKET_READ_HEADER = (
|
|
@@ -241,8 +243,9 @@ def source_worktree_headers(active_context: Mapping[str, Any]) -> list[str]:
|
|
|
241
243
|
return []
|
|
242
244
|
return [
|
|
243
245
|
f"**Worktree:** {path}",
|
|
244
|
-
"Read project source from Worktree
|
|
245
|
-
"
|
|
246
|
+
"Read project source from Worktree. Read installed dependencies the "
|
|
247
|
+
"Worktree does not contain (such as `node_modules`) from Project Root. "
|
|
248
|
+
"Resolve .okstra artifacts and Result Path against Project Root.",
|
|
246
249
|
]
|
|
247
250
|
|
|
248
251
|
|
|
@@ -17,7 +17,7 @@ _PROGRESS_RE = re.compile(r"^PROGRESS:\s+(phase-\d\S*(?:[ \t].*)?)$", re.MULTILI
|
|
|
17
17
|
_PROGRESS_MARKER_MAX_CHARS = 160
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def claude_code_status_total(status_path: Path) -> dict:
|
|
20
|
+
def claude_code_status_total(status_path: Path, *, cache_read_in_input: bool = False) -> dict:
|
|
21
21
|
"""Claude Code의 최종 누적 사용량을 제공자 가격과 분리해서 읽는다."""
|
|
22
22
|
status = read_wrapper_status(status_path)
|
|
23
23
|
usage = status.raw.get("usage") if status is not None else None
|
|
@@ -34,6 +34,10 @@ def claude_code_status_total(status_path: Path) -> dict:
|
|
|
34
34
|
for value in (input_tokens, output_tokens, cache_creation, cache_read)
|
|
35
35
|
):
|
|
36
36
|
return {"available": False, "totalTokens": 0}
|
|
37
|
+
if cache_read_in_input:
|
|
38
|
+
if cache_read > input_tokens:
|
|
39
|
+
return {"available": False, "totalTokens": 0}
|
|
40
|
+
input_tokens -= cache_read
|
|
37
41
|
return {
|
|
38
42
|
"available": True,
|
|
39
43
|
"totalTokens": input_tokens + output_tokens + cache_creation,
|
|
@@ -655,8 +655,8 @@ def _cli_session_totals(
|
|
|
655
655
|
)
|
|
656
656
|
elif provider == "grok":
|
|
657
657
|
total = grok_session_total(session_path)
|
|
658
|
-
elif provider in {"zai", "claude"}:
|
|
659
|
-
total = claude_code_status_total(session_path)
|
|
658
|
+
elif provider in {"zai", "claude", "qwen"}:
|
|
659
|
+
total = claude_code_status_total(session_path, cache_read_in_input=provider == "qwen")
|
|
660
660
|
else:
|
|
661
661
|
continue
|
|
662
662
|
if total.get("available"):
|
|
@@ -921,7 +921,7 @@ def _worker_cli_usage_block(
|
|
|
921
921
|
provider, project_root, worker, records, windows, status_paths,
|
|
922
922
|
)
|
|
923
923
|
status_path = status_paths[-1] if status_paths else None
|
|
924
|
-
if provider
|
|
924
|
+
if provider in {"zai", "qwen"}:
|
|
925
925
|
session_paths = list(dict.fromkeys(
|
|
926
926
|
path for path in status_paths if path is not None and path.is_file()
|
|
927
927
|
))
|
|
@@ -31,6 +31,7 @@ from okstra_ctl.models import catalog_pricing
|
|
|
31
31
|
# entries below carry the 5m tier; the 1h price is derived as base_input * 2x
|
|
32
32
|
# at call time so the table stays compact.
|
|
33
33
|
CLAUDE_PRICING = {
|
|
34
|
+
"fable-5-2": (8.0, 10.0, 0.20, 40.0),
|
|
34
35
|
# model substring -> (input, cache_creation_5m, cache_read, output) USD/1M.
|
|
35
36
|
#
|
|
36
37
|
# _match_pricing picks the longest matching key (most specific), so ordering
|
|
@@ -37,4 +37,4 @@ The final `confirm` step is a normal `pick` step with three options — `Proceed
|
|
|
37
37
|
|
|
38
38
|
Never invent additional questions. Relay every `pick` / `pick_group` option the wizard sends, in order, including the flagged recommendation: the wizard's arrays are the complete choice set whatever the host UI's usual option limit, and the run-prompt recommendation rule (1–2 recommendations + Enter directly) applies only to prompts this skill authors itself. It does not excuse you from recommending: before relaying a wizard step whose answer turns on something readable (the carried report, the sidecar the user already wrote, the prior Stage Map), read it, put what you found in the question body, and name which of the wizard's own options you recommend and why. Relaying a step with no context and no recommendation hands the whole question back to the user — see the lifecycle core contract "Asking the user (BLOCKING)".
|
|
39
39
|
|
|
40
|
-
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model
|
|
40
|
+
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model:*`, `worker_settings_models`), which keep provider display order, so the flagged model may sit anywhere in the list. Append ` (추천)` to that option's label when you render it, and to no other. A checkbox step (`multi: true`) may flag several leading options: they are the recommended set, rendered the same way. Your prose recommendation names one of the flagged options. If you believe a different option is right, do not quietly recommend it in prose while the flagged one still reads as recommended on screen: say you disagree, name both, and let the user pick. When no option carries the flag, the run computed nothing for this step — recommend one from what you read and mark that one, and do not present the first option as a default just because it is first. **Enforced:** `scripts/okstra_ctl/wizard/state.py` `Prompt.__post_init__` refuses a step whose free-input option is not last, whose single-select recommendation is not exactly one option, whose recommendation is not placed first on a single-select step or is not the leading run on a checkbox step (both position checks are skipped on `role-models:*` / `role-model:*` / `worker_settings_models` steps), or that marks the free-input / abort escape as a recommendation.
|
|
@@ -64,7 +64,7 @@ The final `confirm` step is a normal `pick` step with three options — `Proceed
|
|
|
64
64
|
|
|
65
65
|
Never invent additional questions. Relay every `pick` / `pick_group` option the wizard sends, in order, including the flagged recommendation: the wizard's arrays are the complete choice set whatever the host UI's usual option limit, and the run-prompt recommendation rule (1–2 recommendations + Enter directly) applies only to prompts this skill authors itself. It does not excuse you from recommending: before relaying a wizard step whose answer turns on something readable (the carried report, the sidecar the user already wrote, the prior Stage Map), read it, put what you found in the question body, and name which of the wizard's own options you recommend and why. Relaying a step with no context and no recommendation hands the whole question back to the user — see the lifecycle core contract "Asking the user (BLOCKING)".
|
|
66
66
|
|
|
67
|
-
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model
|
|
67
|
+
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model:*`, `worker_settings_models`), which keep provider display order, so the flagged model may sit anywhere in the list. Append ` (추천)` to that option's label when you render it, and to no other. A checkbox step (`multi: true`) may flag several leading options: they are the recommended set, rendered the same way. Your prose recommendation names one of the flagged options. If you believe a different option is right, do not quietly recommend it in prose while the flagged one still reads as recommended on screen: say you disagree, name both, and let the user pick. When no option carries the flag, the run computed nothing for this step — recommend one from what you read and mark that one, and do not present the first option as a default just because it is first. **Enforced:** `scripts/okstra_ctl/wizard/state.py` `Prompt.__post_init__` refuses a step whose free-input option is not last, whose single-select recommendation is not exactly one option, whose recommendation is not placed first on a single-select step or is not the leading run on a checkbox step (both position checks are skipped on `role-models:*` / `role-model:*` / `worker_settings_models` steps), or that marks the free-input / abort escape as a recommendation.
|
|
68
68
|
<!-- END FRAGMENT: wizard-relay-protocol -->
|
|
69
69
|
|
|
70
70
|
<!-- BEGIN FRAGMENT: wizard-preflight -->
|
|
@@ -33,7 +33,8 @@ okstra manager task status --manager-id <manager-id> --task-group <task-group> -
|
|
|
33
33
|
okstra manager task sync --manager-id <manager-id> --task-group <task-group> --task-id <task-id>
|
|
34
34
|
okstra manager task assign --manager-id <manager-id> --task-group <task-group> --task-id <task-id> --project-id <project-id> [--child-task-id <child-task-id>] [--role <role>] [--tag <tag>] [--assignment <text>]
|
|
35
35
|
okstra manager task note --manager-id <manager-id> --task-group <task-group> --task-id <task-id> --scope <shared|project> [--project-id <project-id>] --body <text>
|
|
36
|
-
okstra manager task run --manager-id <manager-id> --project-id <project-id> --task-group <task-group> --task-id <task-id> [--child-task-id <child-task-id>] [--allow-completed]
|
|
36
|
+
okstra manager task run --manager-id <manager-id> --project-id <project-id> --task-group <task-group> --task-id <task-id> [--child-task-id <child-task-id>] [--allow-completed] [--base-ref <ref>] [--manager-session <address>]
|
|
37
|
+
okstra manager task register-session --manager-id <manager-id> --task-group <task-group> --task-id <task-id> --project-id <project-id> [--child-task-id <child-task-id>] --session <address> [--session-name <name>]
|
|
37
38
|
okstra manager task split --manager-id <manager-id> --task-group <task-group> --task-id <task-id> --plan <split-plan.json> [--overwrite]
|
|
38
39
|
okstra manager list managers
|
|
39
40
|
okstra manager list projects --manager-id <manager-id>
|
|
@@ -154,7 +155,12 @@ For launching child work:
|
|
|
154
155
|
|
|
155
156
|
1. Run `okstra manager task sync ...` if the manager snapshot must be refreshed first.
|
|
156
157
|
2. Run `okstra manager task run ...`. It re-reads the child's state from its project, not from the snapshot. When the child is already done there (terminal next phase, or work status `done`), it refuses with the last phase and report path; tell the user that and do not add `--allow-completed` unless the user asks to run the child again.
|
|
157
|
-
|
|
158
|
+
- A child task's first phase branches from a base ref. Pass the one the user chose as `--base-ref <ref>`; the child keeps it for later launches. Without the option, `task run` uses the child's recorded ref, or the ref every sibling of the same project recorded, and `Base ref source` says which (`argument`, `child`, `sibling`). When it is `none` and the child task does not exist in its project yet, ask the user for the base ref and run `task run` again with `--base-ref`; do not pick a branch yourself.
|
|
159
|
+
- When this session can receive messages from other sessions, pass its own address as `--manager-session <address>`. The child context then tells the child lead to message that address with its child task key and its own session address when the run starts, to report again when each phase ends, and to wait for the manager before the next phase. Approval gates stay with the child session's user; the manager recommends, it does not answer them. Use the address the host keeps across restarts, not a display name.
|
|
160
|
+
- A recorded or sibling ref is also passed for a child that already exists. A child whose worktree is registered and checked out ignores it; one whose worktree was released starts its next worktree from it, and one whose registry row is stale with its branch gone is rebuilt from it instead of the recorded commit.
|
|
161
|
+
3. Read the returned fixed fields `Backend`, `Worker dispatch backend`, `Project root`, `Context path`, `Run command`, every numbered `Run arg N`, `Shell command`, `Base ref`, `Base ref source`, and `Manager session`.
|
|
158
162
|
4. Give the user the `Shell command` line verbatim and tell them to run it in a new terminal. It starts the installed launcher in the child project: the launcher fills the task type and brief from the child task manifest or asks for them, prepares the run with the manager context directive, and starts the child lead as a separate host process (`Backend` `spawn-process`).
|
|
159
163
|
|
|
164
|
+
5. When a child lead's first message names its child task key and its session address, record that address with `okstra manager task register-session ... --session <address> [--session-name <name>]`. `task status` then shows each child's `session address` and `session name`; send later directives to that address. Registering the same address and name again records nothing; a new name on the same address replaces the old one, and leaving out `--session-name` keeps the recorded name.
|
|
165
|
+
|
|
160
166
|
Do not run the `Shell command` through this session's Bash tool: it opens an interactive host session. Do not rebuild it from `Run arg N` or swap in `okstra run`, which drops the task inputs and the directive for a lead host.
|
|
@@ -108,7 +108,7 @@ The final `confirm` step is a normal `pick` step with three options — `Proceed
|
|
|
108
108
|
|
|
109
109
|
Never invent additional questions. Relay every `pick` / `pick_group` option the wizard sends, in order, including the flagged recommendation: the wizard's arrays are the complete choice set whatever the host UI's usual option limit, and the run-prompt recommendation rule (1–2 recommendations + Enter directly) applies only to prompts this skill authors itself. It does not excuse you from recommending: before relaying a wizard step whose answer turns on something readable (the carried report, the sidecar the user already wrote, the prior Stage Map), read it, put what you found in the question body, and name which of the wizard's own options you recommend and why. Relaying a step with no context and no recommendation hands the whole question back to the user — see the lifecycle core contract "Asking the user (BLOCKING)".
|
|
110
110
|
|
|
111
|
-
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model
|
|
111
|
+
**One recommendation, shown in one place, and it is option 1.** Wizard labels carry no recommendation marker of their own. The option carrying `recommended: true` is what this run computed, and the wizard already placed it first — except on model-selection steps (`role-models:*`, `role-model:*`, `worker_settings_models`), which keep provider display order, so the flagged model may sit anywhere in the list. Append ` (추천)` to that option's label when you render it, and to no other. A checkbox step (`multi: true`) may flag several leading options: they are the recommended set, rendered the same way. Your prose recommendation names one of the flagged options. If you believe a different option is right, do not quietly recommend it in prose while the flagged one still reads as recommended on screen: say you disagree, name both, and let the user pick. When no option carries the flag, the run computed nothing for this step — recommend one from what you read and mark that one, and do not present the first option as a default just because it is first. **Enforced:** `scripts/okstra_ctl/wizard/state.py` `Prompt.__post_init__` refuses a step whose free-input option is not last, whose single-select recommendation is not exactly one option, whose recommendation is not placed first on a single-select step or is not the leading run on a checkbox step (both position checks are skipped on `role-models:*` / `role-model:*` / `worker_settings_models` steps), or that marks the free-input / abort escape as a recommendation.
|
|
112
112
|
<!-- END FRAGMENT: wizard-relay-protocol -->
|
|
113
113
|
|
|
114
114
|
<!-- BEGIN FRAGMENT: wizard-preflight -->
|
|
@@ -259,7 +259,7 @@ That is the entire interactive flow. The wizard handles:
|
|
|
259
259
|
- base-ref pick + git rev-parse validation (skipped when reusing an active worktree),
|
|
260
260
|
- `implementation`-only sub-flow: approved-plan path (frontmatter `approved: true` check) + stage pick (`auto` = the earliest incomplete stage whose dependencies are satisfied, or a specific stage number). Implementer slots use role-count / role-model like every other role (`executor` is only a compatibility alias for `implementer`). When an approved plan is selected and a `## PLAN DECISION` sidecar carrying `Status: approved`, exported from the report — matching the plan on source-report·seq — is detected in that run's sibling `user-responses/`, the approve-confirm step expands to 3 options (`yes_apply` recommended: approve + apply the option as exported / `yes` approve only / `no` abort) — `yes_apply` validates the option against the plan's `optionCandidates` before applying it via the existing approval·option path,
|
|
261
261
|
- `release-handoff`-only sub-flow: after the approved plan auto-resolves, a `handoff_stage_pick` multi-select — choose the eligible stages to open a PR for, one PR per stage; the result goes out as render-args' `stages` key (csv; empty takes every eligible stage),
|
|
262
|
-
- launch selection after identity/worktree steps: one screen per static role, in profile order. A role that can run several instances (`max > 1`) is a checkbox step `role-models:<role>` (`multi: true`) — the number of models checked is the number of instances, there is no separate count question; the label states the profile range and recommended count, every executable candidate is
|
|
262
|
+
- launch selection after identity/worktree steps: one screen per static role, in profile order. A role that can run several instances (`max > 1`) is a checkbox step `role-models:<role>` (`multi: true`) — the number of models checked is the number of instances, there is no separate count question; the label states the profile range and recommended count, every executable candidate is on that screen (defaults first, the recommended set flagged). When the host has a native question group, the runtime always shows a model screen as one `pick_group` of vendor tabs (interaction plan `native-group`; the question steps are `role-models:<role>#1`, `#2`, … and the answer is one JSON object keyed by them, each value a CSV): a vendor with at least as many models as a tab shows (claude-code: 3) gets its own tab, the others share one mixed tab, each tab lists up to that many models keeping the recommended ones and ends with a `직접 입력 (<vendors>)` row. Ticking that row makes the next step `role-model-input:<role>`, a text step that takes model ids of those vendors (`provider/model` or the model id, comma-separated); the wizard joins them to the ticked models. Without a question group the runtime returns the whole list (`numbered-multi` / `numbered-single`) — render every option, never a shortlist or pages. An optional role (`min = 0`, e.g. critic) carries a `추가 안 함` row on the full list; vendor tabs have no such row, and an answer with nothing ticked skips the role. A fixed single role (`min = max = 1`, e.g. report-writer) is a single pick `role-model:<role>:1`, and a role capped at one model (`max = 1`, e.g. critic) is a single pick on its `role-models:<role>` step; both are shown as the same vendor tabs — the tabs are checkbox questions, the answer is the same keyed JSON object, and the wizard rejects a screen whose tabs together name more than one value. current-session lead is this session and is listed on the confirmation summary, not as a wizard step. The wizard does not fork on defaults-vs-customize, does not show a provider roster multi-pick, and does not offer a separate implementer-provider pick. Worker settings edit a role in up to three steps: `worker_settings_action` (choose models, or inherit/clear, disable, cancel), `worker_settings_models` shown as the same vendor tabs, and `worker_settings_model_input` when a typed row was ticked. Dynamic verifiers are not chosen at launch. Repeated `--role-count` / `--role-model` tokens on `renderArgv` are intentional,
|
|
263
263
|
- reasoning effort (`reasoning_effort`) after the role screens and the directive, for every task type whose profile starts workers (not `release-handoff`): `high` (recommended) / `low` / `medium` / `xhigh`. The answer goes out as `--reasoning-effort`, is stored as the run manifest's `reasoningEffort`, and every claude, codex and grok worker CLI of the run starts with it; antigravity, kimi and zai keep their own configuration.
|
|
264
264
|
- **resume-clarification (in-session equivalent)** — there is no separate mode or flag matching the shell's `okstra.sh --resume-clarification`; two steps of the standard flow carry out its substance. (1) `reuse_previous` (yes/no to reuse the previous run's settings — in `requirements-discovery` / `error-analysis` / `implementation-planning` / `project-analysis` / `feature-analysis` / `change-impact-analysis`, only when prior run-inputs exist): YES prefills role-count·role-model·directive·related-tasks at once (and, for the analysis types, the target and evidence inputs). (2) `clarification_pick`: a `revision-requested` analysis report for the selected analysis type is recommended first; otherwise the **task-type's own** previous `final-report` is auto-recommended as the carry-in input (for `technical-verification`, the `implementation-option-selection` report), falling back to the newest by mtime across all phases when absent — except for `implementation-planning` and `technical-verification`, which get no cross-phase fallback. The approved plan is never recommended here. The same run's `user-responses/` sidecar (answers the user filled in) is attached alongside. The chosen path is passed to prepare as `--clarification-response` — the user makes the sidecar via the report's `Export user response`, places it in `runs/<task-type>/user-responses/`, and re-runs the same phase,
|
|
265
265
|
- **re-verification scope (`reverify_scope_pick`, `implementation-planning` clarification re-runs only)** — asked right before `confirm` when the re-run is narrowable **or** an answered `C-NNN` traces to no stage. When every answered id traces to a stage: 3 options — `auto` (recommended — leave it to the lead's `okstra incremental-scope` decision) / `full` (re-verify every stage) / Enter directly (a stage-number CSV, validated against the prior report's Stage Map). When an id is unlinked, `auto` is omitted and the user names stages or picks `full`; that unlinked id does not freeze the run at full. The answer goes out as `--reverify-scope` and reaches the lead prompt as the `REVERIFY_SCOPE_MODE` / `REVERIFY_SCOPE_STAGES` tokens; it shapes that CLI's inputs rather than replacing the decision. The confirmation block's `reverify-scope` line names unlinked ids as needing stage numbers, not as a forced full re-run,
|
|
@@ -182,6 +182,9 @@ matching section:
|
|
|
182
182
|
standards every run reads; hand-added, checked by `okstra doctor --phase <phase>`.
|
|
183
183
|
- **H. MCP servers** (`mcpServers`) — `okstra mcp add` declares a server,
|
|
184
184
|
`okstra mcp check` shows which provider CLIs reach it.
|
|
185
|
+
- **I. worker defaults** (`workerDefaults`) — saved worker models and counts per
|
|
186
|
+
role, global or per-project. Setup offers this in Step 5; the same flow runs
|
|
187
|
+
whenever the user asks to review or change them later.
|
|
185
188
|
|
|
186
189
|
## Step 4: Verify
|
|
187
190
|
|
|
@@ -189,16 +192,42 @@ matching section:
|
|
|
189
192
|
okstra doctor --runtime <host-runtime>
|
|
190
193
|
```
|
|
191
194
|
|
|
192
|
-
If all checks return `OK`,
|
|
193
|
-
the output and let the user decide whether to re-run install or skip.
|
|
195
|
+
If all checks return `OK`, continue to Step 5. If any check fails, surface
|
|
196
|
+
the output and let the user decide whether to re-run install or skip. A skipped
|
|
197
|
+
failure also skips Step 5, because saving defaults checks each model's
|
|
198
|
+
availability; the hand-off then reports worker defaults as skipped.
|
|
194
199
|
|
|
195
|
-
## Step 5:
|
|
200
|
+
## Step 5: Worker defaults
|
|
201
|
+
|
|
202
|
+
Saved worker defaults let `/okstra-run` fill each configured role's models and
|
|
203
|
+
count without showing its selection screen; roles left unconfigured are still
|
|
204
|
+
asked on every run. Ask once with `prompt_user`:
|
|
205
|
+
|
|
206
|
+
- **Question**: `"Save default worker models and counts now, so okstra-run skips those selection screens?"`
|
|
207
|
+
- **Options**: `Configure now` (recommended) — open the worker settings editor;
|
|
208
|
+
`Skip` — keep choosing on each run; the settings can be opened later with
|
|
209
|
+
"okstra-run worker settings".
|
|
210
|
+
|
|
211
|
+
On `Configure now`, run the worker settings mode of the installed `okstra-run`
|
|
212
|
+
skill with the project root from Step 2 and the project id from Step 3. That
|
|
213
|
+
mode owns the scope choice, role editor, review, save and cancel; it shows any
|
|
214
|
+
values already saved and keeps them unless the user edits them. Do not edit
|
|
215
|
+
`~/.okstra/config.json` or `project.json` by hand, and do not start a task from
|
|
216
|
+
it. When the mode reports that it finished or was cancelled, continue to Step 6
|
|
217
|
+
and carry its final `next.label` text.
|
|
218
|
+
|
|
219
|
+
## Step 6: Hand-off
|
|
196
220
|
|
|
197
221
|
Inform the user with a short summary:
|
|
198
222
|
|
|
199
223
|
> okstra is ready. Runtime: `~/.okstra` (version stamp). Project metadata:
|
|
200
|
-
> `<PROJECT_ROOT>/.okstra/project.json` (`projectId`).
|
|
201
|
-
> `/okstra-run` to start your first task.
|
|
224
|
+
> `<PROJECT_ROOT>/.okstra/project.json` (`projectId`). Worker defaults:
|
|
225
|
+
> `<outcome>`. Run `/okstra-run` to start your first task.
|
|
226
|
+
|
|
227
|
+
Fill `<outcome>` only from what Step 5 observed: the settings mode's final
|
|
228
|
+
`next.label` when it finished, `cancelled, nothing saved` when it was cancelled,
|
|
229
|
+
and `skipped` when the user chose `Skip` or Step 4 skipped Step 5. Do not claim
|
|
230
|
+
that values were saved, changed or absent beyond that text.
|
|
202
231
|
|
|
203
232
|
## Failure modes
|
|
204
233
|
|