specweave 1.0.464 → 1.0.466

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 (109) hide show
  1. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.d.ts +16 -0
  2. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js +139 -0
  3. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js.map +1 -0
  4. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.d.ts +111 -0
  5. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js +304 -0
  6. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js.map +1 -0
  7. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  8. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +359 -0
  9. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  10. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +121 -0
  11. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +273 -0
  12. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  13. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +72 -0
  14. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +237 -0
  15. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  16. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  17. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +281 -0
  18. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  19. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +278 -0
  20. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +925 -0
  21. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  22. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.d.ts +113 -0
  23. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js +317 -0
  24. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js.map +1 -0
  25. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +442 -0
  26. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js +246 -0
  27. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  28. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.d.ts +64 -0
  29. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js +228 -0
  30. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js.map +1 -0
  31. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  32. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js +300 -0
  33. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  34. package/dist/plugins/specweave/lib/vendor/sync/config.d.ts +73 -0
  35. package/dist/plugins/specweave/lib/vendor/sync/config.js +132 -0
  36. package/dist/plugins/specweave/lib/vendor/sync/config.js.map +1 -0
  37. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.d.ts +163 -0
  38. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js +898 -0
  39. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js.map +1 -0
  40. package/dist/plugins/specweave/lib/vendor/sync/provider-router.d.ts +86 -0
  41. package/dist/plugins/specweave/lib/vendor/sync/provider-router.js +147 -0
  42. package/dist/plugins/specweave/lib/vendor/sync/provider-router.js.map +1 -0
  43. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.d.ts +120 -0
  44. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js +164 -0
  45. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js.map +1 -0
  46. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
  47. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
  48. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
  49. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.d.ts +38 -0
  50. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js +118 -0
  51. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js.map +1 -0
  52. package/dist/plugins/specweave/lib/vendor/utils/clean-env.d.ts +47 -0
  53. package/dist/plugins/specweave/lib/vendor/utils/clean-env.js +63 -0
  54. package/dist/plugins/specweave/lib/vendor/utils/clean-env.js.map +1 -0
  55. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.d.ts +118 -0
  56. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js +275 -0
  57. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js.map +1 -0
  58. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.d.ts +99 -0
  59. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js +149 -0
  60. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js.map +1 -0
  61. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.d.ts +63 -0
  62. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js +85 -0
  63. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js.map +1 -0
  64. package/dist/plugins/specweave/lib/vendor/utils/fs-native.d.ts +219 -0
  65. package/dist/plugins/specweave/lib/vendor/utils/fs-native.js +397 -0
  66. package/dist/plugins/specweave/lib/vendor/utils/fs-native.js.map +1 -0
  67. package/dist/plugins/specweave/lib/vendor/utils/logger.d.ts +56 -0
  68. package/dist/plugins/specweave/lib/vendor/utils/logger.js +123 -0
  69. package/dist/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  70. package/dist/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  71. package/dist/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  72. package/dist/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  73. package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
  74. package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js.map +1 -1
  75. package/dist/plugins/specweave-ado/lib/ado-spec-sync.js +1 -1
  76. package/dist/plugins/specweave-ado/lib/ado-spec-sync.js.map +1 -1
  77. package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js +2 -2
  78. package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js.map +1 -1
  79. package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
  80. package/dist/plugins/specweave-github/lib/github-feature-sync.js +13 -4
  81. package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
  82. package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
  83. package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js.map +1 -1
  84. package/dist/plugins/specweave-jira/lib/jira-spec-sync.js +1 -1
  85. package/dist/plugins/specweave-jira/lib/jira-spec-sync.js.map +1 -1
  86. package/dist/src/sync/spec-to-living-docs-sync.js +1 -1
  87. package/dist/src/sync/spec-to-living-docs-sync.js.map +1 -1
  88. package/package.json +1 -1
  89. package/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
  90. package/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
  91. package/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
  92. package/plugins/specweave/skills/team-lead/SKILL.md +150 -56
  93. package/plugins/specweave/skills/team-lead/agents/backend.md +13 -9
  94. package/plugins/specweave/skills/team-lead/agents/database.md +13 -9
  95. package/plugins/specweave/skills/team-lead/agents/frontend.md +12 -8
  96. package/plugins/specweave/skills/team-lead/agents/security.md +13 -9
  97. package/plugins/specweave/skills/team-lead/agents/testing.md +12 -8
  98. package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
  99. package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.ts +1 -1
  100. package/plugins/specweave-ado/lib/ado-spec-sync.js +1 -1
  101. package/plugins/specweave-ado/lib/ado-spec-sync.ts +1 -1
  102. package/plugins/specweave-github/lib/github-ac-checkbox-sync.js +1 -1
  103. package/plugins/specweave-github/lib/github-ac-checkbox-sync.ts +2 -2
  104. package/plugins/specweave-github/lib/github-feature-sync.js +11 -3
  105. package/plugins/specweave-github/lib/github-feature-sync.ts +13 -4
  106. package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
  107. package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.ts +1 -1
  108. package/plugins/specweave-jira/lib/jira-spec-sync.js +1 -1
  109. package/plugins/specweave-jira/lib/jira-spec-sync.ts +1 -1
