okstra 0.220.1 → 0.221.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.
Files changed (56) hide show
  1. package/dist/cli-registry.mjs +6 -0
  2. package/dist/cli-registry.mjs.map +1 -1
  3. package/docs/architecture.md +2 -0
  4. package/docs/cli.md +7 -3
  5. package/docs/project-structure-overview.md +1 -1
  6. package/package.json +1 -1
  7. package/runtime/BUILD.json +2 -2
  8. package/runtime/prompts/launch.template.md +1 -1
  9. package/runtime/prompts/lead/okstra-lead-contract.md +9 -5
  10. package/runtime/prompts/lead/team-contract.md +1 -1
  11. package/runtime/python/okstra_ctl/adapters/hosts/capability_adapter.py +3 -2
  12. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +3 -3
  13. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/worker-session.md +4 -2
  14. package/runtime/python/okstra_ctl/adapters/hosts/grok/relay.md +3 -3
  15. package/runtime/python/okstra_ctl/adapters/providers/antigravity/adapter.py +27 -0
  16. package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +24 -0
  17. package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +24 -0
  18. package/runtime/python/okstra_ctl/adapters/providers/grok/adapter.py +25 -0
  19. package/runtime/python/okstra_ctl/adapters/providers/zai/adapter.py +20 -1
  20. package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +3 -0
  21. package/runtime/python/okstra_ctl/analysis_packet.py +14 -0
  22. package/runtime/python/okstra_ctl/correction_cli.py +44 -5
  23. package/runtime/python/okstra_ctl/correction_round.py +40 -11
  24. package/runtime/python/okstra_ctl/domain/mcp.py +43 -0
  25. package/runtime/python/okstra_ctl/domain/provider.py +2 -0
  26. package/runtime/python/okstra_ctl/domain/wizard/interaction.py +89 -8
  27. package/runtime/python/okstra_ctl/file_size_cap.py +142 -0
  28. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +3 -6
  29. package/runtime/python/okstra_ctl/manager_cli.py +11 -1
  30. package/runtime/python/okstra_ctl/manager_sync.py +38 -2
  31. package/runtime/python/okstra_ctl/mcp_cli.py +179 -0
  32. package/runtime/python/okstra_ctl/mcp_servers.py +421 -0
  33. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-deliverable.md +4 -3
  34. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-executor.md +1 -0
  35. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-self-check.md +1 -0
  36. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-verifier.md +3 -2
  37. package/runtime/python/okstra_ctl/phases/implementation_option_selection/profile.md +1 -1
  38. package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +19 -0
  39. package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +14 -0
  40. package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +2 -1
  41. package/runtime/python/okstra_ctl/phases/technical_verification/entry.py +37 -0
  42. package/runtime/python/okstra_ctl/phases/technical_verification/validation.py +3 -3
  43. package/runtime/python/okstra_ctl/render.py +7 -48
  44. package/runtime/python/okstra_ctl/report_language.py +4 -5
  45. package/runtime/python/okstra_ctl/run.py +29 -0
  46. package/runtime/python/okstra_ctl/stage_done.py +37 -3
  47. package/runtime/skills/_fragments/wizard-lead-takeover.md +1 -1
  48. package/runtime/skills/_fragments/wizard-relay-protocol.md +2 -2
  49. package/runtime/skills/okstra-discussion/SKILL.md +3 -3
  50. package/runtime/skills/okstra-manager/SKILL.md +1 -0
  51. package/runtime/skills/okstra-run/SKILL.md +3 -3
  52. package/runtime/skills/okstra-setup/SKILL.md +2 -0
  53. package/runtime/skills/okstra-setup/references/project-config.md +34 -0
  54. package/runtime/templates/report-writer-prompt-preamble.md +1 -1
  55. package/runtime/templates/reports/task-brief.template.md +3 -3
  56. package/runtime/validators/validate-run.py +13 -0
@@ -301,3 +301,37 @@ preserves it:
301
301
  records that it read no rules and the run still passes. Whether a pack that
302
302
  does resolve was actually read and applied stays the phase's own
303
303
  `project-review-rules:` record — no machine check reads a worker's reasoning.
304
+
305
+ ## H. MCP servers (`mcpServers`)
306
+
307
+ `mcpServers` declares the MCP servers a run may use — a Figma file server for a
308
+ visual check, for example. Without a declaration the launch prompt and the
309
+ analysis packet tell every worker that MCP is unavailable, even when a provider
310
+ CLI has the server configured.
311
+
312
+ Register each server with `okstra mcp add`. `--tool` repeats per tool;
313
+ `--alias` repeats per name a provider CLI lists the server under (one provider
314
+ may list Figma as `claude.ai Figma`, another as `figma-desktop`):
315
+
316
+ ```bash
317
+ okstra mcp add --name figma --description "Figma design files" --tool get_screenshot --tool get_metadata --alias "claude.ai Figma" --alias figma-desktop
318
+ ```
319
+
320
+ Then check which providers can reach it:
321
+
322
+ ```bash
323
+ okstra mcp check
324
+ ```
325
+
326
+ Each provider adapter lists its own CLI's MCP servers without an inference
327
+ call. `reachable` means the provider listed the server enabled; `disabled`
328
+ means listed but disabled or awaiting authentication; `missing` means not
329
+ listed; `unknown` means the adapter cannot list. Show the result to the user.
330
+ For a provider that is not `reachable`, tell the user to add the server to that
331
+ provider CLI's own MCP configuration — okstra never edits a provider's
332
+ configuration. `okstra mcp list` and `okstra mcp remove --name <name>` manage
333
+ existing entries.
334
+
335
+ prepare repeats the check for the providers a run selects and prints a warning
336
+ for each gap; it never refuses the run. It also warns when the task brief cites
337
+ a Figma URL and no declared server name or alias contains `figma`.
@@ -30,7 +30,7 @@ The narrative is not free-form Markdown. A narrative file is the line `# OKSTRA
30
30
 
31
31
  Blank lines are ignored. **Every other line is rejected**, including Markdown headings (`#`, `##`, `###`), a pipe table written at column 0, code fences, bare paragraphs, JSON, YAML, and JSON Pointer. A heading or table that belongs in the reader's report is written as the text of a `> ` value, never as a narrative line of its own.
