okstra 0.34.1 → 0.36.1

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 (108) hide show
  1. package/README.kr.md +27 -19
  2. package/README.md +27 -19
  3. package/docs/kr/architecture.md +59 -45
  4. package/docs/kr/cli.md +61 -18
  5. package/docs/pr-template-usage.md +65 -0
  6. package/docs/project-structure-overview.md +353 -354
  7. package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +1 -1
  8. package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +1 -1
  9. package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +1 -1
  10. package/docs/superpowers/plans/2026-05-20-final-report-language.md +1501 -0
  11. package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +1267 -0
  12. package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +1007 -0
  13. package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +720 -0
  14. package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +681 -0
  15. package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +1691 -0
  16. package/docs/superpowers/plans/2026-05-24-implementation-lead-context-slimming.md +1700 -0
  17. package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +383 -0
  18. package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +320 -0
  19. package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +299 -0
  20. package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +335 -0
  21. package/docs/task-process/README.md +74 -0
  22. package/docs/task-process/common-flow.md +166 -0
  23. package/docs/task-process/error-analysis.md +101 -0
  24. package/docs/task-process/final-verification.md +167 -0
  25. package/docs/task-process/implementation-planning.md +128 -0
  26. package/docs/task-process/implementation.md +149 -0
  27. package/docs/task-process/release-handoff.md +206 -0
  28. package/docs/task-process/requirements-discovery.md +115 -0
  29. package/package.json +1 -1
  30. package/runtime/BUILD.json +2 -2
  31. package/runtime/agents/SKILL.md +30 -7
  32. package/runtime/agents/workers/claude-worker.md +31 -6
  33. package/runtime/agents/workers/codex-worker.md +37 -10
  34. package/runtime/agents/workers/gemini-worker.md +34 -7
  35. package/runtime/agents/workers/report-writer-worker.md +19 -10
  36. package/runtime/bin/okstra-central.sh +6 -6
  37. package/runtime/bin/okstra-codex-exec.sh +49 -28
  38. package/runtime/bin/okstra-gemini-exec.sh +39 -21
  39. package/runtime/bin/okstra-render-final-report.py +13 -2
  40. package/runtime/bin/okstra-wrapper-status.py +155 -0
  41. package/runtime/bin/okstra.sh +2 -2
  42. package/runtime/prompts/launch.template.md +1 -0
  43. package/runtime/prompts/profiles/_common-contract.md +11 -6
  44. package/runtime/prompts/profiles/_implementation-deliverable.md +53 -0
  45. package/runtime/prompts/profiles/_implementation-executor.md +60 -0
  46. package/runtime/prompts/profiles/_implementation-verifier.md +76 -0
  47. package/runtime/prompts/profiles/error-analysis.md +3 -7
  48. package/runtime/prompts/profiles/implementation-planning.md +22 -21
  49. package/runtime/prompts/profiles/implementation.md +28 -118
  50. package/runtime/prompts/profiles/improvement-discovery.md +42 -0
  51. package/runtime/prompts/profiles/release-handoff.md +1 -1
  52. package/runtime/prompts/profiles/requirements-discovery.md +8 -12
  53. package/runtime/prompts/wizard/prompts.ko.json +230 -0
  54. package/runtime/python/lib/okstra/cli.sh +2 -49
  55. package/runtime/python/lib/okstra/globals.sh +21 -21
  56. package/runtime/python/lib/okstra/interactive.sh +7 -7
  57. package/runtime/python/okstra_ctl/clarification_items.py +3 -9
  58. package/runtime/python/okstra_ctl/consumers.py +53 -0
  59. package/runtime/python/okstra_ctl/final_report_schema.py +0 -7
  60. package/runtime/python/okstra_ctl/i18n.py +73 -0
  61. package/runtime/python/okstra_ctl/improvement_lenses.py +44 -0
  62. package/runtime/python/okstra_ctl/index.py +1 -1
  63. package/runtime/python/okstra_ctl/paths.py +26 -20
  64. package/runtime/python/okstra_ctl/render.py +166 -207
  65. package/runtime/python/okstra_ctl/render_final_report.py +53 -10
  66. package/runtime/python/okstra_ctl/run.py +299 -108
  67. package/runtime/python/okstra_ctl/run_context.py +22 -0
  68. package/runtime/python/okstra_ctl/seeding.py +186 -0
  69. package/runtime/python/okstra_ctl/session.py +65 -7
  70. package/runtime/python/okstra_ctl/wizard.py +348 -127
  71. package/runtime/python/okstra_ctl/workflow.py +21 -2
  72. package/runtime/python/okstra_ctl/worktree.py +54 -1
  73. package/runtime/python/okstra_project/resolver.py +4 -3
  74. package/runtime/python/okstra_token_usage/report.py +2 -2
  75. package/runtime/schemas/final-report-v1.0.schema.json +22 -16
  76. package/runtime/skills/okstra-brief/SKILL.md +102 -218
  77. package/runtime/skills/okstra-convergence/SKILL.md +2 -3
  78. package/runtime/skills/okstra-inspect/SKILL.md +581 -0
  79. package/runtime/skills/okstra-report-writer/SKILL.md +35 -15
  80. package/runtime/skills/okstra-run/SKILL.md +8 -7
  81. package/runtime/skills/okstra-schedule/SKILL.md +14 -157
  82. package/runtime/skills/okstra-setup/SKILL.md +28 -1
  83. package/runtime/skills/okstra-team-contract/SKILL.md +16 -107
  84. package/runtime/templates/okstra.CLAUDE.md +104 -0
  85. package/runtime/templates/reports/brief.template.md +204 -0
  86. package/runtime/templates/reports/final-report.template.md +93 -98
  87. package/runtime/templates/reports/i18n/en.json +135 -0
  88. package/runtime/templates/reports/i18n/ko.json +135 -0
  89. package/runtime/templates/reports/implementation-planning-input.template.md +18 -0
  90. package/runtime/templates/reports/improvement-discovery-input.template.md +78 -0
  91. package/runtime/templates/reports/schedule.template.md +12 -3
  92. package/runtime/templates/reports/task-brief.template.md +2 -2
  93. package/runtime/templates/worker-prompt-preamble.md +108 -0
  94. package/runtime/validators/lib/fixtures.sh +30 -0
  95. package/runtime/validators/lib/runners.sh +1 -1
  96. package/runtime/validators/validate-implementation-plan-stages.py +211 -0
  97. package/runtime/validators/validate-run.py +121 -26
  98. package/runtime/validators/validate-workflow.sh +2 -2
  99. package/runtime/validators/validate_improvement_report.py +275 -0
  100. package/src/config.mjs +18 -0
  101. package/src/install.mjs +41 -14
  102. package/src/setup.mjs +133 -1
  103. package/src/uninstall.mjs +27 -3
  104. package/runtime/skills/okstra-history/SKILL.md +0 -165
  105. package/runtime/skills/okstra-logs/SKILL.md +0 -173
  106. package/runtime/skills/okstra-report-finder/SKILL.md +0 -111
  107. package/runtime/skills/okstra-status/SKILL.md +0 -246
  108. package/runtime/skills/okstra-time-summary/SKILL.md +0 -172
