sequant 2.6.2 → 2.8.0

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 (62) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +13 -1
  4. package/dist/bin/cli.d.ts +1 -1
  5. package/dist/bin/cli.js +11 -1
  6. package/dist/bin/preflight.d.ts +21 -0
  7. package/dist/bin/preflight.js +45 -0
  8. package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +1 -1
  9. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/force-push.md +34 -0
  10. package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +24 -7
  11. package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +29 -0
  12. package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +100 -2
  13. package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +24 -0
  14. package/dist/marketplace/external_plugins/sequant/skills/qa/references/anti-pattern-detection.md +285 -0
  15. package/dist/marketplace/external_plugins/sequant/skills/qa/references/call-site-review.md +202 -0
  16. package/dist/marketplace/external_plugins/sequant/skills/qa/references/quality-gates.md +287 -0
  17. package/dist/marketplace/external_plugins/sequant/skills/qa/references/test-quality-checklist.md +272 -0
  18. package/dist/marketplace/external_plugins/sequant/skills/qa/references/testing-requirements.md +40 -0
  19. package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +95 -11
  20. package/dist/marketplace/external_plugins/sequant/skills/references/shared/framework-gotchas.md +186 -0
  21. package/dist/marketplace/external_plugins/sequant/skills/release/SKILL.md +661 -0
  22. package/dist/marketplace/external_plugins/sequant/skills/test/references/browser-testing-patterns.md +423 -0
  23. package/dist/marketplace/external_plugins/sequant/skills/upstream/SKILL.md +419 -0
  24. package/dist/src/commands/sync.d.ts +1 -0
  25. package/dist/src/commands/sync.js +56 -1
  26. package/dist/src/commands/update.js +7 -0
  27. package/dist/src/lib/errors.d.ts +85 -0
  28. package/dist/src/lib/errors.js +111 -0
  29. package/dist/src/lib/version-check.d.ts +19 -0
  30. package/dist/src/lib/version-check.js +44 -0
  31. package/dist/src/lib/workflow/batch-executor.js +61 -6
  32. package/dist/src/lib/workflow/drivers/agent-driver.d.ts +17 -0
  33. package/dist/src/lib/workflow/drivers/claude-code.d.ts +22 -0
  34. package/dist/src/lib/workflow/drivers/claude-code.js +111 -7
  35. package/dist/src/lib/workflow/log-writer.d.ts +1 -1
  36. package/dist/src/lib/workflow/phase-executor.d.ts +18 -0
  37. package/dist/src/lib/workflow/phase-executor.js +76 -14
  38. package/dist/src/lib/workflow/run-log-schema.d.ts +3 -0
  39. package/dist/src/lib/workflow/run-log-schema.js +7 -0
  40. package/dist/src/lib/workflow/state-manager.d.ts +1 -0
  41. package/dist/src/lib/workflow/state-manager.js +6 -0
  42. package/dist/src/lib/workflow/state-schema.d.ts +3 -0
  43. package/dist/src/lib/workflow/state-schema.js +7 -0
  44. package/dist/src/lib/workflow/types.d.ts +17 -0
  45. package/dist/src/ui/tui/theme.d.ts +18 -4
  46. package/dist/src/ui/tui/theme.js +18 -4
  47. package/package.json +4 -3
  48. package/templates/skills/_shared/references/force-push.md +34 -0
  49. package/templates/skills/assess/SKILL.md +24 -7
  50. package/templates/skills/exec/SKILL.md +29 -0
  51. package/templates/skills/loop/SKILL.md +100 -2
  52. package/templates/skills/qa/SKILL.md +24 -0
  53. package/templates/skills/qa/references/anti-pattern-detection.md +285 -0
  54. package/templates/skills/qa/references/call-site-review.md +202 -0
  55. package/templates/skills/qa/references/quality-gates.md +287 -0
  56. package/templates/skills/qa/references/test-quality-checklist.md +272 -0
  57. package/templates/skills/qa/references/testing-requirements.md +40 -0
  58. package/templates/skills/qa/scripts/quality-checks.sh +95 -11
  59. package/templates/skills/references/shared/framework-gotchas.md +186 -0
  60. package/templates/skills/release/SKILL.md +661 -0
  61. package/templates/skills/test/references/browser-testing-patterns.md +423 -0
  62. package/templates/skills/upstream/SKILL.md +419 -0
