okstra 0.225.1 → 0.227.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 (99) hide show
  1. package/README.md +1 -0
  2. package/dist/cli-registry.mjs +6 -0
  3. package/dist/cli-registry.mjs.map +1 -1
  4. package/dist/commands/execute/render-bundle.mjs +5 -0
  5. package/dist/commands/execute/render-bundle.mjs.map +1 -1
  6. package/dist/commands/execute/wizard.mjs +12 -15
  7. package/dist/commands/execute/wizard.mjs.map +1 -1
  8. package/docs/cli.md +46 -6
  9. package/docs/project-structure-overview.md +3 -1
  10. package/package.json +1 -1
  11. package/runtime/BUILD.json +2 -2
  12. package/runtime/agents/operations/code-review.json +1 -1
  13. package/runtime/bin/lib/okstra/cli.sh +5 -1
  14. package/runtime/bin/lib/okstra/globals.sh +1 -0
  15. package/runtime/bin/lib/okstra/usage.sh +3 -0
  16. package/runtime/bin/okstra.sh +2 -0
  17. package/runtime/prompts/duties/technical-verification-worker.json +2 -1
  18. package/runtime/prompts/lead/convergence.md +4 -1
  19. package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
  20. package/runtime/prompts/lead/phase-routing.md +7 -3
  21. package/runtime/prompts/lead/team-contract.md +1 -1
  22. package/runtime/prompts/wizard/prompts.ko.json +59 -0
  23. package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +5 -0
  24. package/runtime/python/okstra_ctl/adapters/worker_defaults.py +63 -0
  25. package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +3 -0
  26. package/runtime/python/okstra_ctl/agent/prompt_cli/corrections.py +5 -0
  27. package/runtime/python/okstra_ctl/analysis_packet.py +108 -2
  28. package/runtime/python/okstra_ctl/approved_plan_stage_extract.py +206 -0
  29. package/runtime/python/okstra_ctl/brief_sources.py +200 -0
  30. package/runtime/python/okstra_ctl/business_flow/store.py +15 -2
  31. package/runtime/python/okstra_ctl/cmux.py +18 -3
  32. package/runtime/python/okstra_ctl/code_review_coverage.py +70 -18
  33. package/runtime/python/okstra_ctl/code_review_target.py +77 -53
  34. package/runtime/python/okstra_ctl/convergence_critic_prompt.py +4 -1
  35. package/runtime/python/okstra_ctl/correction_cli.py +6 -5
  36. package/runtime/python/okstra_ctl/correction_round.py +1 -1
  37. package/runtime/python/okstra_ctl/design_surfaces.py +19 -7
  38. package/runtime/python/okstra_ctl/domain/worker_defaults.py +106 -0
  39. package/runtime/python/okstra_ctl/execution_mutation_audit.py +20 -18
  40. package/runtime/python/okstra_ctl/file_size_cap.py +56 -6
  41. package/runtime/python/okstra_ctl/implementation_direction.py +10 -0
  42. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +41 -0
  43. package/runtime/python/okstra_ctl/manager_split.py +185 -27
  44. package/runtime/python/okstra_ctl/next_phase.py +3 -1
  45. package/runtime/python/okstra_ctl/phases/final_verification/prior_blockers.py +128 -0
  46. package/runtime/python/okstra_ctl/phases/final_verification/profile.md +8 -5
  47. package/runtime/python/okstra_ctl/phases/final_verification/report_assets/final-verification.template.html +1 -1
  48. package/runtime/python/okstra_ctl/phases/final_verification/validation.py +84 -0
  49. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-deliverable.md +2 -2
  50. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-executor.md +2 -2
  51. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-self-check.md +1 -1
  52. package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-verifier.md +2 -2
  53. package/runtime/python/okstra_ctl/phases/implementation_option_selection/authoring.py +13 -5
  54. package/runtime/python/okstra_ctl/phases/implementation_option_selection/boundary.json +1 -1
  55. package/runtime/python/okstra_ctl/phases/implementation_option_selection/entry.py +67 -0
  56. package/runtime/python/okstra_ctl/phases/implementation_option_selection/profile.md +4 -2
  57. package/runtime/python/okstra_ctl/phases/implementation_option_selection/report_assets/implementation-option-selection.template.html +2 -1
  58. package/runtime/python/okstra_ctl/phases/implementation_option_selection/validation.py +127 -18
  59. package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +22 -0
  60. package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +1 -1
  61. package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +2 -1
  62. package/runtime/python/okstra_ctl/phases/technical_verification/profile.md +2 -2
  63. package/runtime/python/okstra_ctl/ports/worker_defaults.py +25 -0
  64. package/runtime/python/okstra_ctl/registry/worker_defaults_store.py +8 -0
  65. package/runtime/python/okstra_ctl/report_assembly.py +23 -2
  66. package/runtime/python/okstra_ctl/report_views.py +2 -1
  67. package/runtime/python/okstra_ctl/run.py +61 -2
  68. package/runtime/python/okstra_ctl/run_context.py +13 -8
  69. package/runtime/python/okstra_ctl/stage_done.py +5 -4
  70. package/runtime/python/okstra_ctl/wizard/cli.py +16 -4
  71. package/runtime/python/okstra_ctl/wizard/confirmation.py +27 -0
  72. package/runtime/python/okstra_ctl/wizard/engine.py +25 -3
  73. package/runtime/python/okstra_ctl/wizard/ids.py +29 -0
  74. package/runtime/python/okstra_ctl/wizard/registry.py +21 -0
  75. package/runtime/python/okstra_ctl/wizard/render.py +6 -2
  76. package/runtime/python/okstra_ctl/wizard/roles.py +73 -23
  77. package/runtime/python/okstra_ctl/wizard/sources.py +33 -11
  78. package/runtime/python/okstra_ctl/wizard/state.py +59 -14
  79. package/runtime/python/okstra_ctl/wizard/steps_options.py +74 -9
  80. package/runtime/python/okstra_ctl/wizard/steps_roles.py +5 -3
  81. package/runtime/python/okstra_ctl/wizard/worker_settings.py +334 -0
  82. package/runtime/python/okstra_ctl/worker_defaults.py +135 -0
  83. package/runtime/python/okstra_ctl/worker_prompt_body.py +21 -1
  84. package/runtime/python/okstra_ctl/worker_prompt_headers.py +11 -4
  85. package/runtime/python/okstra_ctl/worker_prompt_policy.py +3 -0
  86. package/runtime/python/okstra_ctl/write_policy.py +33 -18
  87. package/runtime/schemas/final-report-v2.0.schema.json +74 -0
  88. package/runtime/schemas/final-report-v3.0.schema.json +99 -2
  89. package/runtime/skills/okstra-brief-gen/SKILL.md +26 -0
  90. package/runtime/skills/okstra-code-review/SKILL.md +25 -23
  91. package/runtime/skills/okstra-code-review/references/review-calibration.md +2 -2
  92. package/runtime/skills/okstra-manager/SKILL.md +15 -2
  93. package/runtime/skills/okstra-run/SKILL.md +21 -1
  94. package/runtime/templates/reports/brief.template.md +10 -1
  95. package/runtime/templates/reports/html/i18n/en.json +8 -0
  96. package/runtime/templates/reports/html/i18n/ko.json +8 -0
  97. package/runtime/templates/worker-prompt-preamble.md +1 -1
  98. package/runtime/validators/validate-brief.py +39 -1
  99. package/runtime/validators/validate-run.py +5 -0