@@ -41,12 +41,19 @@ cross-verification and would conflict with anything decided here.
41
41
  ## Intended chain
42
42
 
43
43
  ```
44
- okstra-brief
44
+ okstra-brief (reporter-input variant)
45
45
  → okstra-run (requirements-discovery | error-analysis)
46
46
  → okstra-run (implementation-planning)
47
47
  → okstra-run (implementation)
48
48
  → okstra-run (final-verification)
49
49
  → okstra-run (release-handoff)
50
+
51
+ okstra-brief (codebase-scan variant)
52
+ → okstra-run (improvement-discovery)
53
+ → okstra-run (implementation-planning)
54
+ → okstra-run (implementation)
55
+ → okstra-run (final-verification)
56
+ → okstra-run (release-handoff)
50
57
  ```
51
58
 
52
59
  ## When to use
@@ -70,8 +77,7 @@ okstra-brief
70
77
 
71
78
  **All okstra-generated artifacts live under `<PROJECT_ROOT>/.project-docs/okstra/`.**
72
79
  This includes briefs, run manifests, reports, worker results, status,
73
- sessions, and any other run output. okstra itself never writes to `.scratch/`
74
- or other project paths.
80
+ sessions, and any other run output.
75
81
 
76
82
  All writes by this skill stay inside `.project-docs/okstra/`. When domain
77
83
  alignment (Step 3b / Step 4.5) yields a glossary change that the user
@@ -81,12 +87,11 @@ approves inline, the change is written to:
81
87
  glossary. Created if absent; appended to a `## Glossary` section
82
88
  otherwise.
83
89
 
84
- External `<PROJECT_ROOT>/CONTEXT.md` / `<PROJECT_ROOT>/CONTEXT-MAP.md` /
85
- `<PROJECT_ROOT>/docs/adr/` are read-only references; this skill never
86
- writes to them. Decision files (when raised by `implementation-planning`)
87
- also live inside okstra's subtree at
88
- `<PROJECT_ROOT>/.project-docs/okstra/decisions/<NNNN>-<slug>.md`, never
89
- at external `docs/adr/`.
90
+ Paths outside `<PROJECT_ROOT>/.project-docs/okstra/**` are not okstra
91
+ memory. This skill reads them only when the reporter explicitly cited them
92
+ as source material, and never writes them. Decision files (when raised by
93
+ `implementation-planning`) also live inside okstra's subtree at
94
+ `<PROJECT_ROOT>/.project-docs/okstra/decisions/<NNNN>-<slug>.md`.
90
95
 
