specsmd 0.1.47 → 0.1.50

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.
@@ -124,7 +124,7 @@ You are the **Builder Agent** for FIRE (Fast Intent-Run Engineering).
124
124
 
125
125
  ```yaml
126
126
  run:
127
- id: run-001
127
+ id: run-fabriqa-2026-001
128
128
  scope: batch # single | batch | wide
129
129
  work_items:
130
130
  - id: login-endpoint
@@ -159,7 +159,7 @@ You are the **Builder Agent** for FIRE (Fast Intent-Run Engineering).
159
159
  | Create run.md | (handled by init-run.cjs) | ❌ NO direct write |
160
160
  | Update state.yaml | (handled by scripts) | ❌ NO direct edit |
161
161
 
162
- <check if="about to mkdir .specs-fire/runs/run-XXX">
162
+ <check if="about to mkdir .specs-fire/runs/run-<worktree>-XXX">
163
163
  <action>STOP — use init-run.cjs instead</action>
164
164
  </check>
165
165
  <check if="about to edit state.yaml directly">
@@ -42,7 +42,7 @@ Review code written during a run, auto-fix no-brainer issues, and suggest improv
42
42
  - path: src/routes/index.ts
43
43
  changes: Added login route
44
44
 
45
- run_id: run-001
45
+ run_id: run-fabriqa-2026-001
46
46
  intent_id: user-auth
47
47
  ```
48
48
 
@@ -548,8 +548,8 @@ Supports both single-item and multi-item (batch/wide) runs.
548
548
  ```json
549
549
  {
550
550
  "success": true,
551
- "runId": "run-001",
552
- "runPath": "/project/.specs-fire/runs/run-001",
551
+ "runId": "run-fabriqa-2026-001",
552
+ "runPath": "/project/.specs-fire/runs/run-fabriqa-2026-001",
553
553
  "scope": "batch",
554
554
  "workItems": [...],
555
555
  "currentItem": "wi-1"
@@ -561,10 +561,10 @@ Supports both single-item and multi-item (batch/wide) runs.
561
561
  <script name="complete-run.cjs">
562
562
  ```bash
563
563
  # Complete current item (batch runs - moves to next item)
564
- node scripts/complete-run.cjs /project run-001 --complete-item
564
+ node scripts/complete-run.cjs /project run-fabriqa-2026-001 --complete-item
565
565
 
566
566
  # Complete entire run (single runs or final item in batch)
567
- node scripts/complete-run.cjs /project run-001 --complete-run \
567
+ node scripts/complete-run.cjs /project run-fabriqa-2026-001 --complete-run \
568
568
  --files-created='[{"path":"src/new.ts","purpose":"New feature"}]' \
569
569
  --files-modified='[{"path":"src/old.ts","changes":"Added import"}]' \
570
570
  --tests=5 --coverage=85
@@ -574,7 +574,7 @@ Supports both single-item and multi-item (batch/wide) runs.
574
574
  ```json
575
575
  {
576
576
  "success": true,
577
- "runId": "run-001",
577
+ "runId": "run-fabriqa-2026-001",
578
578
  "completedItem": "wi-1",
579
579
  "nextItem": "wi-2",
580
580
  "remainingItems": 1,
@@ -587,7 +587,7 @@ Supports both single-item and multi-item (batch/wide) runs.
587
587
  ```json