@@ -51,6 +51,15 @@ Checks performed per brief file:
51
51
  template's `<...>` scaffolding — a paragraph wrapped in angle brackets,
52
52
  a `- <...>` bullet, or a `> augmented: <label>` line. Source Material is
53
53
  exempt because it holds the reporter's words verbatim.
54
+ 17. Every git-untracked document under the project root (`.md`, `.txt`, …)
55
+ that the brief names outside `## Source Material` has its own
56
+ `### Source N — file` entry there. The task worktree is a checkout and
57
+ lacks such a file; prepare copies only Source Material file entries into
58
+ the analysis packet. `okstra brief-sources attach` appends the missing
59
+ entries in place. The project root is the parent of a `--briefs-root`
60
+ of the form `<root>/.okstra/briefs`; for any other briefs root, or
61
+ outside a git checkout, the check is skipped. The codebase-scan variant
62
+ has no Source Material section and is not checked.
54
63
 
55
64
  Exit code 0 on PASS, 1 on FAIL.
56
65
  """
@@ -76,6 +85,7 @@ from okstra_ctl.phases.improvement_discovery.lenses import (
76
85
  MIN_PRIORITY_LENSES,
77
86
  )
78
87
  from okstra_ctl.group_context import GROUP_CONTEXT_TYPE, validate_group_context
88
+ from okstra_ctl.brief_sources import uncited_local_documents
79
89
  from okstra_ctl.ids import slugify_task_segment
80
90
 
81
91
  REQUIRED_FRONTMATTER_KEYS = {
@@ -747,7 +757,32 @@ def check_reporter_confirmations(
747
757
  )
748
758
 
749
759
 
750
- def validate_brief(path: Path, briefs_root: Path) -> list[str]:
760
+ def project_root_of(briefs_root: Path) -> Path | None:
761
+ """`<root>/.okstra/briefs` 이면 `<root>`, 아니면 None."""
762
+ resolved = briefs_root.resolve()
763
+ if resolved.name == "briefs" and resolved.parent.name == ".okstra":
764
+ return resolved.parent.parent
765
+ return None
766
+
767
+
768
+ def check_cited_local_documents(
769
+ text: str, scope: str, project_root: Path | None, errors: list[str]
770
+ ) -> None:
771
+ if project_root is None or scope == "codebase":
772
+ return
773
+ for relative in uncited_local_documents(text, project_root):
774
+ errors.append(
775
+ f"local document {relative!r} is cited in the brief but has no "
776
+ "`### Source N — file` entry in Source Material; it is untracked, "
777
+ "so the task worktree lacks it and no run will show it to workers. "
778
+ f"Run `okstra brief-sources attach --project-root {project_root} "
779
+ "--brief <this brief>` to append it by reference"
780
+ )
781
+
782
+
783
+ def validate_brief(
784
+ path: Path, briefs_root: Path, project_root: Path | None = None
785
+ ) -> list[str]:
751
786
  text = strip_html_comments(path.read_text(encoding="utf-8"))
752
787
  errors: list[str] = []
753
788
 
@@ -795,6 +830,9 @@ def validate_brief(path: Path, briefs_root: Path) -> list[str]:
795
830
  check_end_state_sections(text, scope, errors)
796
831
  check_variant_required_sections(text, scope, errors)
797
832
  check_template_scaffold(text, scope, errors)
833
+ check_cited_local_documents(
834
+ text, scope, project_root or project_root_of(briefs_root), errors
835
+ )
798
836
 
799
837
  # 2. brief-id matches filename stem
800
838
  stem = path.stem
@@ -242,6 +242,7 @@ from okstra_ctl.report_routing import technical_verification_routing_errors
242
242
  from okstra_ctl.phases.implementation_option_selection.validation import ( # noqa: E402
243
243
  validate_blocked_answer_channel,
244
244
  validate_implementation_option_selection,
245
+ validate_split_acceptance,
245
246
  )
246
247
  from okstra_ctl.phases.implementation_planning.validation import (
247
248
  _validate_requirement_provenance, _validate_stage_has_requirement,
@@ -3197,6 +3198,10 @@ def validate_final_report_data(
3197
3198
  f"implementation-option-selection: {error}"
3198
3199
  for error in validate_blocked_answer_channel(data)
3199
3200
  )
3201
+ failures.extend(
3202
+ f"implementation-option-selection: {error}"
3203
+ for error in validate_split_acceptance(data)
3204
+ )
3200
3205
  elif task_type == "implementation":
3201
3206
  _validate_stage_carry_sidecar_exists(data, report_path, failures)
3202
3207
  _validate_lead_fixes(data, failures)