specweave 0.28.7 → 0.28.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specweave",
3
- "version": "0.28.7",
3
+ "version": "0.28.9",
4
4
  "description": "Spec-driven development framework for Claude Code. AI-native workflow with living documentation, intelligent agents, and multilingual support (9 languages). Enterprise-grade traceability with permanent specs and temporary increments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -487,6 +487,34 @@ Closing increment 0001-user-authentication...
487
487
 
488
488
  ### Step 5: Post-Closure Sync (AUTOMATIC)
489
489
 
490
+ **CRITICAL**: After increment closes, the following syncs happen AUTOMATICALLY via the `post-increment-completion.sh` hook:
491
+
492
+ #### 0) Sync spec.md Status (ALWAYS - v0.28.8+)
493
+
494
+ **MANDATORY**: Ensures spec.md frontmatter status matches metadata.json.
495
+
496
+ ```
497
+ 🔄 Syncing spec.md status to 'completed'...
498
+ ✅ spec.md status updated: active → completed
499
+ ✅ Status line cache updated
500
+ ```
501
+
502
+ **Why this matters**:
503
+ - Prevents desyncs between metadata.json and spec.md
504
+ - Ensures status line shows correct increment count
505
+ - Maintains source-of-truth discipline
506
+ - No need to manually run `/specweave:sync-status`
507
+
508
+ **What gets synced**:
509
+ 1. spec.md YAML frontmatter `status` field → `completed`
510
+ 2. Status line cache updated via `lib/update-status-line.sh`
511
+
512
+ **If you still see desync after closure**:
513
+ ```bash
514
+ # Manual fix (should rarely be needed)
515
+ /specweave:sync-status --fix
516
+ ```
517
+
490
518
  **CRITICAL**: After increment closes, automatically perform these syncs:
491
519
 
492
520
  #### A) Sync Living Docs to GitHub Project
@@ -117,10 +117,69 @@ Increment \`$INCREMENT_ID\` has been marked as complete.
117
117
  fi
118
118
  fi
119
119
 
120
+ # ============================================================================
121
+ # SYNC SPEC.MD STATUS (CRITICAL - v0.28.8)
122
+ # ============================================================================
123
+ # PROBLEM: metadata.json is updated to "completed" but spec.md frontmatter
124
+ # may still say "active". This causes desyncs that break status line.
125
+ #
126
+ # SOLUTION: Explicitly update spec.md frontmatter to match metadata.json.
127
+ # This ensures source-of-truth discipline is maintained.
128
+ #
129
+ # See: Incident 2025-11-20 - metadata.json="completed" but spec.md="active"
130
+ # See: /specweave:sync-status command for manual recovery
131
+
132
+ SPEC_FILE="$INCREMENT_DIR/spec.md"
133
+
134
+ if [ -f "$SPEC_FILE" ]; then
135
+ echo "🔄 Syncing spec.md status to 'completed'..."
136
+
137
+ # Read current status from spec.md frontmatter
138
+ SPEC_STATUS=$(awk '
139
+ BEGIN { in_frontmatter=0 }
140
+ /^---$/ {
141
+ if (in_frontmatter == 0) {
142
+ in_frontmatter=1; next
143
+ } else {
144
+ exit
145
+ }
146
+ }
147
+ in_frontmatter == 1 && /^status:/ {
148
+ gsub(/^status:[ \t]*/, "");
149
+ gsub(/["'\''']/, "");
150
+ print;
151
+ exit
152
+ }
153
+ ' "$SPEC_FILE" | tr -d '\r\n')
154
+
155
+ if [ "$SPEC_STATUS" != "completed" ]; then
156
+ # Update spec.md frontmatter to "completed"
157
+ # Use sed for atomic in-place update
158
+ if [[ "$(uname)" == "Darwin" ]]; then
159
+ # macOS sed requires different syntax
160
+ sed -i '' 's/^status:.*$/status: completed/' "$SPEC_FILE" 2>/dev/null || {
161
+ echo "⚠️ Failed to update spec.md status (non-blocking)" >&2
162
+ }
163
+ else
164
+ # GNU sed
165
+ sed -i 's/^status:.*$/status: completed/' "$SPEC_FILE" 2>/dev/null || {
166
+ echo "⚠️ Failed to update spec.md status (non-blocking)" >&2
167
+ }
168
+ fi
169
+ echo "✅ spec.md status updated: $SPEC_STATUS → completed"
170
+ else
171
+ echo "✅ spec.md status already 'completed'"
172
+ fi
173
+ else
174
+ echo "⚠️ spec.md not found at $SPEC_FILE" >&2
175
+ fi
176
+
120
177
  # Update status line cache (increment no longer open)
121
178
  HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
122
179
  bash "$HOOK_DIR/lib/update-status-line.sh" 2>/dev/null || true
123
180
 
181
+ echo "✅ Status line cache updated"
182
+
124
183
  # ============================================================================
125
184
  # SYNC LIVING DOCS (NEW in v0.24.0 - Critical Missing Feature)
126
185
  # ============================================================================