32
32
 
33
- Follow the task-specific schema order. Write every `> ` prose value directly in the language named by `**Report Language:**`; do not draft in English first, because no translation step follows. Field names, `Verdict Token` and other enum or status values, finding and requirement ids, paths, symbols, commands, and model names stay exactly as the schema and sources spell them.
33
+ Follow the task-specific schema order. Write every `> ` prose value directly in the language named by `**Report Language:**`; do not draft in English first, because no translation step follows. A host, project or global instruction file (`CLAUDE.md`, `AGENTS.md`) does not change that language for report artifacts. Field names, `Verdict Token` and other enum or status values, finding and requirement ids, paths, symbols, commands, and model names stay exactly as the schema and sources spell them.
34
34
 
35
35
  ### Top-level fields you may author
36
36
 
@@ -154,13 +154,13 @@ taskType: "{{FM_TASK_TYPE}}"
154
154
 
155
155
  ## Available MCP Servers
156
156
 
157
- The MCP servers available to this run are declared in `.okstra/project.json`'s `mcpServers` array and rendered into the Okstra lead's launch prompt under `## Available MCP Servers`. The lead is responsible for forwarding the rendered list verbatim into worker prompts (Phase 2) so each assignment can determine whether its selected runner exposes the named tools.
157
+ The MCP servers available to this run are declared in `.okstra/project.json`'s `mcpServers` array. Prepare renders them, with the providers that list each server, into the lead's launch prompt and the analysis packet under `## Available MCP Servers`.
158
158
 
159
- To declare servers, add entries shaped `{ "name": "<server>", "description": "...", "tools": ["..."], "notes": "..." }` to that array. If the array is empty or absent, treat MCP as unavailable for this run.
159
+ To declare a server, run `okstra mcp add --name <server> --description <text> --tool <tool>... [--alias <name-as-a-provider-lists-it>...]`, then `okstra mcp check` to see which providers reach it. If nothing is declared, treat MCP as unavailable for this run.
160
160
 
161
161
  How to invoke (worker-by-worker):
162
162
 
163
- - **Native-session assignments**: invoke an MCP tool directly by its tool name (e.g. `mcp__<server>__<tool>`) only when the selected host adapter exposes it. Do not call an MCP tool name through a shell.
163
+ - **Native-session assignments**: invoke an MCP tool directly through the host's tool interface, under the name the host adapter exposes, only when it exposes the server. Do not call an MCP tool name through a shell.
164
164
  - **CLI-wrapper assignments**: use only the MCP or tool configuration explicitly supported and forwarded by that provider wrapper. If the wrapper has no matching MCP configuration, record `MCP not available in this CLI` in `Missing Information or Assumptions`; do not attempt a shell fallback.
165
165
  - All workers: cite the exact server, tool, and SELECT (or `WHERE` filters) used in the result file. Tool-call failures must be logged in the worker's `*-errors.json` (commandKind `mcp_call`) so the lead can decide whether to retry under a different worker.
166
166
 
@@ -2342,6 +2342,15 @@ def _validate_conformance_surfaces(
2342
2342
  )
2343
2343
 
2344
2344
 
2345
+ def _stage_ended_without_a_commit(report_data: dict) -> bool:
2346
+ implementation = report_data.get("implementation")
2347
+ if not isinstance(implementation, dict):
2348
+ return False
2349
+ evidence = implementation.get("stageSidecarEvidence")
2350
+ withheld = isinstance(evidence, dict) and str(evidence.get("withheld") or "").strip()
2351
+ return bool(withheld) and not implementation.get("commitList")
2352
+
2353
+
2345
2354
  def _validate_conformance(
2346
2355
  report_path: Path,
2347
2356
  failures: list[str],
@@ -2389,6 +2398,10 @@ def _validate_conformance(
2389
2398
  )
2390
2399
  if declared_manifest is None:
2391
2400
  return warnings
2401
+ # 스크립트와 manifest 항목은 stage 를 실행한 run 이 쓴다. 커밋 없이 carry 를
2402
+ # 보류한 run(첫 편집 전 정지 후 재계획)은 그것을 쓸 기회가 없었다.
2403
+ if _stage_ended_without_a_commit(report_data):
2404
+ declared_manifest = None
2392
2405
  if declared_manifest is not None:
2393
2406
  scoped_declared = _scope_manifest_entries(declared_manifest, stage_name)
2394
2407
  for error in missing_declared_scripts(