@@ -127,6 +127,9 @@ echo ""
127
127
  # Track cache hits/misses for final report
128
128
  declare -A CACHE_STATUS
129
129
 
130
+ # Track blocking issues
131
+ TAUTOLOGY_BLOCKING=false
132
+
130
133
  # =============================================================================
131
134
  # 1. Type safety check - detect 'any' type usage
132
135
  # =============================================================================
@@ -355,7 +358,76 @@ else
355
358
  fi
356
359
 
357
360
  # =============================================================================
358
- # 10. Shell Script Semantic Checks (unused functions, integration)
361
+ # 10. Test Tautology Detection (AC-1 through AC-5)
362
+ # =============================================================================
363
+ echo ""
364
+ echo "🔬 Running test tautology detection..."
365
+
366
+ # Check for test files in the diff
367
+ test_files_in_diff=$(git diff main...HEAD --name-only | grep -E '\.(test|spec)\.[jt]sx?$' || true)
368
+
369
+ if [[ -z "$test_files_in_diff" ]]; then
370
+ CACHE_STATUS["test-quality"]="SKIP"
371
+ echo " ⏭️ No test files in diff, skipping tautology check"
372
+ else
373
+ if cache_check "test-quality"; then
374
+ CACHE_STATUS["test-quality"]="HIT"
375
+ cached_result=$(cache_get "test-quality")
376
+ tautology_passed=$(echo "$cached_result" | grep -o '"passed":\s*[^,}]*' | cut -d: -f2 | tr -d ' ')
377
+ tautology_message=$(echo "$cached_result" | grep -o '"message":\s*"[^"]*"' | cut -d'"' -f4)
378
+
379
+ if [[ "$tautology_passed" == "true" ]]; then
380
+ echo " ✅ Test tautology: $tautology_message (cached)"
381
+ else
382
+ echo " ⚠️ Test tautology: $tautology_message (cached)"
383
+ fi
384
+ else
385
+ CACHE_STATUS["test-quality"]="MISS"
386
+
387
+ # Check if tautology detector script exists
388
+ TAUTOLOGY_CLI=""
389
+ if [[ -f "$SCRIPT_DIR/../../../scripts/qa/tautology-detector-cli.ts" ]]; then
390
+ TAUTOLOGY_CLI="$SCRIPT_DIR/../../../scripts/qa/tautology-detector-cli.ts"
391
+ elif [[ -f "scripts/qa/tautology-detector-cli.ts" ]]; then
392
+ TAUTOLOGY_CLI="scripts/qa/tautology-detector-cli.ts"
393
+ fi
394
+
395
+ if [[ -n "$TAUTOLOGY_CLI" ]] && command -v npx &> /dev/null; then
396
+ tautology_output=$(npx tsx "$TAUTOLOGY_CLI" --json 2>&1) || tautology_exit=$?
397
+
398
+ if [[ -z "$tautology_exit" ]]; then
399
+ tautology_exit=0
400
+ fi
401
+
402
+ # Parse JSON output
403
+ tautology_status=$(echo "$tautology_output" | grep -o '"status":"[^"]*"' | cut -d'"' -f4 || echo "none")
404
+ total_tests=$(echo "$tautology_output" | grep -o '"totalTests":[0-9]*' | cut -d: -f2 || echo "0")
405
+ total_tautological=$(echo "$tautology_output" | grep -o '"totalTautological":[0-9]*' | cut -d: -f2 || echo "0")
406
+
407
+ if [[ "$tautology_status" == "skip" ]]; then
408
+ echo " ⏭️ No test blocks found in changed files"
409
+ cache_set "test-quality" true "No test blocks found" "{\"totalTests\":0,\"tautological\":0}"
410
+ elif [[ "$tautology_status" == "blocking" ]]; then
411
+ echo " ❌ BLOCKER: $total_tautological/$total_tests test blocks are tautological (>50%)"
412
+ echo " Tautological tests don't call production code and provide zero regression protection."
413
+ cache_set "test-quality" false "$total_tautological/$total_tests tests tautological (>50%)" "{\"totalTests\":$total_tests,\"tautological\":$total_tautological}"
414
+ TAUTOLOGY_BLOCKING=true
415
+ elif [[ "$tautology_status" == "warning" ]]; then
416
+ echo " ⚠️ WARNING: $total_tautological/$total_tests test blocks are tautological"
417
+ cache_set "test-quality" true "$total_tautological/$total_tests tests tautological" "{\"totalTests\":$total_tests,\"tautological\":$total_tautological}"
418
+ else
419
+ echo " ✅ Test tautology: All tests call production code"
420
+ cache_set "test-quality" true "All tests call production code" "{\"totalTests\":$total_tests,\"tautological\":0}"
421
+ fi
422
+ else
423
+ echo " ⚠️ Test tautology detector not available, skipping..."
424
+ CACHE_STATUS["test-quality"]="SKIP"
425
+ fi
426
+ fi
427
+ fi
428
+
429
+ # =============================================================================
430
+ # 11. Shell Script Semantic Checks (unused functions, integration)
359
431
  # =============================================================================