91
96
  ## Authority files
92
97
 
@@ -128,6 +133,19 @@ Parse the JSON from stdout:
128
133
 
129
134
  ## Step 1: Choose input source
130
135
 
136
+ ### 1.0. brief variant
137
+
138
+ `AskUserQuestion` (single-select):
139
+
140
+ - **Label**: `"Brief variant?"`
141
+ - **Options**:
142
+ 1. `Reporter input` — reporter 발화 / 티켓 / 링크 / 자유 텍스트를 verbatim 으로 흡수. 기존 4-source 흐름.
143
+ 2. `Codebase scan` — 코드베이스 범위 + lens 우선순위만 받아 `improvement-discovery` phase 의 입력을 생성.
144
+
145
+ ### 1.A. Reporter input (variant 1)
146
+
147
+ If the user picked `Reporter input`, proceed to Step 1.A's sub-flow below — this is the existing 4-source flow. Choose ONE of:
148
+
131
149
  `AskUserQuestion` (tool constraint: max 4 options):
132
150
 
133
151
  - **Label**: "Source of this brief?"
@@ -291,6 +309,34 @@ Two sub-modes combined under one option.
291
309
  When both are used, record them as two separate sub-sources under Source
292
310
  Material.
293
311
 
312
+ ### 1.B. Codebase scan (variant 2)
313
+
314
+ If the user picked `Codebase scan`, gather the codebase-scan-specific inputs:
315
+
316
+ 1. `AskUserQuestion` (free text):
317
+ `"Scan scope — comma-separated paths inside the project (e.g. src/foo/, src/bar/baz.py)"` → `scan_scope` (CSV).
318
+ 2. `AskUserQuestion` (multi-select, options = the 8 lens enum values from `scripts/okstra_ctl/improvement_lenses.py`'s `LENSES`):
319
+ `"Priority lenses (pick 1–4)"` → `priority_lenses` (1..4 values from the enum).
320
+ Enum values: `performance`, `security`, `readability`, `architecture`, `test-coverage`, `dx`, `observability`, `accessibility`.
321
+ 3. `AskUserQuestion` (free text):
322
+ `"Out-of-scope paths (optional, comma-separated)"` → `out_of_scope` (CSV, empty allowed).
323
+ 4. `AskUserQuestion` (free text):
324
+ `"Candidate cap (1–12, default 8)"` → `candidate_cap` (integer; empty → 8).
325
+ 5. `AskUserQuestion` (free text):
326
+ `"Context — why is this scope being scanned now? One short paragraph."` → `context`.
327
+ 6. `AskUserQuestion` (free text):
328
+ `"Desired outcome — what kinds of improvements do you want surfaced? Anti-goals?"` → `desired_outcome`.
329
+ 7. `AskUserQuestion` (free text):
330
+ `"Constraints — untouchable areas, deadlines, compatibility (optional)"` → `constraints`.
331
+
332
+ Validation (before Step 4 sharpening):
333
+
334
+ - `scan_scope` 의 각 path 가 `<PROJECT_ROOT>` 안에 실제 존재하는지 `ls` 로 확인 — 없으면 한 질문으로 정정.
335
+ - `priority_lenses` 가 `scripts/okstra_ctl/improvement_lenses.py` 의 `LENSES` 부분집합 (1–4) 인지 확인 — 위반 시 enum 표시 + 재선택.
336
+ - `candidate_cap` 이 1–12 정수인지 확인.
337
+
338
+ Once validation passes, jump to Step 2 (task key).
339
+
294
340
  ## Step 2: Identify task key & filename
295
341
 
296
342
  ### 2a. Task group
@@ -344,7 +390,7 @@ to Source Material body, not to the filename):
344
390
  3. Lowercase (Hangul untouched) — **filename normalization only**.
345
391
  The Source Material section MUST preserve the original title's case
346
392
  byte-for-byte; lowercase applies strictly to the on-disk filename.
347
- 4. Cut to 60 chars at a word boundary (hard-cut at 60 if no boundary)
393
+ 4. Cut to 60 chars at a word boundary (cut at 60 if no boundary)
348
394
  5. Trim leading/trailing `-`
349
395
  - Example: Linear `LIN-1234 "Fix flaky login retry on 5xx"` →
350
396
  `LIN-1234-fix-flaky-login-retry-on-5xx.md`
@@ -385,12 +431,9 @@ never error:
385
431
  1. **okstra-internal (authoritative)** — always check first:
386
432
  - `<PROJECT_ROOT>/.project-docs/okstra/glossary.md` if present
