specweave 0.22.12 → 0.22.14

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 (188) hide show
  1. package/.claude-plugin/README.md +2 -2
  2. package/CLAUDE.md +269 -51
  3. package/README.md +33 -10
  4. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +1 -1
  5. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  6. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  7. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  9. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +4 -1
  10. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  11. package/dist/plugins/specweave-github/lib/github-spec-sync.d.ts +1 -1
  12. package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  13. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +9 -0
  14. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +1 -1
  15. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +10 -1
  16. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
  17. package/dist/plugins/specweave-github/lib/progress-comment-builder.js +2 -2
  18. package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -1
  19. package/dist/plugins/specweave-github/lib/types.d.ts +1 -1
  20. package/dist/src/cli/commands/init.d.ts.map +1 -1
  21. package/dist/src/cli/commands/init.js +313 -1
  22. package/dist/src/cli/commands/init.js.map +1 -1
  23. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  24. package/dist/src/cli/helpers/issue-tracker/index.js +41 -24
  25. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  26. package/dist/src/config/import-config.d.ts +69 -0
  27. package/dist/src/config/import-config.d.ts.map +1 -0
  28. package/dist/src/config/import-config.js +136 -0
  29. package/dist/src/config/import-config.js.map +1 -0
  30. package/dist/src/config/types.d.ts +10 -10
  31. package/dist/src/core/living-docs/living-docs-sync.d.ts +2 -0
  32. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  33. package/dist/src/core/living-docs/living-docs-sync.js +10 -1
  34. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  35. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +2 -2
  36. package/dist/src/core/living-docs/task-project-specific-generator.js +2 -2
  37. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +2 -2
  38. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  39. package/dist/src/core/repo-structure/prompt-consolidator.js +3 -15
  40. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  41. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +1 -1
  42. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  43. package/dist/src/core/repo-structure/repo-structure-manager.js +3 -6
  44. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  45. package/dist/src/core/spec-content-sync.d.ts +4 -1
  46. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  47. package/dist/src/core/spec-content-sync.js +139 -4
  48. package/dist/src/core/spec-content-sync.js.map +1 -1
  49. package/dist/src/core/spec-task-mapper.d.ts.map +1 -1
  50. package/dist/src/core/spec-task-mapper.js +9 -8
  51. package/dist/src/core/spec-task-mapper.js.map +1 -1
  52. package/dist/src/core/status-line-validator.d.ts +63 -0
  53. package/dist/src/core/status-line-validator.d.ts.map +1 -0
  54. package/dist/src/core/status-line-validator.js +253 -0
  55. package/dist/src/core/status-line-validator.js.map +1 -0
  56. package/dist/src/core/sync/bidirectional-engine.d.ts +10 -1
  57. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  58. package/dist/src/core/sync/bidirectional-engine.js +10 -1
  59. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  60. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  61. package/dist/src/core/sync/profile-manager.js +3 -0
  62. package/dist/src/core/sync/profile-manager.js.map +1 -1
  63. package/dist/src/core/sync/project-context.d.ts.map +1 -1
  64. package/dist/src/core/sync/project-context.js +3 -0
  65. package/dist/src/core/sync/project-context.js.map +1 -1
  66. package/dist/src/core/sync/status-sync-engine.d.ts +1 -1
  67. package/dist/src/core/sync/status-sync-engine.js +1 -1
  68. package/dist/src/core/types/origin-metadata.d.ts +153 -0
  69. package/dist/src/core/types/origin-metadata.d.ts.map +1 -0
  70. package/dist/src/core/types/origin-metadata.js +166 -0
  71. package/dist/src/core/types/origin-metadata.js.map +1 -0
  72. package/dist/src/core/types/sync-profile.d.ts +8 -2
  73. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  74. package/dist/src/core/types/sync-profile.js.map +1 -1
  75. package/dist/src/core/types/sync-settings.d.ts +73 -0
  76. package/dist/src/core/types/sync-settings.d.ts.map +1 -0
  77. package/dist/src/core/types/sync-settings.js +90 -0
  78. package/dist/src/core/types/sync-settings.js.map +1 -0
  79. package/dist/src/core/utils/permission-checker.d.ts +100 -0
  80. package/dist/src/core/utils/permission-checker.d.ts.map +1 -0
  81. package/dist/src/core/utils/permission-checker.js +166 -0
  82. package/dist/src/core/utils/permission-checker.js.map +1 -0
  83. package/dist/src/generators/spec/spec-parser.js +3 -3
  84. package/dist/src/generators/spec/spec-parser.js.map +1 -1
  85. package/dist/src/generators/spec/task-parser.js +4 -4
  86. package/dist/src/generators/spec/task-parser.js.map +1 -1
  87. package/dist/src/id-generators/task-id-generator.d.ts +96 -0
  88. package/dist/src/id-generators/task-id-generator.d.ts.map +1 -0
  89. package/dist/src/id-generators/task-id-generator.js +143 -0
  90. package/dist/src/id-generators/task-id-generator.js.map +1 -0
  91. package/dist/src/id-generators/us-id-generator.d.ts +96 -0
  92. package/dist/src/id-generators/us-id-generator.d.ts.map +1 -0
  93. package/dist/src/id-generators/us-id-generator.js +143 -0
  94. package/dist/src/id-generators/us-id-generator.js.map +1 -0
  95. package/dist/src/importers/ado-importer.d.ts +43 -0
  96. package/dist/src/importers/ado-importer.d.ts.map +1 -0
  97. package/dist/src/importers/ado-importer.js +234 -0
  98. package/dist/src/importers/ado-importer.js.map +1 -0
  99. package/dist/src/importers/external-importer.d.ts +96 -0
  100. package/dist/src/importers/external-importer.d.ts.map +1 -0
  101. package/dist/src/importers/external-importer.js +13 -0
  102. package/dist/src/importers/external-importer.js.map +1 -0
  103. package/dist/src/importers/github-importer.d.ts +37 -0
  104. package/dist/src/importers/github-importer.d.ts.map +1 -0
  105. package/dist/src/importers/github-importer.js +161 -0
  106. package/dist/src/importers/github-importer.js.map +1 -0
  107. package/dist/src/importers/import-coordinator.d.ts +90 -0
  108. package/dist/src/importers/import-coordinator.d.ts.map +1 -0
  109. package/dist/src/importers/import-coordinator.js +182 -0
  110. package/dist/src/importers/import-coordinator.js.map +1 -0
  111. package/dist/src/importers/item-converter.d.ts +91 -0
  112. package/dist/src/importers/item-converter.d.ts.map +1 -0
  113. package/dist/src/importers/item-converter.js +221 -0
  114. package/dist/src/importers/item-converter.js.map +1 -0
  115. package/dist/src/importers/jira-importer.d.ts +42 -0
  116. package/dist/src/importers/jira-importer.d.ts.map +1 -0
  117. package/dist/src/importers/jira-importer.js +221 -0
  118. package/dist/src/importers/jira-importer.js.map +1 -0
  119. package/dist/src/init/repo/types.d.ts +2 -2
  120. package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
  121. package/dist/src/integrations/jira/jira-mapper.js +1 -1
  122. package/dist/src/living-docs/fs-id-allocator.d.ts +149 -0
  123. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -0
  124. package/dist/src/living-docs/fs-id-allocator.js +325 -0
  125. package/dist/src/living-docs/fs-id-allocator.js.map +1 -0
  126. package/dist/src/living-docs/id-registry.d.ts +124 -0
  127. package/dist/src/living-docs/id-registry.d.ts.map +1 -0
  128. package/dist/src/living-docs/id-registry.js +230 -0
  129. package/dist/src/living-docs/id-registry.js.map +1 -0
  130. package/dist/src/progress/us-progress-tracker.d.ts +68 -0
  131. package/dist/src/progress/us-progress-tracker.d.ts.map +1 -0
  132. package/dist/src/progress/us-progress-tracker.js +120 -0
  133. package/dist/src/progress/us-progress-tracker.js.map +1 -0
  134. package/package.json +2 -2
  135. package/plugins/specweave/.claude-plugin/plugin.json +16 -2
  136. package/plugins/specweave/agents/architect/AGENT.md +11 -2
  137. package/plugins/specweave/agents/test-aware-planner/AGENT.md +81 -25
  138. package/plugins/specweave/commands/specweave-import-docs.md +278 -88
  139. package/plugins/specweave/commands/specweave-progress.md +45 -97
  140. package/plugins/specweave/hooks/post-increment-completion.sh +168 -26
  141. package/plugins/specweave/hooks/post-increment-planning.sh +148 -4
  142. package/plugins/specweave/hooks/post-task-completion.sh +64 -4
  143. package/plugins/specweave/lib/hooks/sync-cache.js +294 -0
  144. package/plugins/specweave/lib/hooks/sync-living-docs.js +32 -1
  145. package/plugins/specweave/lib/hooks/sync-us-tasks.js +23 -13
  146. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  147. package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
  148. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +1 -1
  149. package/plugins/specweave-backend/.claude-plugin/plugin.json +1 -1
  150. package/plugins/specweave-confluent/.claude-plugin/plugin.json +1 -1
  151. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +1 -1
  152. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  153. package/plugins/specweave-docs/.claude-plugin/plugin.json +1 -1
  154. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  155. package/plugins/specweave-figma/.claude-plugin/plugin.json +1 -1
  156. package/plugins/specweave-frontend/.claude-plugin/plugin.json +1 -1
  157. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  158. package/plugins/specweave-github/hooks/post-task-completion.sh +37 -22
  159. package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
  160. package/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  161. package/plugins/specweave-github/lib/enhanced-github-sync.ts +1 -1
  162. package/plugins/specweave-github/lib/github-spec-content-sync.js +2 -1
  163. package/plugins/specweave-github/lib/github-spec-content-sync.ts +4 -1
  164. package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  165. package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
  166. package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  167. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +10 -1
  168. package/plugins/specweave-github/lib/progress-comment-builder.js +1 -1
  169. package/plugins/specweave-github/lib/progress-comment-builder.ts +2 -2
  170. package/plugins/specweave-github/lib/types.ts +1 -1
  171. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  172. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  173. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  174. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  175. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +1 -1
  176. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  177. package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -1
  178. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  179. package/plugins/specweave-payments/.claude-plugin/plugin.json +1 -1
  180. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  181. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +252 -0
  182. package/plugins/specweave-testing/.claude-plugin/plugin.json +1 -1
  183. package/plugins/specweave-tooling/.claude-plugin/plugin.json +1 -1
  184. package/plugins/specweave-ui/.claude-plugin/plugin.json +1 -1
  185. package/src/templates/.env.example +5 -0
  186. package/src/templates/config-permissions-guide.md +413 -0
  187. package/src/templates/config.json.template +68 -0
  188. package/src/templates/tasks.md.template +180 -201