588
588
  {
589
589
  "success": true,
590
- "runId": "run-001",
590
+ "runId": "run-fabriqa-2026-001",
591
591
  "scope": "batch",
592
592
  "workItemsCompleted": 2,
593
593
  "completedAt": "2026-01-20T..."
@@ -619,7 +619,7 @@ Supports both single-item and multi-item (batch/wide) runs.
619
619
  After init-run.cjs creates a run:
620
620
 
621
621
  ```
622
- .specs-fire/runs/run-001/
622
+ .specs-fire/runs/run-fabriqa-2026-001/
623
623
  ├── run.md # Created by init-run.cjs, updated by complete-run.cjs
624
624
  ├── plan.md # Created BEFORE implementation (ALL modes - required)
625
625
  ├── test-report.md # Created AFTER tests pass (required)
@@ -58,7 +58,7 @@ Display current run status and progress.
58
58
  <example_output>
59
59
 
60
60
  ```
61
- ## Run Status: run-003
61
+ ## Run Status: run-fabriqa-2026-003
62
62
 
63
63
  **Work Item**: Add session management
64
64
  **Intent**: User Authentication
@@ -103,7 +103,7 @@ You are the **Orchestrator Agent** for FIRE (Fast Intent-Run Engineering).
103
103
  runs:
104
104
  active: [] # List of active runs (supports multiple parallel runs)
105
105
  completed:
106
- - id: run-001
106
+ - id: run-fabriqa-2026-001
107
107
  work_items:
108
108
  - id: login-endpoint
109
109
  intent: user-auth
@@ -639,7 +639,7 @@ Detect inconsistencies and offer interactive resolution.
639
639
 
640
640
  ## Active Runs
641
641
 
642
- - **Run**: run-002 | **Scope**: single
642
+ - **Run**: run-fabriqa-2026-002 | **Scope**: single
643
643
  - **Current Item**: session-management
644
644
  - **Started**: 2026-01-19T10:30:00Z
645
645
 
@@ -657,7 +657,7 @@ Detect inconsistencies and offer interactive resolution.
657
657
 
658
658
  | # | Type | Location | Issue | Suggested Fix |
659
659
  |---|------|----------|-------|---------------|
660
- | 1 | 🟡 | run-002 | Run started 3 days ago, may be stale | Resume or abandon |
660
+ | 1 | 🟡 | run-fabriqa-2026-002 | Run started 3 days ago, may be stale | Resume or abandon |
661
661
  | 2 | 🔵 | login-endpoint | Frontmatter says 'pending' but state says 'completed' | Sync frontmatter |
662
662
  | 3 | 🟡 | analytics-dashboard.md | Work item on disk but not tracked | Add to state.yaml |
663
663
 
@@ -66,7 +66,7 @@ state:
66
66
  - active: "List of currently active runs (supports multiple parallel runs)"
67
67
  - completed: "List of completed runs with id, work_item, intent, completed timestamp"
68
68
  # Each run (active or completed) has:
69
- # - id: "Run ID (e.g., run-001)"
69
+ # - id: "Run ID (e.g., run-fabriqa-2026-001)"
70
70
  # - scope: "single | batch | wide"
71
71
  # - work_items: "List of work items in this run"
72
72
  # - current_item: "Work item currently being executed (active runs only)"
@@ -93,9 +93,9 @@ naming:
93
93
  note: "Kebab-case, action-oriented name"
94
94
 
95
95
  runs:
96
- format: "run-{NNN}/"
97
- example: "run-001/"
98
- note: "Sequential 3-digit number, folder per run"
96
+ format: "run-{worktree}-{NNN}/"
97
+ example: "run-fabriqa-2026-001/"
98
+ note: "Sequential 3-digit number per worktree, folder per run"
99
99
  contents:
100
100
  - "run.md" # Run log (created by init-run.cjs)
101
101
  - "plan.md" # Implementation plan (ALL modes, created BEFORE implementation)
@@ -2308,6 +2308,20 @@ function rowToFileEntry(row) {
2308
2308
  };
2309
2309
  }
2310
2310
 