387
433
  - `<PROJECT_ROOT>/.project-docs/okstra/decisions/` titles if present
388
- 2. **External (supplementary read-only reference)** — read if present:
389
- - `<PROJECT_ROOT>/CONTEXT.md` (or `CONTEXT-MAP.md` per-context
390
- `CONTEXT.md`)
391
- - `<PROJECT_ROOT>/docs/adr/` titles
392
- - `<PROJECT_ROOT>/.scratch/CONTEXT.md` (output of external skills like
393
- grill-with-docs, if any)
434
+ 2. **Explicit source material only** — if the reporter cited a path outside
435
+ okstra's subtree, read it as source evidence only; do not treat it as
436
+ okstra memory.
394
437
 
395
438
  If none of these exist, skip 3b/3c silently.
396
439
 
@@ -398,7 +441,7 @@ If none of these exist, skip 3b/3c silently.
398
441
 
399
442
  For each domain-significant noun in Source Material, classify:
400
443
 
401
- - **conflict** — the source uses a term that `CONTEXT.md` defines
444
+ - **conflict** — the source uses a term that okstra memory defines
402
445
  differently. Example: source says "cancellation" meaning refund, glossary
403
446
  says "cancellation" means order-state transition.
404
447
  - **fuzzy / overloaded** — a term that has no canonical definition yet but
@@ -415,7 +458,7 @@ on a project-internal concrete object whenever possible.
415
458
  (so the next phase can resolve it during `requirements-discovery`).
416
459
  - One line under `Augmentation > Domain alignment` with the
417
460
  `terminology-mapping` label (Step 4 label rules), recording the
418
- observation (what the source said vs. what CONTEXT.md says).
461
+ observation (what the source said vs. what okstra memory says).
419
462
  - **File paths and symbols are resolved to absolute, in-repo references.**
420
463
  When the source mentions a module / class / endpoint / config key, run