@@ -0,0 +1,413 @@
1
+ # SpecWeave Config.json - External Tool Permissions Guide
2
+
3
+ **Version**: 0.24.0+
4
+ **Location**: `.specweave/config.json`
5
+
6
+ ---
7
+
8
+ ## Three-Permission Architecture
9
+
10
+ SpecWeave uses **3 independent permission flags** to control what it can modify in external tools (GitHub, JIRA, Azure DevOps). All permissions default to **false** for safety (explicit opt-in required).
11
+
12
+ ---
13
+
14
+ ## The 3 Permission Settings
15
+
16
+ ### Q1: `canUpsertInternalItems`
17
+
18
+ **Question**: Can SpecWeave CREATE and UPDATE work items it created?
19
+
20
+ **What it controls**:
21
+ - **UPSERT** = CREATE initially + UPDATE as work progresses
22
+ - Controls: Title, Description, Acceptance Criteria, Tasks
23
+ - Scope: INTERNAL items (created from SpecWeave increments)
24
+
25
+ **Flow**:
26
+ ```
27
+ increment → living spec → CREATE external item → UPDATE on task completion
28
+ ```
29
+
30
+ **If `false`** (default):
31
+ - Stops before external item creation
32
+ - Local-only workflow (no external tool integration)
33
+
34
+ **If `true`**:
35
+ - Creates external items (GitHub issues, JIRA stories, ADO work items)
36
+ - Updates them as work progresses
37
+ - Enforces format: `[FS-XXX][US-YYY] Title`
38
+
39
+ **Example config**:
40
+ ```json
41
+ {
42
+ "sync": {
43
+ "settings": {
44
+ "canUpsertInternalItems": true
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ ### Q2: `canUpdateExternalItems`
53
+
54
+ **Question**: Can SpecWeave UPDATE work items created externally?
55
+
56
+ **What it controls**:
57
+ - **UPDATE** = Full content updates (title, description, ACs, tasks, comments)
58
+ - Controls: Content updates of EXTERNAL items
59
+ - Scope: Items created outside SpecWeave (imported from GitHub/JIRA/ADO)
60
+
61
+ **Flow**:
62
+ ```
63
+ increment progress → living spec → UPDATE external tool (full sync)
64
+ ```
65
+
66
+ **If `false`** (default):
67
+ - External items remain read-only snapshots
68
+ - No sync back to external tool
69
+
70
+ **If `true`**:
71
+ - Updates title (enforces `[FS-XXX][US-YYY]` format)
72
+ - Updates description (syncs from living spec)
73
+ - Updates acceptance criteria
74
+ - Updates tasks/subtasks
75
+ - Adds progress comments
76
+
77
+ **Example config**:
78
+ ```json
79
+ {
80
+ "sync": {
81
+ "settings": {
82
+ "canUpdateExternalItems": true
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ### Q3: `canUpdateStatus`
91
+
92
+ **Question**: Can SpecWeave UPDATE status of work items?
93
+
94
+ **What it controls**:
95
+ - **STATUS** = Status field ONLY
96
+ - Controls: Status updates after all ACs/tasks complete
97
+ - Scope: BOTH internal AND external items
98
+
99
+ **Flow**:
100
+ ```
101
+ Both flows (status updates for all items)
102
+ ```
103
+
104
+ **If `false`** (default):
105
+ - No status updates regardless of item origin
106
+ - Manual status management in external tool
107
+
108
+ **If `true`**:
109
+ - Updates status automatically when:
110
+ - All acceptance criteria are checked
111
+ - All tasks are completed
112
+ - Increment is marked "done"
113
+
114
+ **Example config**:
115
+ ```json
116
+ {
117
+ "sync": {
118
+ "settings": {
119
+ "canUpdateStatus": true
120
+ }
121
+ }
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Common Scenarios
128
+
129
+ ### Scenario 1: Solo Dev, Local Only
130
+
131
+ **Use case**: Work locally, no external tool integration
132
+
133
+ ```json
134
+ {
135
+ "sync": {
136
+ "settings": {
137
+ "canUpsertInternalItems": false,
138
+ "canUpdateExternalItems": false,
139
+ "canUpdateStatus": false
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ **Result**:
146
+ - Everything stays in SpecWeave
147
+ - No external items created
148
+ - No sync
149
+ - Pure local workflow
150
+
151
+ ---
152
+
153
+ ### Scenario 2: Solo Dev, Want Visibility
154
+
155
+ **Use case**: Create GitHub issues for visibility, but manage status manually
156
+
157
+ ```json
158
+ {
159
+ "sync": {
160
+ "settings": {
161
+ "canUpsertInternalItems": true,
162
+ "canUpdateExternalItems": false,
163
+ "canUpdateStatus": false
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ **Result**:
170
+ - Internal items → GitHub issues created + updated as work progresses
171
+ - Task completed in SpecWeave → issue updated with new content + comment posted
172
+ - External items (imported) → read-only snapshots (no sync back)
173
+ - Status updates → manual in GitHub
174
+
175
+ ---
176
+
177
+ ### Scenario 3: Team Collaboration (Full Sync)
178
+
179
+ **Use case**: Full bidirectional sync with external team
180
+
181
+ ```json
182
+ {
183
+ "sync": {
184
+ "settings": {
185
+ "canUpsertInternalItems": true,
186
+ "canUpdateExternalItems": true,
187
+ "canUpdateStatus": true
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ **Result**:
194
+ - Internal items → GitHub issues created + updated continuously
195
+ - External items → SpecWeave can update via full content sync
196
+ - Status updates → synced to external tool automatically (both internal & external)
197
+
198
+ ---
199
+
200
+ ### Scenario 4: Read-Only External, Create Internal
201
+
202
+ **Use case**: Import external items for context, create new items for internal work
203
+
204
+ ```json
205
+ {
206
+ "sync": {
207
+ "settings": {
208
+ "canUpsertInternalItems": true,
209
+ "canUpdateExternalItems": false,
210
+ "canUpdateStatus": true
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ **Result**:
217
+ - Internal items → GitHub issues created + status updated automatically
218
+ - External items → read-only snapshots (no updates)
219
+ - Status updates → only for internal items
220
+
221
+ ---
222
+
223
+ ## Permission Matrix
224
+
225
+ | Origin | Q1: UPSERT | Q2: UPDATE | Q3: STATUS | External Created? | Title Update | Description Update | Status Update | Comment Updates |
226
+ |--------|-----------|------------|------------|-------------------|--------------|-------------------|---------------|-----------------|
227
+ | **Internal** | ✅ true | - | ✅ true | ✅ Created + Updated | ✅ Enforce `[FS-XXX][US-YYY]` | ✅ Update with ACs/Tasks | ✅ Yes | ✅ Yes |
228
+ | **Internal** | ✅ true | - | ❌ false | ✅ Created + Updated | ✅ Enforce format | ✅ Update with ACs/Tasks | ❌ No | ✅ Yes |
229
+ | **Internal** | ❌ false | - | - | ❌ **NO external item** | N/A (local only) | N/A (local only) | N/A | N/A |
230
+ | **External** | - | ✅ true | ✅ true | 📥 Pre-existing | ✅ Update (enforce format) | ✅ Update with ACs/Tasks | ✅ Yes | ✅ Yes |
231
+ | **External** | - | ✅ true | ❌ false | 📥 Pre-existing | ✅ Update (enforce format) | ✅ Update with ACs/Tasks | ❌ No | ✅ Yes |
232
+ | **External** | - | ❌ false | ✅ true | 📥 Pre-existing | ❌ NO sync | ❌ NO sync | ✅ Yes (via comment) | ✅ Yes (status comment) |
233
+ | **External** | - | ❌ false | ❌ false | 📥 Pre-existing | ❌ NO sync | ❌ NO sync | ❌ No | ❌ No |
234
+
235
+ ---
236
+
237
+ ## Changing Permissions
238
+
239
+ ### During `specweave init`
240
+
241
+ Permissions are configured during project initialization:
242
+
243
+ ```bash
244
+ specweave init .
245
+ ```
246
+
247
+ You'll be prompted:
248
+ ```
249
+ ⚙️ External Tool Sync Permissions
250
+ Control what SpecWeave can modify in external tools (GitHub, JIRA, ADO)
251
+
252
+ ? Q1: Can SpecWeave CREATE and UPDATE work items it created? (UPSERT = CREATE initially + UPDATE on progress) (y/N)
253
+ ? Q2: Can SpecWeave UPDATE work items created externally? (Full content: title, description, ACs, tasks) (y/N)
254
+ ? Q3: Can SpecWeave UPDATE status of work items? (Both internal & external items) (y/N)
255
+ ```
256
+
257
+ ### Manually in config.json
258
+
259
+ Edit `.specweave/config.json`:
260
+
261
+ ```json
262
+ {
263
+ "sync": {
264
+ "settings": {
265
+ "canUpsertInternalItems": true,
266
+ "canUpdateExternalItems": true,
267
+ "canUpdateStatus": true
268
+ }
269
+ }
270
+ }
271
+ ```
272
+
273
+ Changes take effect immediately (no restart required).
274
+
275
+ ---
276
+
277
+ ## Migration from Old Format
278
+
279
+ ### Old Format (v0.23.0 and earlier)
280
+
281
+ ```json
282
+ {
283
+ "sync": {
284
+ "settings": {
285
+ "syncDirection": "bidirectional"
286
+ }
287
+ }
288
+ }
289
+ ```
290
+
291
+ ### New Format (v0.24.0+)
292
+
293
+ ```json
294
+ {
295
+ "sync": {
296
+ "settings": {
297
+ "canUpsertInternalItems": true,
298
+ "canUpdateExternalItems": true,
299
+ "canUpdateStatus": true
300
+ }
301
+ }
302
+ }
303
+ ```
304
+
305
+ ### Automatic Migration
306
+
307
+ If `syncDirection: "bidirectional"` is found:
308
+ - All 3 permissions set to `true`
309
+ - Old field removed
310
+ - Warning logged to review permissions
311
+
312
+ If `syncDirection: "one-way"` or missing:
313
+ - All 3 permissions set to `false` (safer default)
314
+
315
+ ---
316
+
317
+ ## Troubleshooting
318
+
319
+ ### "Permission denied: canUpsertInternalItems=false"
320
+
321
+ **Solution**: Enable in `.specweave/config.json`:
322
+ ```json
323
+ {
324
+ "sync": {
325
+ "settings": {
326
+ "canUpsertInternalItems": true
327
+ }
328
+ }
329
+ }
330
+ ```
331
+
332
+ ### External items not updating
333
+
334
+ **Check**: `canUpdateExternalItems` permission
335
+ ```json
336
+ {
337
+ "sync": {
338
+ "settings": {
339
+ "canUpdateExternalItems": true
340
+ }
341
+ }
342
+ }
343
+ ```
344
+
345
+ ### Status not syncing
346
+
347
+ **Check**: `canUpdateStatus` permission
348
+ ```json
349
+ {
350
+ "sync": {
351
+ "settings": {
352
+ "canUpdateStatus": true
353
+ }
354
+ }
355
+ }
356
+ ```
357
+
358
+ ---
359
+
360
+ ## Security Considerations
361
+
362
+ 1. **Least Privilege**: Start with all permissions `false`, enable only what you need
363
+ 2. **Team Alignment**: Discuss with team before enabling `canUpdateExternalItems`
364
+ 3. **Review Changes**: Monitor external tool changes when first enabling permissions
365
+ 4. **Version Control**: config.json is version-controlled, team sees permission changes
366
+
367
+ ---
368
+
369
+ ## Related Documentation
370
+
371
+ - **Architecture**: `.specweave/increments/0047-us-task-linkage/reports/THREE-PERMISSION-ARCHITECTURE-CHANGES.md`
372
+ - **Specification**: `.specweave/increments/0047-us-task-linkage/spec.md`
373
+ - **Implementation Plan**: `.specweave/increments/0047-us-task-linkage/plan.md`
374
+ - **User Guide**: `.specweave/docs/public/guides/external-tools.md`
375
+
376
+ ---
377
+
378
+ ## FAQ
379
+
380
+ ### Q: What's the difference between `canUpsertInternalItems` and `canUpdateExternalItems`?
381
+
382
+ **A**:
383
+ - `canUpsertInternalItems`: Controls items SpecWeave creates (full control)
384
+ - `canUpdateExternalItems`: Controls items created externally (preserves origin, but allows updates)
385
+
386
+ ### Q: Can I enable only status updates?
387
+
388
+ **A**: Yes! Set only `canUpdateStatus: true`, others `false`:
389
+ ```json
390
+ {
391
+ "sync": {
392
+ "settings": {
393
+ "canUpsertInternalItems": false,
394
+ "canUpdateExternalItems": false,
395
+ "canUpdateStatus": true
396
+ }
397
+ }
398
+ }
399
+ ```
400
+
401
+ ### Q: What happens if I change permissions mid-project?
402
+
403
+ **A**: Changes take effect immediately. Existing items unaffected. Future operations respect new permissions.
404
+
405
+ ---
406
+
407
+ ## Changelog
408
+
409
+ **v0.24.0** (2025-11-20):
410
+ - Introduced three-permission architecture
411
+ - Replaced `syncDirection` with `canUpsertInternalItems`, `canUpdateExternalItems`, `canUpdateStatus`
412
+ - All permissions default to `false` (explicit opt-in)
413
+ - Automatic migration from old format
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schema": "https://spec-weave.com/schemas/config.json",
3
+ "version": "0.24.0",
4
+
5
+ "sync": {
6
+ "enabled": true,
7
+ "provider": "github",
8
+ "includeStatus": true,
9
+ "autoApplyLabels": true,
10
+ "activeProfile": "main",
11
+
12
+ "settings": {
13
+ "canUpsertInternalItems": false,
14
+ "canUpdateExternalItems": false,
15
+ "canUpdateStatus": false
16
+ },
17
+
18
+ "profiles": {
19
+ "main": {
20
+ "provider": "github",
21
+ "displayName": "Main GitHub Profile",
22
+ "description": "Primary GitHub repository",
23
+ "config": {
24
+ "owner": "your-org",
25
+ "repo": "your-repo"
26
+ },
27
+ "timeRange": {
28
+ "default": "1M",
29
+ "max": "6M"
30
+ },
31
+ "rateLimits": {
32
+ "maxItemsPerSync": 500,
33
+ "warnThreshold": 100
34
+ }
35
+ }
36
+ },
37
+
38
+ "statusSync": {
39
+ "enabled": true,
40
+ "autoSync": true,
41
+ "promptUser": false,
42
+ "conflictResolution": "external-wins",
43
+ "mappings": {
44
+ "github": {
45
+ "planning": "Planning",
46
+ "in-progress": "In Progress",
47
+ "completed": "Done",
48
+ "paused": "On Hold",
49
+ "abandoned": "Cancelled"
50
+ },
51
+ "jira": {
52
+ "planning": "To Do",
53
+ "in-progress": "In Progress",
54
+ "completed": "Done",
55
+ "paused": "On Hold",
56
+ "abandoned": "Cancelled"
57
+ },
58
+ "ado": {
59
+ "planning": "New",
60
+ "in-progress": "Active",
61
+ "completed": "Closed",
62
+ "paused": "On Hold",
63
+ "abandoned": "Removed"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }