@tiic-tech/openworkflow 0.1.0 → 0.1.2

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 (217) hide show
  1. package/README.md +10 -0
  2. package/dist/adapters/codex/src/cleanCodexAdapter.d.ts +7 -0
  3. package/dist/adapters/codex/src/cleanCodexAdapter.js +99 -0
  4. package/dist/adapters/codex/src/cleanCodexAdapter.js.map +1 -0
  5. package/dist/adapters/codex/src/constants.d.ts +1 -0
  6. package/dist/adapters/codex/src/constants.js +2 -0
  7. package/dist/adapters/codex/src/constants.js.map +1 -0
  8. package/dist/adapters/codex/src/generateCommands.js +14 -9
  9. package/dist/adapters/codex/src/generateCommands.js.map +1 -1
  10. package/dist/adapters/codex/src/generateSkills.js +13 -0
  11. package/dist/adapters/codex/src/generateSkills.js.map +1 -1
  12. package/dist/adapters/codex/src/generatedFiles.js +1 -1
  13. package/dist/adapters/codex/src/manifest.js +11 -2
  14. package/dist/adapters/codex/src/manifest.js.map +1 -1
  15. package/dist/adapters/codex/src/templates.d.ts +0 -1
  16. package/dist/adapters/codex/src/templates.js +0 -1
  17. package/dist/adapters/codex/src/templates.js.map +1 -1
  18. package/dist/adapters/src/registry.d.ts +20 -0
  19. package/dist/adapters/src/registry.js +81 -0
  20. package/dist/adapters/src/registry.js.map +1 -0
  21. package/dist/cli/src/commands/brief.d.ts +46 -0
  22. package/dist/cli/src/commands/brief.js +294 -0
  23. package/dist/cli/src/commands/brief.js.map +1 -0
  24. package/dist/cli/src/commands/check.d.ts +42 -0
  25. package/dist/cli/src/commands/check.js +326 -0
  26. package/dist/cli/src/commands/check.js.map +1 -0
  27. package/dist/cli/src/commands/clean.d.ts +1 -0
  28. package/dist/cli/src/commands/clean.js +98 -0
  29. package/dist/cli/src/commands/clean.js.map +1 -0
  30. package/dist/cli/src/commands/context.d.ts +1 -0
  31. package/dist/cli/src/commands/context.js +471 -0
  32. package/dist/cli/src/commands/context.js.map +1 -0
  33. package/dist/cli/src/commands/doctor.js +122 -12
  34. package/dist/cli/src/commands/doctor.js.map +1 -1
  35. package/dist/cli/src/commands/draft.d.ts +1 -0
  36. package/dist/cli/src/commands/draft.js +175 -0
  37. package/dist/cli/src/commands/draft.js.map +1 -0
  38. package/dist/cli/src/commands/gitAutomation.d.ts +1 -0
  39. package/dist/cli/src/commands/gitAutomation.js +378 -0
  40. package/dist/cli/src/commands/gitAutomation.js.map +1 -0
  41. package/dist/cli/src/commands/handoff.d.ts +22 -0
  42. package/dist/cli/src/commands/handoff.js +122 -0
  43. package/dist/cli/src/commands/handoff.js.map +1 -0
  44. package/dist/cli/src/commands/init.js +52 -1
  45. package/dist/cli/src/commands/init.js.map +1 -1
  46. package/dist/cli/src/commands/inspect.d.ts +23 -0
  47. package/dist/cli/src/commands/inspect.js +157 -0
  48. package/dist/cli/src/commands/inspect.js.map +1 -0
  49. package/dist/cli/src/commands/register.d.ts +1 -0
  50. package/dist/cli/src/commands/register.js +251 -0
  51. package/dist/cli/src/commands/register.js.map +1 -0
  52. package/dist/cli/src/commands/resume.d.ts +59 -0
  53. package/dist/cli/src/commands/resume.js +280 -0
  54. package/dist/cli/src/commands/resume.js.map +1 -0
  55. package/dist/cli/src/commands/shared.js +6 -2
  56. package/dist/cli/src/commands/shared.js.map +1 -1
  57. package/dist/cli/src/commands/summaries.d.ts +1 -0
  58. package/dist/cli/src/commands/summaries.js +77 -0
  59. package/dist/cli/src/commands/summaries.js.map +1 -0
  60. package/dist/cli/src/commands/summarize.d.ts +1 -0
  61. package/dist/cli/src/commands/summarize.js +316 -0
  62. package/dist/cli/src/commands/summarize.js.map +1 -0
  63. package/dist/cli/src/commands/sync.js +135 -12
  64. package/dist/cli/src/commands/sync.js.map +1 -1
  65. package/dist/cli/src/commands/validate.js +25 -1
  66. package/dist/cli/src/commands/validate.js.map +1 -1
  67. package/dist/cli/src/dev/verifyAgentE2E.d.ts +2 -0
  68. package/dist/cli/src/dev/verifyAgentE2E.js +391 -0
  69. package/dist/cli/src/dev/verifyAgentE2E.js.map +1 -0
  70. package/dist/cli/src/dev/verifyCleanCommand.d.ts +2 -0
  71. package/dist/cli/src/dev/verifyCleanCommand.js +338 -0
  72. package/dist/cli/src/dev/verifyCleanCommand.js.map +1 -0
  73. package/dist/cli/src/dev/verifyRuntimeSurface.js +4940 -54
  74. package/dist/cli/src/dev/verifyRuntimeSurface.js.map +1 -1
  75. package/dist/cli/src/dev/verifyWorkflowE2E.js +477 -45
  76. package/dist/cli/src/dev/verifyWorkflowE2E.js.map +1 -1
  77. package/dist/cli/src/index.js +189 -5
  78. package/dist/cli/src/index.js.map +1 -1
  79. package/dist/cli/src/report.d.ts +26 -0
  80. package/dist/cli/src/report.js +17 -0
  81. package/dist/cli/src/report.js.map +1 -0
  82. package/dist/core/src/artifacts/readiness.d.ts +7 -0
  83. package/dist/core/src/artifacts/readiness.js +240 -0
  84. package/dist/core/src/artifacts/readiness.js.map +1 -0
  85. package/dist/core/src/artifacts/registry.d.ts +9 -2
  86. package/dist/core/src/artifacts/registry.js +687 -60
  87. package/dist/core/src/artifacts/registry.js.map +1 -1
  88. package/dist/core/src/commands/registry.js +1425 -146
  89. package/dist/core/src/commands/registry.js.map +1 -1
  90. package/dist/core/src/contracts/index.d.ts +1 -1
  91. package/dist/core/src/fs/index.d.ts +24 -0
  92. package/dist/core/src/fs/index.js +48 -1
  93. package/dist/core/src/fs/index.js.map +1 -1
  94. package/dist/core/src/git/autonomousSimulator.d.ts +46 -0
  95. package/dist/core/src/git/autonomousSimulator.js +163 -0
  96. package/dist/core/src/git/autonomousSimulator.js.map +1 -0
  97. package/dist/core/src/git/branchIdentity.d.ts +19 -0
  98. package/dist/core/src/git/branchIdentity.js +75 -0
  99. package/dist/core/src/git/branchIdentity.js.map +1 -0
  100. package/dist/core/src/git/draftPrPilot.d.ts +47 -0
  101. package/dist/core/src/git/draftPrPilot.js +196 -0
  102. package/dist/core/src/git/draftPrPilot.js.map +1 -0
  103. package/dist/core/src/git/localEvidenceReader.d.ts +21 -0
  104. package/dist/core/src/git/localEvidenceReader.js +142 -0
  105. package/dist/core/src/git/localEvidenceReader.js.map +1 -0
  106. package/dist/core/src/git/localGitAutomation.d.ts +68 -0
  107. package/dist/core/src/git/localGitAutomation.js +470 -0
  108. package/dist/core/src/git/localGitAutomation.js.map +1 -0
  109. package/dist/core/src/git/mergeReadinessCheckpoint.d.ts +31 -0
  110. package/dist/core/src/git/mergeReadinessCheckpoint.js +110 -0
  111. package/dist/core/src/git/mergeReadinessCheckpoint.js.map +1 -0
  112. package/dist/core/src/git/prReadySummary.d.ts +16 -0
  113. package/dist/core/src/git/prReadySummary.js +144 -0
  114. package/dist/core/src/git/prReadySummary.js.map +1 -0
  115. package/dist/core/src/git/remoteReadonlyPlanner.d.ts +60 -0
  116. package/dist/core/src/git/remoteReadonlyPlanner.js +223 -0
  117. package/dist/core/src/git/remoteReadonlyPlanner.js.map +1 -0
  118. package/dist/core/src/onboarding/agentsGuide.d.ts +32 -0
  119. package/dist/core/src/onboarding/agentsGuide.js +164 -0
  120. package/dist/core/src/onboarding/agentsGuide.js.map +1 -0
  121. package/dist/core/src/validators/validateOpenWorkflow.js +1331 -15
  122. package/dist/core/src/validators/validateOpenWorkflow.js.map +1 -1
  123. package/dist/core/src/validators/validateRepositoryContracts.js +2327 -306
  124. package/dist/core/src/validators/validateRepositoryContracts.js.map +1 -1
  125. package/dist/core/src/workflow/cleanOpenWorkflow.d.ts +18 -0
  126. package/dist/core/src/workflow/cleanOpenWorkflow.js +124 -0
  127. package/dist/core/src/workflow/cleanOpenWorkflow.js.map +1 -0
  128. package/dist/core/src/workflow/doctorOpenWorkflow.d.ts +7 -0
  129. package/dist/core/src/workflow/doctorOpenWorkflow.js +26 -0
  130. package/dist/core/src/workflow/doctorOpenWorkflow.js.map +1 -0
  131. package/dist/core/src/workflow/initOpenWorkflow.d.ts +7 -0
  132. package/dist/core/src/workflow/initOpenWorkflow.js +96 -8
  133. package/dist/core/src/workflow/initOpenWorkflow.js.map +1 -1
  134. package/dist/core/src/workflow/planningQueueResume.d.ts +105 -0
  135. package/dist/core/src/workflow/planningQueueResume.js +596 -0
  136. package/dist/core/src/workflow/planningQueueResume.js.map +1 -0
  137. package/dist/core/src/workflow/readWorkflowConfig.d.ts +6 -0
  138. package/dist/core/src/workflow/readWorkflowConfig.js +28 -0
  139. package/dist/core/src/workflow/readWorkflowConfig.js.map +1 -0
  140. package/dist/core/src/workflow/summaryHealth.d.ts +60 -0
  141. package/dist/core/src/workflow/summaryHealth.js +713 -0
  142. package/dist/core/src/workflow/summaryHealth.js.map +1 -0
  143. package/dist/core/src/workflow/syncOpenWorkflow.d.ts +22 -0
  144. package/dist/core/src/workflow/syncOpenWorkflow.js +235 -0
  145. package/dist/core/src/workflow/syncOpenWorkflow.js.map +1 -0
  146. package/package.json +4 -2
  147. package/references/artifact-authoring-templates.md +14 -12
  148. package/references/artifact-instruction-envelope.md +133 -0
  149. package/references/coder-continuous-growth-loop.md +68 -0
  150. package/references/gh-operation-governance.md +114 -0
  151. package/references/git-automation-governance.md +324 -0
  152. package/references/git-version-control-governance.md +227 -0
  153. package/references/internal-coder-protocol.md +202 -0
  154. package/references/issue-governance.md +115 -0
  155. package/references/planning-artifact-contracts.md +595 -0
  156. package/references/planning-skill-runtime-exposure.md +159 -0
  157. package/references/proto-redesign-artifact-contracts.md +217 -0
  158. package/references/proto2html-artifact-contracts.md +113 -0
  159. package/references/skill-system-lifecycle.md +198 -0
  160. package/references/validation-trust-domains.md +286 -0
  161. package/references/workflow-blueprint-runtime-alignment.md +287 -0
  162. package/schemas/atom-tasks.schema.json +101 -0
  163. package/schemas/candidate-changes.schema.json +323 -0
  164. package/schemas/current-state.schema.json +113 -0
  165. package/schemas/html-prototype.schema.json +288 -0
  166. package/schemas/openworkflow-contract.schema.json +9 -1
  167. package/schemas/proto-prompt-pack.schema.json +1333 -0
  168. package/schemas/prototype-evidence.schema.json +684 -142
  169. package/schemas/selected-change.schema.json +104 -0
  170. package/schemas/validation-target.schema.json +187 -1
  171. package/schemas/validation.schema.json +187 -1
  172. package/schemas/vision-session.schema.json +151 -0
  173. package/skills/analyze-changes/SKILL.md +92 -0
  174. package/skills/analyze-changes/agents/openai.yaml +4 -0
  175. package/skills/analyze-changes/references/analysis-protocol.md +116 -0
  176. package/skills/build-proto-prompt/SKILL.md +125 -0
  177. package/skills/build-proto-prompt/references/output-boundary.md +54 -0
  178. package/skills/build-proto-prompt/references/prompt-pack-compiler-protocol.md +80 -0
  179. package/skills/build-prototype/SKILL.md +162 -38
  180. package/skills/build-prototype/agents/openai.yaml +2 -2
  181. package/skills/build-prototype/references/philosophy-engine.md +61 -0
  182. package/skills/build-prototype/references/strategic-prompt-pack-protocol.md +365 -0
  183. package/skills/build-prototype/references/vision2prompt/01_input_contract.md +84 -0
  184. package/skills/build-prototype/references/vision2prompt/02_vision_decomposition.md +108 -0
  185. package/skills/build-prototype/references/vision2prompt/03_strategy_hypothesis_generation.md +89 -0
  186. package/skills/build-prototype/references/vision2prompt/04_product_system_extraction.md +78 -0
  187. package/skills/build-prototype/references/vision2prompt/05_prototype_prompt_schema.md +189 -0
  188. package/skills/build-prototype/references/vision2prompt/06_output_templates.md +125 -0
  189. package/skills/build-prototype/references/vision2prompt/07_quality_rubric.md +171 -0
  190. package/skills/build-validation/SKILL.md +136 -54
  191. package/skills/build-validation/references/prototype-validation-target-rubric.md +35 -0
  192. package/skills/build-validation/references/return-to-vision-gate.md +32 -0
  193. package/skills/build-vision/SKILL.md +192 -0
  194. package/skills/build-vision/references/proto-readiness-rubric.md +48 -0
  195. package/skills/build-vision/references/vision-interview-protocol.md +48 -0
  196. package/skills/coder/SKILL.md +204 -0
  197. package/skills/decompose-to-changes/SKILL.md +176 -0
  198. package/skills/decompose-to-changes/agents/openai.yaml +4 -0
  199. package/skills/decompose-to-changes/references/decomposition-protocol.md +278 -0
  200. package/skills/prompt2proto/SKILL.md +157 -0
  201. package/skills/prompt2proto/agents/openai.yaml +4 -0
  202. package/skills/prompt2proto/references/00_role_philosophy_engine.md +96 -0
  203. package/skills/prompt2proto/references/01_input_contract.md +53 -0
  204. package/skills/prompt2proto/references/02_prompt_pack_readiness.md +50 -0
  205. package/skills/prompt2proto/references/03_visual_translation_workflow.md +64 -0
  206. package/skills/prompt2proto/references/04_output_contract.md +67 -0
  207. package/skills/prompt2proto/references/05_quality_rubric.md +46 -0
  208. package/skills/proto2html/SKILL.md +136 -0
  209. package/skills/proto2html/agents/openai.yaml +4 -0
  210. package/skills/proto2html/references/proto2html-protocol.md +115 -0
  211. package/skills/run-team/SKILL.md +4 -0
  212. package/skills/select-change/SKILL.md +200 -0
  213. package/skills/select-change/agents/openai.yaml +4 -0
  214. package/skills/select-change/references/selection-protocol.md +281 -0
  215. package/skills/tune-prototype/SKILL.md +121 -0
  216. package/skills/tune-prototype/agents/openai.yaml +4 -0
  217. package/skills/tune-prototype/references/refined-prompt-pack-protocol.md +161 -0