421
464
  `Read` / `Grep` to locate the concrete file path (relative to
@@ -434,8 +477,7 @@ on a project-internal concrete object whenever possible.
434
477
  knows to query the reporter directly rather than infer.
435
478
  - See Step 4.5 for the approval-gated path to actually write the
436
479
  okstra-internal glossary at
437
- `<PROJECT_ROOT>/.project-docs/okstra/glossary.md`. External
438
- `CONTEXT.md` / `CONTEXT-MAP.md` / `docs/adr/` are never edited.
480
+ `<PROJECT_ROOT>/.project-docs/okstra/glossary.md`.
439
481
 
440
482
  Skip 3b/3c for purely external request material with no overlap to the
441
483
  project's domain.
@@ -473,7 +515,7 @@ The following rules absorb the useful parts of `grill-me` /
473
515
  draft, then ask the next.
474
516
  4. **Bounded budget** — at most **1** sharpening question per empty
475
517
  required section, plus **at most 2** disambiguation questions arising
476
- from Step 3b (terminology conflicts / fuzzy terms). Hard cap: **6
518
+ from Step 3b (terminology conflicts / fuzzy terms). Cap: **6
477
519
  questions total** across the whole brief. Anything beyond the cap is
478
520
  recorded under `Open Questions` instead of asked.
479
521
  5. **Scenario probe (optional)** — when `Desired Outcome` is empty or one
@@ -491,6 +533,23 @@ or to a `> augmented: <label>` blockquote inside the required section, so
491
533
  it is clear that the content is the skill's / user's added interpretation
492
534
  rather than the original source.
493
535
 
536
+ ### codebase-scan variant 전용 강화 규칙 (improvement-discovery)
537
+
538
+ 이 5개 규칙은 `scope: codebase` brief 에 한해 적용. budget 은 기본 6 → **8** 로 확대.
539
+
540
+ 1. **scan-scope 경로 존재 검증.** 각 path 를 `ls` / `Read` 로 확인. 없으면 한 질문으로 정정 (path 의 가장 가까운 후보를 `Recommended:` 로 제시).
541
+ 2. **모호 path narrowing.** `"백엔드"`, `"결제 모듈"` 같은 추상 path 는 구체 디렉토리 1개 이상으로 narrowing. codebase-first 추측 후 한 질문으로 확정.
542
+ 3. **priority-lenses 화이트리스트 검증.** `scripts/okstra_ctl/improvement_lenses.py` 의 `LENSES` 부분집합인지 확인. out-of-enum 이면 enum 내 가장 가까운 값을 `Recommended:` 로 제시.
543
+ 4. **out-of-scope 일관성.** `out-of-scope` 의 각 path 가 `scan-scope` 의 부분집합인지 확인. 무관한 path 면 한 질문으로 제거 또는 scan-scope 에 흡수.
544
+ 5. **lens 우선순위 근거 1줄.** 각 priority lens 가 *왜* 이 scope 에서 우선인지 brief 본문에 한 줄 없으면, codebase 1차 훑은 결과를 `Recommended:` 로 제시 후 한 질문.
545
+
546
+ stop conditions (codebase-scan 한정 추가):
547
+
548
+ - `scan-scope` 의 모든 path 가 codebase 에 존재
549
+ - `priority-lenses` 가 valid enum 부분집합 (1–4개)
550
+
551
+ 위 두 조건이 모두 만족되면 budget 이 남아 있어도 sharpening 종료 가능.
552
+
494
553
  ### Augmentation labels (REQUIRED — no unlabelled augmentation)
495
554
 
496
555
  Every augmentation — both inline `> augmented: …` blockquotes and
@@ -501,7 +560,7 @@ labels. Unlabelled augmentation is rejected as half-formed translation.
501
560
  |---|---|---|
502
561
  | `evidence-link` | Cross-reference / file path / symbol resolved from the source against the actual codebase. Pure fact, verified by `Read` / `Grep`. | Trust without verification. |
503
562
  | `format-conversion` | Format-only transform (Jira ADF → Markdown, HTML → Markdown, etc.). Semantics unchanged. | Trust without verification. |
504
- | `terminology-mapping` | Reporter's word mapped to a project-canonical term (from `CONTEXT.md` or resolved during Step 3b). | Verify against `CONTEXT.md`; if mismatch, treat as a clarification candidate. |
563
+ | `terminology-mapping` | Reporter's word mapped to an okstra-canonical term from Step 3b. | Verify against `.project-docs/okstra/glossary.md`; if mismatch, treat as a clarification candidate. |
505
564
  | `intent-inference` | Reporter did NOT literally state this — the skill inferred meaning from context (e.g. classifying "가끔 안 됨" as "intermittent failure on a specific path"). Qualitative only — **never** invent quantitative thresholds (numbers, latencies, percentages, counts). | **Verify with the reporter before acting.** Auto-mirrored into `Open Questions`. |
506
565
 
507
566
  **Inline form** — `> augmented: intent-inference — <one line>`.
@@ -559,8 +618,7 @@ For each `conflict` / `fuzzy` term collected in Step 3b that *was not*
559
618
  resolved by a budgeted Step 4 question, draft a glossary proposal and
560
619
  offer it to the user. This step writes to the **okstra-internal
561
620
  glossary** at `<PROJECT_ROOT>/.project-docs/okstra/glossary.md` only —
562
- external `<PROJECT_ROOT>/CONTEXT.md` / `CONTEXT-MAP.md` are never edited
563
- by this skill.
621
+ the skill does not write outside okstra's subtree.
564
622
 
565
623
  > **Decision scope**: this skill does NOT evaluate decision candidates
566
624
  > and does NOT draft decision files. Decision creation requires context
@@ -569,8 +627,7 @@ by this skill.
569
627
  > goes to `Open Questions` with the `adr-candidate:` prefix and is
570
628
  > evaluated by `implementation-planning` against the three-criteria
571
629
  > gate. Approved decision files land at
572
- > `<PROJECT_ROOT>/.project-docs/okstra/decisions/<NNNN>-<slug>.md`,
573
- > never at external `<PROJECT_ROOT>/docs/adr/`.
630
+ > `<PROJECT_ROOT>/.project-docs/okstra/decisions/<NNNN>-<slug>.md`.
574
631
 
575
632
  ### 4.5a. Draft glossary proposals
576
633
 
@@ -619,196 +676,23 @@ Use the same template per brief file. In tracker mode producing a parent
619
676
  plus N children, you write **N+1 files** (each carries only its own Source
620
677
  Material).
621
678
 
622
- Use this exact template. Leave a section's body as `_(none)_` rather than
623
- fabricating content. (The outer fence uses 4 backticks so it does not
624
- collide with the inner 3-backtick code block.)
625
-
626
- ````markdown
627
- ---
628
- type: brief
629
- brief-id: <ticket-id>-<file-title> # equals the filename stem
630
- parent-id: self # always `self` at root; child briefs use parent's brief-id
631
- ticket-id: <LIN-1234 | PROJ-42 | gh-repo-123 | notion-abcdef12 | "">
632
- source-type: <file | linear | jira | github | notion | url | user-input>
633
- task-group: <task-group>
634
- depth: 0 # 0=parent/single, 1=child, 2=grandchild, ...
635
- created: <YYYY-MM-DD>
636
- generator: okstra-brief
637
- reporter-confirmations: <complete | partial | pending | skipped> # set by Step 6.5
638
- ---
639
-
640
- # Task Brief: <task_group>/<filename-without-ext>
641
-
642
- > Generated: okstra-brief · <YYYY-MM-DD>
643
- > Source type: <file | linear | jira | github | notion | url | user-input>
644
- > Tracker key (if any): <LIN-1234 | PROJ-42 | gh-repo-123 | notion-abcdef12>
645
- > Parent brief (child briefs only): <relative path>
646
- > Recommended next phase: <requirements-discovery | error-analysis> ← from Step 6
647
- > Handoff contract: see `prompts/profiles/_common-contract.md` § "Brief handoff contract"
648
-
649
- ## Source Material
650
-
651
- <!-- author guidance — strip out at fill-in time:
652
- Paste each source separately and as-is. No paraphrasing, summarizing, or
653
- restructuring. Format conversion (e.g. Jira ADF → Markdown) is allowed and
654
- must be annotated in the header meta. Heading was originally
655
- "Source Material (verbatim — do not modify)" — the parenthetical is a
656
- reviewer note, not body text.
657
- -->
658
-
659
- ### Source 1 — <type: file | linear | jira | github | notion | url | user-input>
660
-
661
- - ref: <abs file path | LIN-1234 | https://... | "conversation synthesis">
662
- - fetched-via: <Read | mcp__linear__getIssue | mcp__notion__... | gh issue view | WebFetch | user-paste>
663
- - fetched-at: <YYYY-MM-DD HH:MM>
664
- - format: <as-is | "Jira ADF → Markdown (semantics preserved)" | "tool-truncated — missing body requested from reporter">
665
-
666
- ```
667
- <Paste the raw source here without changing a single character.>
668
- ```
669
-
670
- <!-- Repeat `### Source N — …` blocks as needed. -->
671
-
672
- ## Context
673
-
674
- <Background / scope / why now. If self-evident from Source Material, quote
675
- it briefly and stop. Use the blockquote below when augmentation is needed.>
676
-
677
- > augmented: <label> — <Interpretation added by the skill or user.>
678
-
679
- <!-- label MUST be one of: `evidence-link` / `format-conversion` /
680
- `terminology-mapping` / `intent-inference`. Do NOT add any extra
681
- interpretation outside the `> augmented:` blockquote. -->
682
-
683
- ## Problem / Symptom
684
-
685
- <Current state. For bugs: repro / observed / expected. For greenfield: gap
686
- between current and desired.>
679
+ [`templates/reports/brief.template.md`](../../templates/reports/brief.template.md) is the byte-for-byte SSOT for the brief shape — frontmatter keys, top-header blockquote, section ordering, and inline `<!-- author guidance -->` HTML comments. Render that file with the per-brief values substituted; leave any section's body as `_(none)_` rather than fabricating content. Preserve the template's HTML comments verbatim (they are part of the contract) but do NOT promote them to body prose.
687
680
 
688
- <!-- Same source-quote + `> augmented:` rule as the Context section. -->
681
+ **Variant note:** The template file is the canonical reporter-input shape. For the codebase-scan variant (`scope: codebase` in frontmatter), OMIT the `## Source Material` and `## Problem / Symptom` headings entirely — do NOT include them with `_(none)_` bodies. Instead, KEEP the `## Scan Scope` and `## Priority Lenses` sections (already present in the template file, marked with HTML comments). The remaining sections (Context / Desired Outcome / Constraints / Related Artifacts / Open Questions / Reporter Confirmations / Augmentation) apply to both variants.
689
682
 
690
- ## Desired Outcome
683
+ ### Required sections by variant
691
684
 
692
- <Shape of success.>
693
-
694
- <!-- Do NOT prescribe a solution that belongs to implementation-planning. -->
695
-
696
- ## Constraints
697
-
698
- <Deadlines, compatibility, technical/operational limits. Use _(none)_ if
699
- none.>
700
-
701
- ## Related Artifacts
702
-
703
- - <file path / URL / issue / prior task-key>
704
-
705
- ## Open Questions
706
-
707
- <!-- author guidance — strip out at fill-in time:
708
- Prefix every row with one of these signals so the next phase knows how to
709
- handle it. Free-form rows are allowed only as `general:`.
710
-
711
- Allowed signals:
712
- - `general: <unresolved question the user flagged>`
713
- - `terminology: <reporter word> — needs canonical resolution against
714
- <PROJECT_ROOT>/.project-docs/okstra/glossary.md`
715
- - `intent-check: <restated inference> — confirm with reporter`
716
- (auto-paired with every `intent-inference` augmentation)
717
- - `conversion-block: <reporter statement> — could not be mapped to project
718
- vocabulary; reporter query required`
719
- - `adr-candidate: <topic>` — signal only; `implementation-planning`
720
- evaluates and, if accepted, drafts a decision file at
721
- `<PROJECT_ROOT>/.project-docs/okstra/decisions/<NNNN>-<slug>.md`.
722
-
723
- Use `_(none)_` only if every signal is empty. `intent-check:` and
724
- `conversion-block:` rows that are answered in Step 6.5 are NOT removed
725
- from this list — they receive a `[CONFIRMED <YYYY-MM-DD> → RC-N]`
726
- marker that links to the corresponding entry under
727
- `## Reporter Confirmations`.
728
- -->
729
-
730
- - <fill in one row per signal, or replace with `_(none)_`>
731
-
732
- ## Reporter Confirmations
733
-
734
- <!-- Populated by Step 6.5. Each subsection records one reporter answer
735
- verbatim, with a link back to the originating `Open Questions` row. -->
736
-
737
- _(none — pending or skipped)_
738
-
739
- <!-- when populated, the shape is:
740
- ### RC-1 — <intent-check: or conversion-block: row id / topic>
741
- - asked: <YYYY-MM-DD HH:MM>
742
- - linked-row: `<exact Open Questions row text>`
743
- - answer (verbatim):
744
-
745
- > <reporter's answer, byte-for-byte>
746
- -->
747
-
748
- ## Augmentation
749
-
750
- <!-- author guidance — strip out at fill-in time:
751
- Cross-references / interpretation / context added by the user or skill that
752
- is not in the original source. May be empty. Keep this section visually
753
- separated from Source Material — never inline it inside Source Material.
754
-
755
- Every entry below must start with one of the four labels:
756
- `evidence-link` / `format-conversion` / `terminology-mapping` /
757
- `intent-inference`. Unlabelled entries are forbidden.
758
- -->
759
-
760
- ### Domain alignment
761
-
762
- <!-- author guidance — strip out at fill-in time:
763
- Observations from Step 3b and the outcome of Step 4.5 (glossary applied
764
- vs. skipped). The actual glossary edits live in
765
- `<PROJECT_ROOT>/.project-docs/okstra/glossary.md` when applied; this
766
- section records what happened. Decision candidates are NOT recorded here —
767
- they flow through `Open Questions` as `adr-candidate:` rows for
768
- `implementation-planning` to evaluate (and, if accepted, draft into
769
- `<PROJECT_ROOT>/.project-docs/okstra/decisions/`).
770
-
771
- Allowed entry shapes:
772
- - `terminology-mapping: <reporter word> → <okstra glossary canonical>` —
773
- routine glossary alignment, paired with `terminology:` in Open Questions
774
- when unresolved.
775
- - `terminology-mapping: applied glossary: <term> → <PROJECT_ROOT>/.project-docs/okstra/glossary.md`
776
- - `terminology-mapping: skipped glossary: <term> = <definition>` —
777
- Step 4.5 outcomes.
778
- Use `_(none)_` if every alignment entry is empty.
779
- -->
780
-
781
- - <fill in one entry per alignment, or replace with `_(none)_`>
782
-
783
- ### Evidence links (file / symbol resolution)
784
-
785
- <!-- Allowed entry shapes:
786
- `evidence-link: <reporter phrase> → <relative path>:<line>` or
787
- `evidence-link: <reporter phrase> → <symbol> in <relative path>`.
788
- Use `_(none)_` if none. -->
789
-
790
- - <fill in one entry per link, or replace with `_(none)_`>
791
-
792
- ### Intent inferences
793
-
794
- <!-- Every entry here is an unverified hypothesis. Each one MUST have a
795
- paired `intent-check:` row under Open Questions.
796
-
797
- Allowed entry shape:
798
- `intent-inference: <reporter phrase> → <qualitative restatement>`
799
- (qualitative only — never invent numeric thresholds).
800
- Use `_(none)_` if none. -->
801
-
802
- - <fill in one entry per inference, or replace with `_(none)_`>
803
-
804
- ### Format conversions
805
-
806
- <!-- Allowed entry shape:
807
- `format-conversion: <ref> — <e.g. Jira ADF → Markdown, semantics preserved>`.
808
- Use `_(none)_` if none. -->
809
-
810
- - <fill in one entry per conversion, or replace with `_(none)_`>
811
- ````
685
+ | Section | `reporter-input` variant | `codebase` variant |
686
+ |---|---|---|
687
+ | `## Source Material` | Required | Not required omit |
688
+ | `## Problem / Symptom` | Required | Not required — omit |
689
+ | `## Context` | Required | Required |
690
+ | `## Desired Outcome` | Required | Required |
691
+ | `## Constraints` | Required | Required |
692
+ | `## Related Artifacts` | Required | Required |
693
+ | `## Open Questions` | Required | Required |
694
+ | `## Scan Scope` | Not applicable — omit | Required — one bullet per `scan-scope` path with a short description of what lives there |
695
+ | `## Priority Lenses` | Not applicable — omit | Required — one bullet per priority lens with a short rationale for why that lens applies to this scope |
812
696
 
813
697
  ### Frontmatter rules
814
698
 
@@ -842,6 +726,7 @@ Inspect the finalized brief and recommend the next `okstra-run` task-type:
842
726
  |---|---|
843
727
  | `Problem / Symptom` describes a repro / log / stack trace / observable error | `error-analysis` |
844
728
  | `Open Questions` is large or `Desired Outcome` is ambiguous / needs classification | `requirements-discovery` |
729
+ | `scope: codebase` frontmatter | `improvement-discovery` |
845
730
  | Both / ambiguous | `requirements-discovery` (safe default — the phase itself decides branching) |
846
731
 
847
732
  Write the chosen recommendation into the `Recommended next phase:` header
@@ -886,7 +771,7 @@ For each pending row, formulate one question. Because the
886
771
  `AskUserQuestion` tool caps options at 4 per call and questions per call
887
772
  also at 4, split into batches of ≤ 4 questions.
888
773
 
889
- **Hard cap — 12 questions per Step 6.5 run.** When the pending list
774
+ **Cap — 12 questions per Step 6.5 run.** When the pending list
890
775
  exceeds 12 rows, sort by priority and ask only the top 12 this round:
891
776
 
892
777
  1. `conversion-block:` rows first (translation failure — highest
@@ -983,10 +868,9 @@ started.
983
868
  `<PROJECT_ROOT>/.project-docs/okstra/`. This skill's brief files go
984
869
  under `.project-docs/okstra/briefs/`; its glossary writes go to
985
870
  `.project-docs/okstra/glossary.md` (Step 4.5 approval flow).
986
- - External paths (`<PROJECT_ROOT>/CONTEXT.md`,
987
- `<PROJECT_ROOT>/CONTEXT-MAP.md`, `<PROJECT_ROOT>/docs/adr/`,
988
- `<PROJECT_ROOT>/.scratch/`) are read-only references. This skill
989
- never writes to them. Absent external files are the normal state.
871
+ - Paths outside `<PROJECT_ROOT>/.project-docs/okstra/**` are read-only
872
+ source material only when explicitly cited by the reporter. This skill
873
+ never writes outside okstra's subtree.
990
874
  - **Verbatim source**: never paraphrase, summarize, restructure, or reorder
991
875
  the Source Material section. Only format conversion (ADF → MD, HTML → MD)
992
876
  is allowed, and the conversion must be annotated in the `format:` meta.
@@ -465,7 +465,7 @@ Plan-body verification is configured under `convergence.planBodyVerification` in
465
465
  | Setting | Default | Description |
466
466
  |---------|---------|-------------|
467
467
  | `enabled` | `true` | If `false`, the round is skipped and the top-of-report Approval marker is rendered unconditionally (legacy behaviour). |
468
- | `maxRounds` | `1` | Hard upper bound. Plan-body verification is consistency / completeness checking, not fact checking — additional rounds rarely help. Range 1–3. |
468
+ | `maxRounds` | `1` | Upper bound. Plan-body verification is consistency / completeness checking, not fact checking — additional rounds rarely help. Range 1–3. |
469
469
  | `gating` | `true` | If `true` (default), `majority-disagree` blocks the Approval marker. If `false`, the round is advisory-only and the marker always renders. |
470
470
 
471
471
  Default values are emitted into the manifest by `scripts/okstra_ctl/render.py` (`_build_convergence_block`). The ctx knob `OKSTRA_PLAN_VERIFICATION=false` flips `planBodyVerification.enabled` to false.
@@ -632,5 +632,4 @@ Mirrors finding convergence (§"Worker failure handling in reverify"). Concretel
632
632
 
633
633
  - A dispatch that returns terminal non-result MUST NOT be aggregated as `DISAGREE`.
634
634
  - If at least one dispatch was issued AND **all** plan-body dispatches return non-result, the Gate result is `aborted-non-result`. Record one `contract-violation` event per non-result dispatch.
635
- - The Approval marker is NOT rendered when the gate is `aborted-non-result`. A single row is added to `## 5. Clarification Items` with `Statement="plan-body verification could not run — all workers returned non-result"`, `Kind=decision`, `Blocks=approval`, allowing the user to either retry the phase or override by manually approving the plan (via `--approve` on the resume command).
636
-
635
+ - When the gate is `aborted-non-result`, report-writer MUST keep the frontmatter `approved: false` (publishing `approved: true` under this gate result is a validator failure). A single row is added to `## 5. Clarification Items` with `Statement="plan-body verification could not run — all workers returned non-result"`, `Kind=decision`, `Blocks=approval`, allowing the user to either retry the phase or override by manually flipping the frontmatter to `approved: true` (or running `--approve` on the resume command).