okstra 0.137.0 → 0.138.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/docs/architecture.md +3 -2
- package/docs/contributor-change-matrix.md +1 -1
- package/docs/project-structure-overview.md +24 -2
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/antigravity-worker.md +1 -1
- package/runtime/agents/workers/codex-worker.md +1 -1
- package/runtime/prompts/lead/adapters/claude-code.md +1 -0
- package/runtime/prompts/lead/adapters/codex.md +1 -0
- package/runtime/prompts/lead/adapters/external.md +1 -0
- package/runtime/prompts/lead/report-writer.md +11 -10
- package/runtime/prompts/lead/team-contract.md +4 -2
- package/runtime/prompts/profiles/_implementation-diff-review.md +1 -1
- package/runtime/prompts/profiles/_implementation-executor.md +2 -2
- package/runtime/prompts/profiles/_implementation-self-check.md +1 -1
- package/runtime/python/okstra_ctl/codex_dispatch.py +158 -365
- package/runtime/python/okstra_ctl/dispatch_core.py +118 -138
- package/runtime/python/okstra_ctl/initial_prompt_materialization.py +1053 -0
- package/runtime/python/okstra_ctl/render.py +9 -4
- package/runtime/python/okstra_ctl/run.py +40 -89
- package/runtime/python/okstra_ctl/stage_targets.py +232 -46
- package/runtime/python/okstra_ctl/wizard.py +2 -2
- package/runtime/python/okstra_ctl/worker_prompt_contract.py +73 -0
- package/runtime/python/okstra_ctl/worktree.py +37 -29
- package/runtime/validators/lib/fixtures.sh +2 -0
|
@@ -194,31 +194,38 @@ def preview_worktree_decision(
|
|
|
194
194
|
)
|
|
195
195
|
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
@dataclass
|
|
198
|
+
class StageWorktreeDecision:
|
|
199
|
+
"""Side-effect-free decision for one concrete implementation stage."""
|
|
200
|
+
|
|
201
|
+
status: str
|
|
202
|
+
path: str
|
|
203
|
+
branch: str = ""
|
|
204
|
+
base_ref: str = ""
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def resolve_stage_worktree_decision(
|
|
198
208
|
*,
|
|
199
209
|
project_id: str,
|
|
200
210
|
task_group_segment: str,
|
|
201
211
|
task_id_segment: str,
|
|
202
212
|
work_category: str,
|
|
203
213
|
stage_number: int,
|
|
204
|
-
) ->
|
|
205
|
-
"""
|
|
206
|
-
|
|
207
|
-
Mirrors provision_stage_worktree's registry-reuse branch exactly. A "new"
|
|
208
|
-
decision carries no base_ref — the stage base commit is resolved later by
|
|
209
|
-
the prepare flow from the stage's dependency anchors.
|
|
210
|
-
"""
|
|
214
|
+
) -> StageWorktreeDecision:
|
|
215
|
+
"""Resolve whether one concrete stage worktree is new or reusable."""
|
|
211
216
|
safe_project = _safe_segment(project_id)
|
|
212
217
|
safe_group = _safe_segment(task_group_segment)
|
|
213
218
|
safe_task = _safe_segment(task_id_segment)
|
|
214
219
|
existing = worktree_registry.lookup(
|
|
215
220
|
safe_project, safe_group, safe_task, stage_number=stage_number)
|
|
216
221
|
if existing is not None and existing.status == "active":
|
|
217
|
-
return
|
|
218
|
-
status="reused",
|
|
219
|
-
|
|
222
|
+
return StageWorktreeDecision(
|
|
223
|
+
status="reused",
|
|
224
|
+
path=existing.worktree_path,
|
|
225
|
+
branch=existing.branch,
|
|
226
|
+
base_ref=existing.base_ref,
|
|
220
227
|
)
|
|
221
|
-
return
|
|
228
|
+
return StageWorktreeDecision(
|
|
222
229
|
status="new",
|
|
223
230
|
path=str(compute_worktree_path(
|
|
224
231
|
project_id=safe_project, task_group_segment=safe_group,
|
|
@@ -923,31 +930,32 @@ def provision_stage_worktree(
|
|
|
923
930
|
if not base_commit:
|
|
924
931
|
raise RuntimeError("provision_stage_worktree requires a base_commit")
|
|
925
932
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
task_id_segment=safe_task, stage_number=stage_number,
|
|
932
|
-
)
|
|
933
|
-
branch = compute_branch_name(
|
|
934
|
-
work_category=work_category, task_id_segment=safe_task,
|
|
933
|
+
decision = resolve_stage_worktree_decision(
|
|
934
|
+
project_id=project_id,
|
|
935
|
+
task_group_segment=task_group_segment,
|
|
936
|
+
task_id_segment=task_id_segment,
|
|
937
|
+
work_category=work_category,
|
|
935
938
|
stage_number=stage_number,
|
|
936
939
|
)
|
|
937
|
-
|
|
938
|
-
existing = worktree_registry.lookup(
|
|
939
|
-
safe_project, safe_group, safe_task, stage_number=stage_number)
|
|
940
|
-
if existing is not None and existing.status == "active":
|
|
940
|
+
if decision.status == "reused":
|
|
941
941
|
return WorktreeProvision(
|
|
942
|
-
status="reused",
|
|
943
|
-
|
|
942
|
+
status="reused",
|
|
943
|
+
path=decision.path,
|
|
944
|
+
branch=decision.branch,
|
|
945
|
+
base_ref=decision.base_ref,
|
|
944
946
|
note=(
|
|
945
947
|
f"stage {stage_number} worktree reused at "
|
|
946
|
-
f"{
|
|
947
|
-
f"(base {
|
|
948
|
+
f"{decision.path} on branch {decision.branch} "
|
|
949
|
+
f"(base {decision.base_ref[:12]})"
|
|
948
950
|
),
|
|
949
951
|
)
|
|
950
952
|
|
|
953
|
+
safe_project = _safe_segment(project_id)
|
|
954
|
+
safe_group = _safe_segment(task_group_segment)
|
|
955
|
+
safe_task = _safe_segment(task_id_segment)
|
|
956
|
+
worktree_path = Path(decision.path)
|
|
957
|
+
branch = decision.branch
|
|
958
|
+
|
|
951
959
|
if worktree_path.exists():
|
|
952
960
|
raise RuntimeError(
|
|
953
961
|
f"stage worktree path already exists but is not in the registry: "
|
|
@@ -137,6 +137,7 @@ prompt_path.write_text(
|
|
|
137
137
|
f"**Errors sidecar path:** {project_root}/run/worker-results/"
|
|
138
138
|
f"{target_worker_id}-errors.json",
|
|
139
139
|
f"Assigned worker prompt history path: {prompt_relative}",
|
|
140
|
+
"**Prompt Delivery Mode:** eager-include",
|
|
140
141
|
f"- Primary analysis packet: `{analysis_packet_path}`",
|
|
141
142
|
"",
|
|
142
143
|
"# Initial Analysis Prompt",
|
|
@@ -230,6 +231,7 @@ for worker in team_state.get("workers", []):
|
|
|
230
231
|
f"**Errors sidecar path:** {project_root}/run/worker-results/"
|
|
231
232
|
f"{worker_id}-errors.json",
|
|
232
233
|
f"Assigned worker prompt history path: {prompt_relative}",
|
|
234
|
+
"**Prompt Delivery Mode:** eager-include",
|
|
233
235
|
]
|
|
234
236
|
if worker_id != "report-writer":
|
|
235
237
|
prompt_lines.append(
|