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.
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.d.ts +16 -0
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js +139 -0
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.d.ts +111 -0
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js +304 -0
- package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +359 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +121 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +273 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +72 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +237 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +281 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +278 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +925 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.d.ts +113 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js +317 -0
- package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +442 -0
- package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js +246 -0
- package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.d.ts +64 -0
- package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js +228 -0
- package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
- package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js +300 -0
- package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/sync/config.d.ts +73 -0
- package/dist/plugins/specweave/lib/vendor/sync/config.js +132 -0
- package/dist/plugins/specweave/lib/vendor/sync/config.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.d.ts +163 -0
- package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js +898 -0
- package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/sync/provider-router.d.ts +86 -0
- package/dist/plugins/specweave/lib/vendor/sync/provider-router.js +147 -0
- package/dist/plugins/specweave/lib/vendor/sync/provider-router.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/sync/status-mapper.d.ts +120 -0
- package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js +164 -0
- package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
- package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
- package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.d.ts +38 -0
- package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js +118 -0
- package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/clean-env.d.ts +47 -0
- package/dist/plugins/specweave/lib/vendor/utils/clean-env.js +63 -0
- package/dist/plugins/specweave/lib/vendor/utils/clean-env.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/credential-masker.d.ts +118 -0
- package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js +275 -0
- package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.d.ts +99 -0
- package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js +149 -0
- package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.d.ts +63 -0
- package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js +85 -0
- package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/fs-native.d.ts +219 -0
- package/dist/plugins/specweave/lib/vendor/utils/fs-native.js +397 -0
- package/dist/plugins/specweave/lib/vendor/utils/fs-native.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/logger.d.ts +56 -0
- package/dist/plugins/specweave/lib/vendor/utils/logger.js +123 -0
- package/dist/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
- package/dist/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
- package/dist/plugins/specweave/lib/vendor/utils/translation.js +414 -0
- package/dist/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
- package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-sync.js +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js +2 -2
- package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.js +13 -4
- package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
- package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-spec-sync.js +1 -1
- package/dist/plugins/specweave-jira/lib/jira-spec-sync.js.map +1 -1
- package/dist/src/sync/spec-to-living-docs-sync.js +1 -1
- package/dist/src/sync/spec-to-living-docs-sync.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
- package/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
- package/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
- package/plugins/specweave/skills/team-lead/SKILL.md +150 -56
- package/plugins/specweave/skills/team-lead/agents/backend.md +13 -9
- package/plugins/specweave/skills/team-lead/agents/database.md +13 -9
- package/plugins/specweave/skills/team-lead/agents/frontend.md +12 -8
- package/plugins/specweave/skills/team-lead/agents/security.md +13 -9
- package/plugins/specweave/skills/team-lead/agents/testing.md +12 -8
- package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
- package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.ts +1 -1
- package/plugins/specweave-ado/lib/ado-spec-sync.js +1 -1
- package/plugins/specweave-ado/lib/ado-spec-sync.ts +1 -1
- package/plugins/specweave-github/lib/github-ac-checkbox-sync.js +1 -1
- package/plugins/specweave-github/lib/github-ac-checkbox-sync.ts +2 -2
- package/plugins/specweave-github/lib/github-feature-sync.js +11 -3
- package/plugins/specweave-github/lib/github-feature-sync.ts +13 -4
- package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
- package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.ts +1 -1
- package/plugins/specweave-jira/lib/jira-spec-sync.js +1 -1
- 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
|