@@ -0,0 +1,163 @@
1
+ /**
2
+ * GitHub Reconciler (NEW in v0.28.33)
3
+ *
4
+ * Reconciles GitHub issue states with increment metadata.json statuses.
5
+ * Fixes drift between local SpecWeave state and GitHub:
6
+ * - Closes issues for completed increments that are still open
7
+ * - Reopens issues for in-progress increments that are closed
8
+ *
9
+ * Triggered by:
10
+ * - /specweave-github:reconcile command (manual)
11
+ * - SessionStart hook (automatic, if configured)
12
+ * - post-increment-status-change.sh (on resume/abandon)
13
+ */
14
+ import { Logger } from '../utils/logger.js';
15
+ export interface ReconcileOptions {
16
+ projectRoot: string;
17
+ dryRun?: boolean;
18
+ logger?: Logger;
19
+ }
20
+ export interface IncrementGitHubState {
21
+ incrementId: string;
22
+ incrementPath: string;
23
+ metadataStatus: string;
24
+ featureId?: string;
25
+ mainIssue?: {
26
+ number: number;
27
+ url?: string;
28
+ };
29
+ userStoryIssues: Array<{
30
+ userStoryId: string;
31
+ issueNumber: number;
32
+ }>;
33
+ }
34
+ export interface ReconcileResult {
35
+ scanned: number;
36
+ mismatches: number;
37
+ closed: number;
38
+ reopened: number;
39
+ errors: string[];
40
+ details: Array<{
41
+ incrementId: string;
42
+ action: 'close' | 'reopen' | 'skip' | 'error';
43
+ issueNumber: number;
44
+ reason: string;
45
+ }>;
46
+ }
47
+ export declare class GitHubReconciler {
48
+ private projectRoot;
49
+ private dryRun;
50
+ private logger;
51
+ private client;
52
+ private configCache;
53
+ constructor(options: ReconcileOptions);
54
+ /**
55
+ * Main reconciliation entry point
56
+ */
57
+ reconcile(): Promise<ReconcileResult>;
58
+ /**
59
+ * Reconcile a single increment
60
+ */
61
+ private reconcileIncrement;
62
+ /**
63
+ * Reconcile a single issue
64
+ */
65
+ private reconcileIssue;
66
+ /**
67
+ * Scan all increments (active + archived + abandoned) and extract GitHub state.
68
+ * Archived/abandoned increments are included so the reconciler can close their
69
+ * stale open issues.
70
+ */
71
+ private scanIncrements;
72
+ /**
73
+ * Extract GitHub state from increment metadata (both old and new formats)
74
+ */
75
+ private extractGitHubState;
76
+ /**
77
+ * Fallback: search GitHub API for issues when metadata has no references.
78
+ * Only used for active (non-archived) increments to avoid excessive API calls.
79
+ */
80
+ private searchGitHubForIssues;
81
+ /**
82
+ * Initialize GitHub client
83
+ *
84
+ * Prefers sync.github.owner/repo from config (critical for umbrella repos
85
+ * where git remote points to a different repo than where issues live).
86
+ * Falls back to git remote detection.
87
+ */
88
+ private initClient;
89
+ /**
90
+ * Load config (cached after first read)
91
+ */
92
+ private loadConfig;
93
+ /**
94
+ * Resolve GitHub owner/repo from config, falling back to git remote.
95
+ * Critical for umbrella repos where git remote != issue target repo.
96
+ */
97
+ private static resolveRepoInfo;
98
+ /**
99
+ * Reopen all GitHub issues for an increment
100
+ * Called by post-increment-status-change.sh when resuming
101
+ */
102
+ static reopenIncrementIssues(projectRoot: string, incrementId: string, reason: string, logger?: Logger): Promise<{
103
+ reopened: number;
104
+ errors: string[];
105
+ }>;
106
+ /**
107
+ * Close all GitHub issues for an abandoned increment
108
+ * Called by post-increment-status-change.sh when abandoning
109
+ */
110
+ static closeAbandonedIncrementIssues(projectRoot: string, incrementId: string, reason: string, logger?: Logger): Promise<{
111
+ closed: number;
112
+ errors: string[];
113
+ }>;
114
+ /**
115
+ * Close all GitHub issues for a completed increment.
116
+ *
117
+ * Fallback path that reads issue numbers directly from metadata.json
118
+ * (does NOT depend on living docs files existing).
119
+ *
120
+ * Reads from BOTH metadata formats:
121
+ * - metadata.externalLinks.github.issues (keyed by US-ID, has issueNumber)
122
+ * - metadata.github.issues (array, has number)
123
+ *
124
+ * Idempotent: skips already-closed issues.
125
+ * Also closes the milestone if present in metadata.
126
+ */
127
+ static closeCompletedIncrementIssues(projectRoot: string, incrementId: string, logger?: Logger | ((msg: string) => void)): Promise<{
128
+ closed: number;
129
+ milestoneClose: boolean;
130
+ errors: string[];
131
+ }>;
132
+ /**
133
+ * Result from milestone reconciliation
134
+ */
135
+ static readonly MILESTONE_RECONCILE_RESULT_TEMPLATE: {
136
+ staleClosed: number;
137
+ duplicatesClosed: number;
138
+ errors: string[];
139
+ };
140
+ /**
141
+ * Reconcile stale and duplicate milestones on GitHub.
142
+ *
143
+ * - Closes open milestones with 0 open issues and 1+ closed issues (stale)
144
+ * - Closes open milestones matching completed local increments
145
+ * - Detects duplicate milestones (same FS-XXX prefix) and closes the
146
+ * smaller/empty one, keeping the one with the most issues
147
+ *
148
+ * @param projectRoot - Project root directory
149
+ * @param dryRun - If true, only report what would happen
150
+ * @param logger - Logger instance
151
+ */
152
+ static reconcileMilestones(projectRoot: string, dryRun?: boolean, logger?: Logger): Promise<{
153
+ staleClosed: number;
154
+ duplicatesClosed: number;
155
+ errors: string[];
156
+ }>;
157
+ /**
158
+ * Collect FS-IDs of all completed/archived/abandoned increments.
159
+ * Returns a Set of strings like "FS-400", "FS-391", etc.
160
+ */
161
+ private static collectCompletedIncrementFsIds;
162
+ }
163
+ //# sourceMappingURL=github-reconciler.d.ts.map