@@ -0,0 +1,202 @@
1
+ # Internal Coder Protocol
2
+
3
+ This reference defines the contract boundary for future `/ow:coder` work.
4
+ It is a semantic contract only. It does not register a command, generate a
5
+ runtime skill, introduce a schema, enforce a gate, or change CLI JSON output.
6
+
7
+ ## Core Contract
8
+
9
+ `/ow:coder` is an internal, Agent-only engineering quality protocol for source
10
+ edits. It is not a normal user-facing workflow command, not a "write code"
11
+ entrypoint, and not a replacement for `/ow:change` or `/ow:team`.
12
+
13
+ The protocol exists to make code-changing Agents prove that they understand the
14
+ change boundary, can produce meaningful RED/GREEN evidence when behavior is
15
+ changing, and can bind validation evidence back to the selected change or run
16
+ they are executing.
17
+
18
+ Future command metadata should use:
19
+
20
+ ```yaml
21
+ trigger: /ow:coder
22
+ visibility: internal
23
+ stage: execution
24
+ audience: agent
25
+ ```
26
+
27
+ ## Non-Goals
28
+
29
+ `/ow:coder` must not:
30
+
31
+ - appear as the recommended user handoff for normal product work
32
+ - replace `/ow:change` as the selected-change implementation boundary
33
+ - replace `/ow:team` as the managed multi-agent execution runtime
34
+ - create a generic autonomous coding loop that ignores queue scope
35
+ - require `CODER_EVIDENCE.yaml` before the evidence shape is proven
36
+ - mutate `.openworkflow/**`, generated `.agents/**`, git state, or remote state
37
+ by itself
38
+
39
+ ## Responsibility Boundary
40
+
41
+ `/ow:change` owns the implementation boundary: selected change, owned paths,
42
+ forbidden paths, acceptance, validation commands, and stop conditions.
43
+
44
+ `/ow:team` owns coordinated execution when work is delegated to an Agent Team:
45
+ task assignment, progress, team evidence, and handoff back to the user.
46
+
47
+ `/ow:coder` owns the quality protocol that constrains either path when source
48
+ files are edited. It answers:
49
+
50
+ - What files, owners, and dependencies are in scope?
51
+ - What target behavior or contract gap must be observed before editing?
52
+ - What exact evidence proves the implementation moved from RED to GREEN?
53
+ - What self-check was applied after writes?
54
+ - Which validation ladder is honest for this change?
55
+ - Where is the evidence bound so a later Agent can resume or audit it?
56
+
57
+ ## Required Gates
58
+
59
+ ### 1. Trust Recovery
60
+
61
+ Before source edits, an Agent should recover the current trust state from the
62
+ repo-local read model:
63
+
64
+ - `node dist/cli/src/index.js resume --root . --json` after interruption or
65
+ low-context recovery
66
+ - `node dist/cli/src/index.js handoff --root . --json` for strict trust entry
67
+ - `node dist/cli/src/index.js inspect --root . --strict --json` for read order,
68
+ blockers, active queue, and next-command readiness
69
+ - `git status --short --branch` for branch and dirty-tree boundaries
70
+
71
+ The result must identify the selected queue or change before implementation
72
+ starts. A green entry command is scoped trust, not release readiness.
73
+
74
+ ### 2. Owner, File, And Dependency Map
75
+
76
+ Before editing, the Agent must state or internally bind:
77
+
78
+ - selected plan id and candidate id, when queue-driven
79
+ - source-of-truth artifact for the rule being changed
80
+ - files expected to change
81
+ - files explicitly forbidden by the selected change
82
+ - dependency order between docs, schemas, validators, registries, generated
83
+ surfaces, and tests
84
+ - whether generated surfaces are source outputs or source owners
85
+
86
+ This map prevents accidental second sources of truth. If the map reveals that a
87
+ generated surface would need a manual patch, the change must move back to the
88
+ source owner instead.
89
+
90
+ ### 3. RED Evidence
91
+
92
+ For behavior, validator, CLI report, generated-surface, path-safety, summary,
93
+ queue, or git-evidence changes, the Agent should produce RED evidence before
94
+ production edits. RED evidence is the smallest command, fixture, or parsed
95
+ assertion that exposes the target defect or missing contract.
96
+
97
+ Valid RED evidence can include:
98
+
99
+ - a failing parsed JSON or YAML assertion
100
+ - a failing valid or invalid fixture
101
+ - a failing generated-surface parity check
102
+ - a failing summary, handoff, or resume health assertion
103
+ - a targeted compile or runtime verifier failure
104
+
105
+ RED evidence is optional only when the selected change is documentation-only,
106
+ contract-only, or exploratory. In that case, the Agent must say that RED is not
107
+ applicable and use the nearest structural check.
108
+
109
+ ### 4. GREEN Evidence
110
+
111
+ After edits, the Agent reruns the RED evidence or nearest equivalent and proves
112
+ the target failure is gone. GREEN evidence should be narrower than release
113
+ readiness and tied to the touched trust domain.
114
+
115
+ For docs-only contract work, GREEN evidence is structural: the expected
116
+ reference exists, the selected-change artifacts point at it, trust entry commands
117
+ still pass, and whitespace/diff checks are clean.
118
+
119
+ ### 5. Post-Write Self-Check
120
+
121
+ Before final validation, the Agent must inspect its own diff for:
122
+
123
+ - source-of-truth drift
124
+ - new hidden dependencies
125
+ - accidental generated-surface edits
126
+ - overly broad module or artifact churn
127
+ - comments that narrate obvious behavior instead of explaining why
128
+ - validation commands that do not match the touched trust domain
129
+
130
+ This self-check is not a substitute for commands. It is a design gate before
131
+ command evidence is trusted.
132
+
133
+ ### 6. Validation Ladder
134
+
135
+ The selected validation ladder must match the change type:
136
+
137
+ - docs or planning contract: strict handoff/inspect/resume plus `git diff --check`
138
+ - command registry or generated protocol: build, sync preview or sync, generated
139
+ diff review, and runtime-surface verification
140
+ - artifact, schema, or validator: build, validate, and targeted valid/invalid
141
+ fixtures
142
+ - summary or recovery surfaces: handoff, inspect, summaries, resume, and a
143
+ targeted fixture or command packet
144
+ - git evidence: git-automation preview or commit evidence check plus strict
145
+ read-model commands
146
+
147
+ Broad `npm run validate` is release-domain evidence. It is valuable, but it must
148
+ not be the only proof for a narrow implementation change, and existing
149
+ historical red failures must be reported as residual risk instead of hidden.
150
+
151
+ ### 7. Evidence Binding
152
+
153
+ Coder evidence should be bound to the current OW work item without requiring a
154
+ new persistent artifact in this contract stage.
155
+
156
+ Initial binding points:
157
+
158
+ - `SELECTED_CHANGE.yaml` for scope and acceptance
159
+ - `ATOM_TASKS.yaml` for task-level status and verification commands
160
+ - `IMPLEMENTATION_BRIEF.md` for handoff instructions
161
+ - `LOCAL_COMMIT_EVIDENCE.yaml` when a candidate changes implementation files
162
+ - optional embedded `LOCAL_COMMIT_EVIDENCE.yaml.coder_evidence` for preflight,
163
+ RED/GREEN, self-check, validation ladder, and lesson evidence when present
164
+ - future standalone `CODE_EVIDENCE.yaml` or `CODER_EVIDENCE.yaml` only as a
165
+ separate candidate change after the embedded field shape proves insufficient
166
+
167
+ Evidence must include command names and enough result detail for a later Agent
168
+ to distinguish targeted GREEN evidence from unrelated historical failures.
169
+
170
+ ## Future Integration Points
171
+
172
+ These are integration points, not C001 implementation tasks.
173
+
174
+ - `/ow:change`: include coder preflight expectations in selected implementation
175
+ boundaries.
176
+ - `/ow:team`: require team execution to preserve RED/GREEN/self-check evidence
177
+ before completion.
178
+ - `git-automation`: attach coder validation evidence to local commit evidence
179
+ when implementation files changed.
180
+ - `resume`: report whether coder governance is required, complete, skipped, or
181
+ missing for the active selected change.
182
+ - `context`: include coder preflight and validation-ladder guidance when the
183
+ requested command can edit source.
184
+ - `handoff`: surface missing coder evidence as guidance before any hard failure
185
+ policy exists.
186
+ - `summaries`: summarize coder gate state only from trusted selected-change or
187
+ commit evidence.
188
+ - `inspect`: expose coder gate status in the read model once the source fields
189
+ are stable.
190
+
191
+ ## Acceptance Bar
192
+
193
+ A future `/ow:coder` implementation is acceptable only when:
194
+
195
+ - it remains `visibility: internal`
196
+ - user-facing handoffs continue to use product commands such as `/ow:change`,
197
+ `/ow:team`, `/ow:tune`, `/ow:design`, or `/ow:spec`
198
+ - generated Agent surfaces derive from source registry, skill, or adapter
199
+ owners
200
+ - missing coder evidence is guidance before it becomes enforcement
201
+ - active queue state, owned paths, forbidden paths, validation expectations, and
202
+ evidence bindings are visible to a low-context Agent
@@ -0,0 +1,115 @@
1
+ # Issue Governance
2
+
3
+ This reference defines how OpenWorkflow treats Issues in the dogfood development
4
+ model. It covers source-of-truth rules and audit linkage only. It does not
5
+ authorize `gh` commands or remote GitHub mutation.
6
+
7
+ ## Issue Role
8
+
9
+ An Issue is an intent source. It can represent a bug, problem report, user
10
+ request, product idea, external task, or review finding.
11
+
12
+ An Issue is not automatically:
13
+
14
+ - a `CANDIDATE_CHANGES.yaml` queue
15
+ - a selected change
16
+ - a commit
17
+ - a branch
18
+ - a PR
19
+
20
+ One Issue can decompose into multiple candidate queues. One candidate queue can
21
+ reference multiple Issues. One selected change can address part of an Issue
22
+ without closing it.
23
+
24
+ ## Source Of Truth Modes
25
+
26
+ Use one source-of-truth mode per Issue stream.
27
+
28
+ ### Local Mode
29
+
30
+ Use local mode when the repo has no configured or authorized `gh` workflow, or
31
+ when the user explicitly wants a git-tracked local backlog.
32
+
33
+ Local issue artifacts may be tracked in git. Suggested locations are:
34
+
35
+ ```text
36
+ issues/<issue-id>.yaml
37
+ issues/ISSUES.yaml
38
+ ```
39
+
40
+ Local issue artifacts may own:
41
+
42
+ - title or problem statement
43
+ - status
44
+ - labels or classification
45
+ - source links
46
+ - affected queues
47
+ - acceptance or reproduction notes
48
+ - audit history
49
+
50
+ ### GitHub Mode
51
+
52
+ Use GitHub mode when the user authorizes `gh` and the repository is configured
53
+ to use GitHub Issues as the issue source of truth.
54
+
55
+ In GitHub mode:
56
+
57
+ - the GitHub Issue body and comments are the remote source of truth
58
+ - OW local artifacts should not copy the remote Issue body as authoritative text
59
+ - local artifacts should store linkage, decomposition, and audit evidence
60
+ - remote mutation requires explicit gh operation governance defined in
61
+ `references/gh-operation-governance.md`
62
+
63
+ Local OW artifacts can still be tracked in git, but they should be linkage
64
+ records rather than duplicated Issues.
65
+
66
+ ## Linkage Metadata
67
+
68
+ When an Issue is decomposed or addressed, OW artifacts should record stable
69
+ references that support audit without over-copying remote content.
70
+
71
+ Recommended fields:
72
+
73
+ - `issue_source`: `local` or `github`
74
+ - `issue_ref`: local id, GitHub issue number, or URL
75
+ - `source_title`: short title or snapshot label
76
+ - `source_captured_at`: date when the link was captured
77
+ - `plan_ids`: related `CANDIDATE_CHANGES` queues
78
+ - `candidate_ids`: related candidates
79
+ - `selected_change_ids`: related selected changes
80
+ - `commit_refs`: local commit hashes when available
81
+ - `branch_refs`: owning feat branches
82
+ - `pr_refs`: pull request URLs or numbers when available
83
+ - `status_note`: open, partially addressed, addressed, deferred, or superseded
84
+
85
+ For GitHub mode, `source_title` is a convenience snapshot. It is not the source
86
+ of truth when it differs from GitHub.
87
+
88
+ ## Drift Prevention
89
+
90
+ Avoid maintaining two authoritative Issue bodies.
91
+
92
+ When GitHub is configured as the source of truth:
93
+
94
+ - prefer storing URLs, numbers, labels, and audit linkage locally
95
+ - summarize only the minimum context needed for planning
96
+ - do not rewrite local linkage just because a remote Issue body changes unless
97
+ the linkage itself changed
98
+ - treat comments, labels, closures, and body edits as gh operations with their
99
+ own risk tier in `references/gh-operation-governance.md`
100
+
101
+ When local mode is used, local issue artifacts are normal repo artifacts and
102
+ should follow the same commit, branch, and PR governance as other OW planning
103
+ contracts.
104
+
105
+ ## Relationship To Candidate Queues
106
+
107
+ `decompose-to-changes` may use Issues as planning input. The resulting
108
+ `CANDIDATE_CHANGES.yaml` should reference the Issue source in `source.refs` and
109
+ should keep the queue as the feat boundary.
110
+
111
+ `select-change` should not select an Issue directly. It should select a
112
+ candidate from a queue that may reference one or more Issues.
113
+
114
+ Cross-queue analysis may use Issue linkage as one signal, but it should report
115
+ the target `plan_id` and `candidate_id` rather than an Issue alone.