360
432
  echo ""
361
433
  echo "🔍 Checking shell script semantics..."
@@ -385,8 +457,7 @@ else
385
457
  fi
386
458
 
387
459
  # =============================================================================
388
- # =============================================================================
389
- # 11.5. Skill Sync Check (when skill files modified)
460
+ # 12. Skill Sync Check (when skill files modified)
390
461
  # =============================================================================
391
462
  echo ""
392
463
  skill_files_changed=$(git diff main...HEAD --name-only | grep -E '^\.(claude/skills|skills|templates/skills)/' || true)
@@ -431,7 +502,7 @@ else
431
502
  fi
432
503
 
433
504
  # =============================================================================
434
- # 12. Build Verification (cacheable - expensive operation)
505
+ # 13. Build Verification (cacheable - expensive operation)
435
506
  # =============================================================================
436
507
 
437
508
  verify_build_against_main() {
@@ -613,7 +684,7 @@ echo "=========================================="
613
684
  echo ""
614
685
  echo "| Check | Cache Status |"
615
686
  echo "|-------|--------------|"
616
- for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "build"; do
687
+ for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "test-quality" "build"; do
617
688
  status="${CACHE_STATUS[$check]:-MISS}"
618
689
  if [[ "$status" == "HIT" ]]; then
619
690
  echo "| $check | ✅ HIT |"
@@ -629,7 +700,7 @@ echo ""
629
700
  hit_count=0
630
701
  miss_count=0
631
702
  skip_count=0
632
- for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "build"; do
703
+ for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "test-quality" "build"; do
633
704
  status="${CACHE_STATUS[$check]:-MISS}"
634
705
  if [[ "$status" == "HIT" ]]; then
635
706
  ((hit_count++))
@@ -646,15 +717,17 @@ if [[ $hit_count -gt 0 ]]; then
646
717
  fi
647
718
  echo ""
648
719
 
649
- # Write structured cache metrics JSON for sequant observability (AC-7)
650
- # This file is read by run.ts to populate PhaseLog.cacheMetrics
720
+ # Write structured cache metrics JSON for sequant observability (#278/AC-7)
721
+ # This file is read by worktree-manager.ts to populate PhaseLog.cacheMetrics
722
+ # (surfaced via `sequant logs`). Written before the blocking exit logic below so
723
+ # metrics are always emitted, even when a check blocks.
651
724
  CACHE_METRICS_DIR=".sequant/.cache/qa"
652
725
  mkdir -p "$CACHE_METRICS_DIR"
653
726
 
654
727
  # Build JSON with per-check status
655
728
  CACHE_JSON="{\"hits\":$hit_count,\"misses\":$miss_count,\"skipped\":$skip_count,\"checks\":{"
656
729
  first=true
657
- for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "build"; do
730
+ for check in "type-safety" "deleted-tests" "scope" "size" "security" "semgrep" "test-quality" "build"; do
658
731
  $first || CACHE_JSON+=","
659
732
  CACHE_JSON+="\"$check\":\"${CACHE_STATUS[$check]:-MISS}\""
660
733
  first=false
@@ -664,5 +737,16 @@ echo "$CACHE_JSON" > "$CACHE_METRICS_DIR/cache-metrics.json"
664
737
 
665
738
  echo "✅ Quality checks complete"
666
739
 
667
- # Exit with build verification result if it indicates a problem
668
- exit $build_verification_result
740
+ # Exit with appropriate code based on blocking issues
741
+ # Priority: build verification > tautology blocking
742
+ if [[ $build_verification_result -ne 0 ]]; then
743
+ exit $build_verification_result
744
+ fi
745
+
746
+ if [[ "$TAUTOLOGY_BLOCKING" == "true" ]]; then
747
+ echo ""
748
+ echo "❌ BLOCKED: >50% of test blocks are tautological (AC-4 violation)"
749
+ exit 1
750
+ fi
751
+
752
+ exit 0
@@ -0,0 +1,186 @@
1
+ # Framework Gotchas
2
+
3
+ Common framework-specific issues encountered in this project. Check this reference when encountering unexpected runtime errors or build failures.
4
+
5
+ ## AG Grid (v35+)
6
+
7
+ ### Module Registration Required
8
+
9
+ AG Grid v35 changed to explicit module registration. If you see errors like "Module not registered" or grid features not working:
10
+
11
+ ```typescript
12
+ import { ModuleRegistry } from 'ag-grid-community';
13
+ import { ClientSideRowModelModule } from 'ag-grid-community';
14
+
15
+ // Register before using AG Grid components
16
+ ModuleRegistry.registerModules([ClientSideRowModelModule]);
17
+ ```
18
+
19
+ **Common modules to register:**
20
+ - `ClientSideRowModelModule` - Basic row model
21
+ - `CsvExportModule` - CSV export functionality
22
+ - `InfiniteRowModelModule` - Infinite scrolling
23
+
24
+ **Docs:** [AG Grid v35 Migration Guide](https://www.ag-grid.com/javascript-data-grid/modules/)
25
+
26
+ ### CSS Import Changes
27
+
28
+ Styles are now in a separate package. Update imports:
29
+
30
+ ```typescript
31
+ // Before v35
32
+ import 'ag-grid-community/styles/ag-grid.css';
33
+ import 'ag-grid-community/styles/ag-theme-alpine.css';
34
+
35
+ // v35+
36
+ import 'ag-grid-community/styles/ag-grid.css';
37
+ import 'ag-grid-community/styles/ag-theme-quartz.css'; // New default theme
38
+ ```
39
+
40
+ ---
41
+
42
+ ## React 19
43
+
44
+ ### use() Hook
45
+
46
+ React 19 introduces the `use()` hook for reading resources (Promises, Context) during render:
47
+
48
+ ```typescript
49
+ // Reading context with use()
50
+ function Component() {
51
+ const theme = use(ThemeContext); // Can be called conditionally
52
+ return <div className={theme} />;
53
+ }
54
+
55
+ // Reading promises with use()
56
+ function UserProfile({ userPromise }) {
57
+ const user = use(userPromise); // Suspends until resolved
58
+ return <div>{user.name}</div>;
59
+ }
60
+ ```
61
+
62
+ **Gotcha:** `use()` can be called inside loops and conditionals (unlike other hooks).
63
+
64
+ **Docs:** [React 19 Release Notes](https://react.dev/blog/2024/12/05/react-19)
65
+
66
+ ### Concurrent Features On by Default
67
+
68
+ Concurrent rendering is now the default. Watch for:
69
+ - State updates during render (can cause infinite loops)
70
+ - External store subscriptions (use `useSyncExternalStore`)
71
+ - Mutable refs during render
72
+
73
+ ---
74
+
75
+ ## Next.js 15
76
+
77
+ ### Changed Caching Defaults
78
+
79
+ Next.js 15 no longer caches `fetch()` requests by default:
80
+
81
+ ```typescript
82
+ // Before Next.js 15 - cached by default
83
+ const data = await fetch('/api/data');
84
+
85
+ // Next.js 15 - NOT cached by default
86
+ const data = await fetch('/api/data'); // Always fresh
87
+
88
+ // To cache, explicitly opt-in:
89
+ const data = await fetch('/api/data', { cache: 'force-cache' });
90
+
91
+ // Or use next.revalidate:
92
+ const data = await fetch('/api/data', { next: { revalidate: 3600 } });
93
+ ```
94
+
95
+ **Docs:** [Next.js 15 Caching](https://nextjs.org/docs/app/building-your-application/caching)
96
+
97
+ ### Async Request APIs
98
+
99
+ Dynamic APIs are now async. Update your code:
100
+
101
+ ```typescript
102
+ // Before Next.js 15
103
+ export default function Page({ params }) {
104
+ const { id } = params;
105
+ // ...
106
+ }
107
+
108
+ // Next.js 15+
109
+ export default async function Page({ params }) {
110
+ const { id } = await params;
111
+ // ...
112
+ }
113
+
114
+ // Same for cookies, headers, searchParams
115
+ import { cookies, headers } from 'next/headers';
116
+
117
+ // Before
118
+ const cookieStore = cookies();
119
+
120
+ // After
121
+ const cookieStore = await cookies();
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Tailwind v4
127
+
128
+ ### CSS-First Configuration
129
+
130
+ Tailwind v4 uses CSS for configuration instead of `tailwind.config.js`:
131
+
132
+ ```css
133
+ /* tailwind.css */
134
+ @import "tailwindcss";
135
+
136
+ @theme {
137
+ --color-primary: #3b82f6;
138
+ --font-sans: "Inter", sans-serif;
139
+ }
140
+ ```
141
+
142
+ **Gotcha:** The `@config` directive is removed. Use `@theme` in CSS.
143
+
144
+ **Docs:** [Tailwind v4 Migration](https://tailwindcss.com/docs/v4-beta)
145
+
146
+ ### Class Syntax Changes
147
+
148
+ Some utility classes have been renamed or changed:
149
+
150
+ ```html
151
+ <!-- v3 -->
152
+ <div class="bg-opacity-50">
153
+
154
+ <!-- v4 - use color modifiers -->
155
+ <div class="bg-blue-500/50">
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Adding New Gotchas
161
+
162
+ When you encounter a framework-specific issue that cost debugging time, add it here following this template:
163
+
164
+ ```markdown
165
+ ## [Framework Name] (v[X]+)
166
+
167
+ ### [Issue Title]
168
+
169
+ [Brief description of the problem and when it occurs]
170
+
171
+ \`\`\`typescript
172
+ // Code example showing the fix or correct approach
173
+ \`\`\`
174
+
175
+ **Gotcha:** [Key insight or common mistake]
176
+
177
+ **Docs:** [Link to official documentation or changelog]
178
+ ```
179
+
180
+ ### Guidelines for Adding Entries
181
+
182
+ 1. **Version-specific:** Always include the version where the behavior changed
183
+ 2. **Code examples:** Show both "before" and "after" when applicable
184
+ 3. **Link to docs:** Include official documentation or migration guide links
185
+ 4. **Keep it brief:** Focus on the fix, not the full explanation
186
+ 5. **Update existing entries:** Prefer updating existing sections over creating duplicates