2311
+ function rowToWorktreeId(row) {
2312
+ if (!row || typeof row.key !== 'string') {
2313
+ return null;
2314
+ }
2315
+
2316
+ const prefix = 'worktree:item:';
2317
+ if (!row.key.startsWith(prefix)) {
2318
+ return null;
2319
+ }
2320
+
2321
+ const worktreeId = row.key.slice(prefix.length).trim();
2322
+ return worktreeId === '' ? null : worktreeId;
2323
+ }
2324
+
2311
2325
  function moveRowSelection(rows, currentIndex, direction) {
2312
2326
  if (!Array.isArray(rows) || rows.length === 0) {
2313
2327
  return 0;
@@ -3093,12 +3107,15 @@ function createDashboardApp(deps) {
3093
3107
  const selectedFocusedRow = getSelectedRow(focusedRows, focusedIndex);
3094
3108
  const selectedFocusedFile = rowToFileEntry(selectedFocusedRow);
3095
3109
 
3096
- const refresh = useCallback(async () => {
3110
+ const refresh = useCallback(async (overrideSelectedWorktreeId = null) => {
3097
3111
  const now = new Date().toISOString();
3112
+ const requestedWorktreeId = typeof overrideSelectedWorktreeId === 'string' && overrideSelectedWorktreeId.trim() !== ''
3113
+ ? overrideSelectedWorktreeId.trim()
3114
+ : selectedWorktreeId;
3098
3115
 
3099
3116
  try {
3100
3117
  const result = await parseSnapshotForActiveFlow(activeFlow, {
3101
- selectedWorktreeId
3118
+ selectedWorktreeId: requestedWorktreeId
3102
3119
  });
3103
3120
 
3104
3121
  if (result?.ok) {
@@ -3149,6 +3166,40 @@ function createDashboardApp(deps) {
3149
3166
  }
3150
3167
  }, [activeFlow, parseSnapshotForActiveFlow, selectedWorktreeId, watchEnabled]);
3151
3168
 
3169
+ const switchToWorktree = useCallback((nextWorktreeId, options = {}) => {
3170
+ const normalizedNextId = typeof nextWorktreeId === 'string' ? nextWorktreeId.trim() : '';
3171
+ if (normalizedNextId === '') {
3172
+ setStatusLine('No worktree selected.');
3173
+ return false;
3174
+ }
3175
+
3176
+ const nextItem = worktreeItems.find((item) => item.id === normalizedNextId);
3177
+ if (!nextItem) {
3178
+ setStatusLine('Selected worktree is no longer available.');
3179
+ return false;
3180
+ }
3181
+
3182
+ if (!nextItem.flowAvailable) {
3183
+ setStatusLine(`Flow is unavailable in worktree: ${getWorktreeDisplayName(nextItem)}`);
3184
+ return false;
3185
+ }
3186
+
3187
+ const changed = normalizedNextId !== selectedWorktreeId;
3188
+ setSelectedWorktreeId(normalizedNextId);
3189
+ setPreviewTarget(null);
3190
+ setPreviewOpen(false);
3191
+ setOverlayPreviewOpen(false);
3192
+ setPreviewScroll(0);
3193
+ setPaneFocus('main');
3194
+
3195
+ if (changed || options.forceRefresh) {
3196
+ setStatusLine(`Switched to worktree: ${getWorktreeDisplayName(nextItem)}`);
3197
+ void refresh(normalizedNextId);
3198
+ }
3199
+
3200
+ return true;
3201
+ }, [refresh, selectedWorktreeId, worktreeItems]);
3202
+
3152
3203
  useInput((input, key) => {
3153
3204
  if ((key.ctrl && input === 'c') || input === 'q') {
3154
3205
  exit();
@@ -3192,20 +3243,8 @@ function createDashboardApp(deps) {
3192
3243
 
3193
3244
  if (key.return || key.enter) {
3194
3245
  const selectedOverlayItem = worktreeItems[clampIndex(worktreeOverlayIndex, worktreeItems.length || 1)];
3195
- if (!selectedOverlayItem) {
3196
- setStatusLine('No worktree selected.');
3197
- setWorktreeOverlayOpen(false);
3198
- return;
3199
- }
3200
- setSelectedWorktreeId(selectedOverlayItem.id);
3246
+ switchToWorktree(selectedOverlayItem?.id || '', { forceRefresh: true });
3201
3247
  setWorktreeOverlayOpen(false);
3202
- setPreviewTarget(null);
3203
- setPreviewOpen(false);
3204
- setOverlayPreviewOpen(false);
3205
- setPreviewScroll(0);
3206
- setPaneFocus('main');
3207
- setStatusLine(`Switched to worktree: ${getWorktreeDisplayName(selectedOverlayItem)}`);
3208
- void refresh();
3209
3248
  return;
3210
3249
  }
3211
3250
 
@@ -3460,6 +3499,15 @@ function createDashboardApp(deps) {
3460
3499
  ...previous,
3461
3500
  [targetSection]: nextIndex
3462
3501
  }));
3502
+
3503
+ if (targetSection === 'worktrees' && worktreeSectionEnabled) {
3504
+ const nextRow = getSelectedRow(targetRows, nextIndex);
3505
+ const nextWorktreeId = rowToWorktreeId(nextRow);
3506
+ if (nextWorktreeId && nextWorktreeId !== selectedWorktreeId) {
3507
+ switchToWorktree(nextWorktreeId);
3508
+ }
3509
+ }
3510
+
3463
3511
  return;
3464
3512
  }
3465
3513
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specsmd",
3
- "version": "0.1.47",
3
+ "version": "0.1.50",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {