@specship/specship-win32-arm64 0.21.2 → 0.22.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.
- package/lib/dist/bin/specship.js +302 -4
- package/lib/dist/bin/specship.js.map +1 -1
- package/lib/dist/commands/specship/jira.md +74 -0
- package/lib/dist/commands/specship/spec.md +61 -1
- package/lib/dist/extraction/index.d.ts +6 -0
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/specs/markdown-spec-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/specs/markdown-spec-extractor.js +8 -1
- package/lib/dist/extraction/specs/markdown-spec-extractor.js.map +1 -1
- package/lib/dist/index.d.ts +7 -0
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +45 -18
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/jira/auto-publish.d.ts +67 -0
- package/lib/dist/jira/auto-publish.d.ts.map +1 -0
- package/lib/dist/jira/auto-publish.js +232 -0
- package/lib/dist/jira/auto-publish.js.map +1 -0
- package/lib/dist/jira/board-first.d.ts +64 -0
- package/lib/dist/jira/board-first.d.ts.map +1 -0
- package/lib/dist/jira/board-first.js +91 -0
- package/lib/dist/jira/board-first.js.map +1 -0
- package/lib/dist/jira/client.d.ts +80 -1
- package/lib/dist/jira/client.d.ts.map +1 -1
- package/lib/dist/jira/client.js +213 -1
- package/lib/dist/jira/client.js.map +1 -1
- package/lib/dist/jira/config.d.ts +1 -1
- package/lib/dist/jira/config.d.ts.map +1 -1
- package/lib/dist/jira/config.js +14 -3
- package/lib/dist/jira/config.js.map +1 -1
- package/lib/dist/jira/coverage.d.ts +105 -0
- package/lib/dist/jira/coverage.d.ts.map +1 -0
- package/lib/dist/jira/coverage.js +160 -0
- package/lib/dist/jira/coverage.js.map +1 -0
- package/lib/dist/jira/index.d.ts +1 -0
- package/lib/dist/jira/index.d.ts.map +1 -1
- package/lib/dist/jira/index.js +1 -0
- package/lib/dist/jira/index.js.map +1 -1
- package/lib/dist/jira/milestone-comment.d.ts +95 -0
- package/lib/dist/jira/milestone-comment.d.ts.map +1 -0
- package/lib/dist/jira/milestone-comment.js +271 -0
- package/lib/dist/jira/milestone-comment.js.map +1 -0
- package/lib/dist/jira/publish.d.ts +69 -2
- package/lib/dist/jira/publish.d.ts.map +1 -1
- package/lib/dist/jira/publish.js +0 -0
- package/lib/dist/jira/publish.js.map +1 -1
- package/lib/dist/jira/published-specs.d.ts +23 -0
- package/lib/dist/jira/published-specs.d.ts.map +1 -0
- package/lib/dist/jira/published-specs.js +106 -0
- package/lib/dist/jira/published-specs.js.map +1 -0
- package/lib/dist/jira/reconcile.d.ts +81 -0
- package/lib/dist/jira/reconcile.d.ts.map +1 -0
- package/lib/dist/jira/reconcile.js +111 -0
- package/lib/dist/jira/reconcile.js.map +1 -0
- package/lib/dist/jira/regression-pack.d.ts +547 -0
- package/lib/dist/jira/regression-pack.d.ts.map +1 -0
- package/lib/dist/jira/regression-pack.js +986 -0
- package/lib/dist/jira/regression-pack.js.map +1 -0
- package/lib/dist/jira/repo-config.d.ts +59 -0
- package/lib/dist/jira/repo-config.d.ts.map +1 -0
- package/lib/dist/jira/repo-config.js +222 -0
- package/lib/dist/jira/repo-config.js.map +1 -0
- package/lib/dist/jira/spec-amend.d.ts +46 -0
- package/lib/dist/jira/spec-amend.d.ts.map +1 -0
- package/lib/dist/jira/spec-amend.js +232 -0
- package/lib/dist/jira/spec-amend.js.map +1 -0
- package/lib/dist/jira/spec-writer.d.ts +22 -0
- package/lib/dist/jira/spec-writer.d.ts.map +1 -1
- package/lib/dist/jira/spec-writer.js +113 -0
- package/lib/dist/jira/spec-writer.js.map +1 -1
- package/lib/dist/jira/types.d.ts +62 -0
- package/lib/dist/jira/types.d.ts.map +1 -1
- package/lib/dist/jira/types.js +15 -1
- package/lib/dist/jira/types.js.map +1 -1
- package/lib/dist/mcp/jira-tools.d.ts +102 -0
- package/lib/dist/mcp/jira-tools.d.ts.map +1 -1
- package/lib/dist/mcp/jira-tools.js +807 -50
- package/lib/dist/mcp/jira-tools.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +4 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/spec-tools.d.ts.map +1 -1
- package/lib/dist/mcp/spec-tools.js +7 -1
- package/lib/dist/mcp/spec-tools.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +3 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +50 -0
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/resolution/spec-link-resolver.d.ts +2 -0
- package/lib/dist/resolution/spec-link-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/spec-link-resolver.js +11 -3
- package/lib/dist/resolution/spec-link-resolver.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/dist/jira/config.js
CHANGED
|
@@ -51,6 +51,7 @@ const os = __importStar(require("os"));
|
|
|
51
51
|
const path = __importStar(require("path"));
|
|
52
52
|
const shared_1 = require("../installer/targets/shared");
|
|
53
53
|
const types_1 = require("./types");
|
|
54
|
+
const repo_config_1 = require("./repo-config");
|
|
54
55
|
/**
|
|
55
56
|
* Absolute path to the user-level JIRA config. Overridable via
|
|
56
57
|
* `SPECSHIP_JIRA_CONFIG` for tests. Never project-scoped.
|
|
@@ -112,8 +113,11 @@ function inferDeployment(creds) {
|
|
|
112
113
|
*
|
|
113
114
|
* SECURITY: the thrown messages never include a token or PAT value.
|
|
114
115
|
*/
|
|
115
|
-
function resolveJiraCredentials() {
|
|
116
|
+
function resolveJiraCredentials(cwd = process.cwd()) {
|
|
116
117
|
const file = loadJiraConfig(); // may throw on malformed
|
|
118
|
+
// Repo-committed team-lane binding (REQ-JIRATEAM-001). Credentials NEVER
|
|
119
|
+
// come from here; the loader rejects credential-shaped fields.
|
|
120
|
+
const repo = (0, repo_config_1.loadRepoJiraBinding)(cwd);
|
|
117
121
|
const baseUrl = process.env.SPECSHIP_JIRA_BASE_URL ?? file?.baseUrl;
|
|
118
122
|
const email = process.env.SPECSHIP_JIRA_EMAIL ?? file?.email;
|
|
119
123
|
const apiToken = process.env.SPECSHIP_JIRA_API_TOKEN ?? file?.apiToken;
|
|
@@ -140,8 +144,13 @@ function resolveJiraCredentials() {
|
|
|
140
144
|
const done = process.env.SPECSHIP_JIRA_TRANSITION_DONE ??
|
|
141
145
|
file?.transitions?.done ??
|
|
142
146
|
'Done';
|
|
143
|
-
//
|
|
144
|
-
|
|
147
|
+
// Publish project (REQ-JIRAPUB-001 / REQ-JIRATEAM-001). Precedence:
|
|
148
|
+
// repo binding > env > user-level file.
|
|
149
|
+
// Repo binding wins for project identity even over env so every teammate
|
|
150
|
+
// and CI run targets the same project; credentials never come from repo.
|
|
151
|
+
const userProject = process.env.SPECSHIP_JIRA_PROJECT ?? file?.project;
|
|
152
|
+
const project = repo.binding?.projectKey ?? userProject;
|
|
153
|
+
const bindingSource = repo.binding ? 'repo' : 'user';
|
|
145
154
|
const deployment = inferDeployment({
|
|
146
155
|
deployment: explicitDeployment,
|
|
147
156
|
email,
|
|
@@ -166,6 +175,8 @@ function resolveJiraCredentials() {
|
|
|
166
175
|
caCertPath,
|
|
167
176
|
insecureTls,
|
|
168
177
|
project,
|
|
178
|
+
bindingSource,
|
|
179
|
+
bindingPath: repo.path ?? undefined,
|
|
169
180
|
};
|
|
170
181
|
}
|
|
171
182
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/jira/config.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/jira/config.ts"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AE,CAAC;QACnD,MAAM,IAAI,uBAAe,CACvB,0DAA0D;YACxD,4BAA4B,CAC/B,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,KAAK,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC;QACxC,MAAM,IAAI,uBAAe,CACvB,yDAAyD;YACvD,4BAA4B,CAC/B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,UAAU;QACV,KAAK;QACL,QAAQ;QACR,GAAG;QACH,WAAW,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3C,UAAU;QACV,WAAW;QACX,OAAO;QACP,aAAa;QACb,WAAW,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS;KACpC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAkB;IAC/C,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAA,sBAAa,EAAC,IAAI,EAAE,MAA4C,CAAC,CAAC;IAClE,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;IAC9D,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAyB;IAEzB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,YAAY;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,IAAI,uBAAe,CACvB,4BAA4B,KAAK,iCAAiC,CACnE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sprint coverage report (REQ-JIRATEAM-004).
|
|
3
|
+
*
|
|
4
|
+
* Joins the bound project's active (or named) sprint issues to spec truth:
|
|
5
|
+
* each JIRA issue lists whether a spec exists, and — when it does — the
|
|
6
|
+
* rolled-up state of its spec→code links (using the existing spec-link state
|
|
7
|
+
* machine, never a new one).
|
|
8
|
+
*
|
|
9
|
+
* Pure builder: it takes an injectable JIRA read client and a spec-queries
|
|
10
|
+
* slice; it never mutates JIRA. Posting is done by the caller via
|
|
11
|
+
* `upsertWatermarkedComment` (REQ-JIRATEAM-004.A3/A4).
|
|
12
|
+
*/
|
|
13
|
+
import type { JiraIssueListResult } from './types';
|
|
14
|
+
import type { SpecLinkState } from '../types';
|
|
15
|
+
/**
|
|
16
|
+
* The per-issue rolled-up state a coverage row carries. Named to be
|
|
17
|
+
* self-explanatory in the rendered table; derived from the spec-link states
|
|
18
|
+
* on the requirement (and its acceptance children).
|
|
19
|
+
*/
|
|
20
|
+
export type CoverageState = 'unspecced' | 'specced' | 'implemented' | 'verified' | 'drifted' | 'broken';
|
|
21
|
+
/** One row of the coverage report — one JIRA sprint issue. */
|
|
22
|
+
export interface CoverageRow {
|
|
23
|
+
issueKey: string;
|
|
24
|
+
title: string;
|
|
25
|
+
jiraStatus: string;
|
|
26
|
+
specRelPath?: string;
|
|
27
|
+
state: CoverageState;
|
|
28
|
+
}
|
|
29
|
+
/** Rollup counts closing the report (REQ-JIRATEAM-004.A1). */
|
|
30
|
+
export interface CoverageRollup {
|
|
31
|
+
total: number;
|
|
32
|
+
unspecced: number;
|
|
33
|
+
specced: number;
|
|
34
|
+
implemented: number;
|
|
35
|
+
verified: number;
|
|
36
|
+
drifted: number;
|
|
37
|
+
broken: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CoverageReport {
|
|
40
|
+
/** The sprint label — either the explicit name or "active sprint(s)". */
|
|
41
|
+
sprintLabel: string;
|
|
42
|
+
rows: CoverageRow[];
|
|
43
|
+
rollup: CoverageRollup;
|
|
44
|
+
}
|
|
45
|
+
/** Read-only slice of `JiraClient` the coverage builder consumes. */
|
|
46
|
+
export interface CoverageJiraClient {
|
|
47
|
+
listSprintIssues(opts: {
|
|
48
|
+
project: string;
|
|
49
|
+
sprint?: string;
|
|
50
|
+
}): Promise<JiraIssueListResult>;
|
|
51
|
+
}
|
|
52
|
+
/** Structural slice of SpecQueries the builder reads. */
|
|
53
|
+
export interface CoverageSpecQueries {
|
|
54
|
+
getSpecById?: (id: string) => {
|
|
55
|
+
id: string;
|
|
56
|
+
kind: string;
|
|
57
|
+
sourcePath: string;
|
|
58
|
+
} | null;
|
|
59
|
+
getSpecsByParent?: (id: string) => Array<{
|
|
60
|
+
id: string;
|
|
61
|
+
kind: string;
|
|
62
|
+
}>;
|
|
63
|
+
getLinksBySpec?: (id: string) => Array<{
|
|
64
|
+
state: SpecLinkState;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Enumerate every spec — used to find the requirement id for a spec file
|
|
68
|
+
* whose frontmatter carries the JIRA key. The coverage builder only reads
|
|
69
|
+
* `id`, `kind`, and `sourcePath`.
|
|
70
|
+
*/
|
|
71
|
+
getAllSpecs?: () => Array<{
|
|
72
|
+
id: string;
|
|
73
|
+
kind: string;
|
|
74
|
+
sourcePath: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Roll a requirement's spec-link states into one CoverageState (A2).
|
|
79
|
+
* Precedence — a single degraded link always wins so the report never
|
|
80
|
+
* overstates progress. Reuses the SpecLinkState enum verbatim.
|
|
81
|
+
*/
|
|
82
|
+
export declare function rollupCoverageState(states: SpecLinkState[]): CoverageState;
|
|
83
|
+
export interface BuildCoverageDeps {
|
|
84
|
+
client: CoverageJiraClient;
|
|
85
|
+
projectRoot: string;
|
|
86
|
+
specQueries: CoverageSpecQueries;
|
|
87
|
+
project: string;
|
|
88
|
+
sprint?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Build the sprint coverage report (REQ-JIRATEAM-004.A1/A2). Every issue in
|
|
92
|
+
* the sprint scope appears — including unspecced ones — with exactly one
|
|
93
|
+
* rolled-up state, and the rollup counts close the report. Read-only: no
|
|
94
|
+
* write to JIRA happens here (A4 is enforced by the caller).
|
|
95
|
+
*/
|
|
96
|
+
export declare function buildCoverageReport(deps: BuildCoverageDeps): Promise<CoverageReport>;
|
|
97
|
+
/** Watermark for the single edit-in-place coverage comment (A3). */
|
|
98
|
+
export declare const COVERAGE_COMMENT_WATERMARK = "<!-- specship:coverage v1 -->";
|
|
99
|
+
/**
|
|
100
|
+
* Render the report as markdown (REQ-JIRATEAM-004.A1). Prefixed with the
|
|
101
|
+
* coverage watermark so `upsertWatermarkedComment` can find and edit it in
|
|
102
|
+
* place on re-post.
|
|
103
|
+
*/
|
|
104
|
+
export declare function formatCoverageMarkdown(report: CoverageReport): string;
|
|
105
|
+
//# sourceMappingURL=coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/jira/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,SAAS,GACT,aAAa,GACb,UAAU,GACV,SAAS,GACT,QAAQ,CAAC;AAEb,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM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CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CA+CzB;AAED,oEAAoE;AACpE,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAO1E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAyBrE"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sprint coverage report (REQ-JIRATEAM-004).
|
|
4
|
+
*
|
|
5
|
+
* Joins the bound project's active (or named) sprint issues to spec truth:
|
|
6
|
+
* each JIRA issue lists whether a spec exists, and — when it does — the
|
|
7
|
+
* rolled-up state of its spec→code links (using the existing spec-link state
|
|
8
|
+
* machine, never a new one).
|
|
9
|
+
*
|
|
10
|
+
* Pure builder: it takes an injectable JIRA read client and a spec-queries
|
|
11
|
+
* slice; it never mutates JIRA. Posting is done by the caller via
|
|
12
|
+
* `upsertWatermarkedComment` (REQ-JIRATEAM-004.A3/A4).
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.COVERAGE_COMMENT_WATERMARK = void 0;
|
|
16
|
+
exports.rollupCoverageState = rollupCoverageState;
|
|
17
|
+
exports.buildCoverageReport = buildCoverageReport;
|
|
18
|
+
exports.formatCoverageMarkdown = formatCoverageMarkdown;
|
|
19
|
+
const published_specs_1 = require("./published-specs");
|
|
20
|
+
/**
|
|
21
|
+
* Roll a requirement's spec-link states into one CoverageState (A2).
|
|
22
|
+
* Precedence — a single degraded link always wins so the report never
|
|
23
|
+
* overstates progress. Reuses the SpecLinkState enum verbatim.
|
|
24
|
+
*/
|
|
25
|
+
function rollupCoverageState(states) {
|
|
26
|
+
if (states.some((s) => s === 'broken'))
|
|
27
|
+
return 'broken';
|
|
28
|
+
if (states.some((s) => s === 'drifted' || s === 'orphaned'))
|
|
29
|
+
return 'drifted';
|
|
30
|
+
if (states.length === 0)
|
|
31
|
+
return 'specced';
|
|
32
|
+
if (states.every((s) => s === 'verified'))
|
|
33
|
+
return 'verified';
|
|
34
|
+
if (states.every((s) => s === 'verified' || s === 'implemented'))
|
|
35
|
+
return 'implemented';
|
|
36
|
+
return 'specced';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Collect the spec-link states for a requirement spec: its own links plus
|
|
40
|
+
* the links of its acceptance children (matches `deriveRequirementStatus` in
|
|
41
|
+
* spec-tools.ts — one state machine, two rollup precedences).
|
|
42
|
+
*/
|
|
43
|
+
function collectLinkStates(sq, specId) {
|
|
44
|
+
const states = [];
|
|
45
|
+
const own = sq.getLinksBySpec?.(specId) ?? [];
|
|
46
|
+
for (const l of own)
|
|
47
|
+
states.push(l.state);
|
|
48
|
+
const children = sq.getSpecsByParent?.(specId) ?? [];
|
|
49
|
+
for (const c of children) {
|
|
50
|
+
if (c.kind !== 'acceptance')
|
|
51
|
+
continue;
|
|
52
|
+
for (const l of sq.getLinksBySpec?.(c.id) ?? [])
|
|
53
|
+
states.push(l.state);
|
|
54
|
+
}
|
|
55
|
+
return states;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Find the requirement spec id for a published spec file. Frontmatter carries
|
|
59
|
+
* the JIRA key but not the SpecShip requirement id (the requirement id is
|
|
60
|
+
* derivable from the H1 markers). We look up the requirement whose sourcePath
|
|
61
|
+
* matches the published spec's file — the same "one requirement per published
|
|
62
|
+
* file" invariant the publish path relies on.
|
|
63
|
+
*/
|
|
64
|
+
function requirementIdForPublished(sq, pub) {
|
|
65
|
+
const all = sq.getAllSpecs?.() ?? [];
|
|
66
|
+
for (const s of all) {
|
|
67
|
+
if (s.kind !== 'requirement')
|
|
68
|
+
continue;
|
|
69
|
+
if (s.sourcePath === pub.specRelPath || s.sourcePath === pub.absPath) {
|
|
70
|
+
return s.id;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Build the sprint coverage report (REQ-JIRATEAM-004.A1/A2). Every issue in
|
|
77
|
+
* the sprint scope appears — including unspecced ones — with exactly one
|
|
78
|
+
* rolled-up state, and the rollup counts close the report. Read-only: no
|
|
79
|
+
* write to JIRA happens here (A4 is enforced by the caller).
|
|
80
|
+
*/
|
|
81
|
+
async function buildCoverageReport(deps) {
|
|
82
|
+
const listed = await deps.client.listSprintIssues({
|
|
83
|
+
project: deps.project,
|
|
84
|
+
sprint: deps.sprint,
|
|
85
|
+
});
|
|
86
|
+
const published = (0, published_specs_1.enumeratePublishedSpecs)(deps.projectRoot);
|
|
87
|
+
const byKey = new Map();
|
|
88
|
+
for (const p of published)
|
|
89
|
+
byKey.set(p.issueKey, p);
|
|
90
|
+
const rows = listed.issues.map((issue) => {
|
|
91
|
+
const pub = byKey.get(issue.key);
|
|
92
|
+
if (!pub) {
|
|
93
|
+
return {
|
|
94
|
+
issueKey: issue.key,
|
|
95
|
+
title: issue.summary,
|
|
96
|
+
jiraStatus: issue.status,
|
|
97
|
+
state: 'unspecced',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const reqId = requirementIdForPublished(deps.specQueries, pub);
|
|
101
|
+
const states = reqId ? collectLinkStates(deps.specQueries, reqId) : [];
|
|
102
|
+
return {
|
|
103
|
+
issueKey: issue.key,
|
|
104
|
+
title: pub.title || issue.summary,
|
|
105
|
+
jiraStatus: issue.status,
|
|
106
|
+
specRelPath: pub.specRelPath,
|
|
107
|
+
state: rollupCoverageState(states),
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
const rollup = {
|
|
111
|
+
total: rows.length,
|
|
112
|
+
unspecced: 0,
|
|
113
|
+
specced: 0,
|
|
114
|
+
implemented: 0,
|
|
115
|
+
verified: 0,
|
|
116
|
+
drifted: 0,
|
|
117
|
+
broken: 0,
|
|
118
|
+
};
|
|
119
|
+
for (const r of rows)
|
|
120
|
+
rollup[r.state]++;
|
|
121
|
+
return {
|
|
122
|
+
sprintLabel: deps.sprint ? deps.sprint : 'active sprint',
|
|
123
|
+
rows,
|
|
124
|
+
rollup,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Watermark for the single edit-in-place coverage comment (A3). */
|
|
128
|
+
exports.COVERAGE_COMMENT_WATERMARK = '<!-- specship:coverage v1 -->';
|
|
129
|
+
/** Escape a value so it can't break the markdown table layout. */
|
|
130
|
+
function cell(s) {
|
|
131
|
+
return String(s ?? '').replace(/\r?\n/g, ' ').replace(/\|/g, '\\|').trim();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Render the report as markdown (REQ-JIRATEAM-004.A1). Prefixed with the
|
|
135
|
+
* coverage watermark so `upsertWatermarkedComment` can find and edit it in
|
|
136
|
+
* place on re-post.
|
|
137
|
+
*/
|
|
138
|
+
function formatCoverageMarkdown(report) {
|
|
139
|
+
const header = [
|
|
140
|
+
exports.COVERAGE_COMMENT_WATERMARK,
|
|
141
|
+
`# Sprint coverage — ${report.sprintLabel}`,
|
|
142
|
+
'',
|
|
143
|
+
];
|
|
144
|
+
if (report.rows.length === 0) {
|
|
145
|
+
return [
|
|
146
|
+
...header,
|
|
147
|
+
'_No issues in this sprint scope._',
|
|
148
|
+
].join('\n');
|
|
149
|
+
}
|
|
150
|
+
const table = [
|
|
151
|
+
'| Key | Title | JIRA | State | Spec |',
|
|
152
|
+
'| --- | --- | --- | --- | --- |',
|
|
153
|
+
...report.rows.map((r) => `| ${cell(r.issueKey)} | ${cell(r.title)} | ${cell(r.jiraStatus)} | ${cell(r.state)} | ${cell(r.specRelPath ?? '—')} |`),
|
|
154
|
+
].join('\n');
|
|
155
|
+
const roll = report.rollup;
|
|
156
|
+
const rollupLine = `**Rollup:** ${roll.total} total · ${roll.verified} verified · ${roll.implemented} implemented · ` +
|
|
157
|
+
`${roll.specced} specced · ${roll.unspecced} unspecced · ${roll.drifted} drifted · ${roll.broken} broken`;
|
|
158
|
+
return [...header, table, '', rollupLine].join('\n');
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/jira/coverage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAsEH,kDAOC;AAyDD,kDAiDC;AAeD,wDAyBC;AA1ND,uDAA4D;AA4D5D;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAAuB;IACzD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IAC7D,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,aAAa,CAAC;QAAE,OAAO,aAAa,CAAC;IACvF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CACxB,EAAuB,EACvB,MAAc;IAEd,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,MAAM,GAAG,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,GAAG;QAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,QAAQ,G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AC,WAAW,iBAAiB;QAClG,GAAG,IAAI,CAAC,OAAO,cAAc,IAAI,CAAC,SAAS,gBAAgB,IAAI,CAAC,OAAO,cAAc,IAAI,CAAC,MAAM,SAAS,CAAC;IAC5G,OAAO,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC"}
|
package/lib/dist/jira/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/lib/dist/jira/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./types"), exports);
|
|
21
21
|
__exportStar(require("./config"), exports);
|
|
22
|
+
__exportStar(require("./repo-config"), exports);
|
|
22
23
|
__exportStar(require("./auth"), exports);
|
|
23
24
|
__exportStar(require("./client"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,yCAAuB;AACvB,2CAAyB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** The closed set of milestones (A4 — nothing else earns a comment). */
|
|
2
|
+
export type MilestoneKind = 'spec_published' | 'plan_approved' | 'pr_raised' | 'criterion_verified' | 'drift_transition' | 'release_stamped' | 'pack_run_summary';
|
|
3
|
+
/** Repo-side evidence for a milestone. Fields are kind-specific. */
|
|
4
|
+
export interface MilestoneEvidence {
|
|
5
|
+
/** Requirement id (e.g. REQ-FOO-001) — always present (A2). */
|
|
6
|
+
specId: string;
|
|
7
|
+
/** PR URL for `pr_raised`. */
|
|
8
|
+
prUrl?: string;
|
|
9
|
+
/** Verified acceptance criterion id(s) for `criterion_verified`. */
|
|
10
|
+
criterionIds?: string[];
|
|
11
|
+
/** Released version for `release_stamped`. */
|
|
12
|
+
version?: string;
|
|
13
|
+
/** Prior/next drift state for `drift_transition`. */
|
|
14
|
+
driftFrom?: string;
|
|
15
|
+
driftTo?: string;
|
|
16
|
+
/** Symbol / axis for `drift_transition`. */
|
|
17
|
+
driftSymbol?: string;
|
|
18
|
+
driftAxis?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Pack-run summary evidence (REQ-JIRAREG-005.A4). One comment per pack
|
|
21
|
+
* epic, edited in place on the next run — the marker keys on the epic +
|
|
22
|
+
* kind so the runId (which changes every run) is carried in the body and
|
|
23
|
+
* doesn't spawn a new comment.
|
|
24
|
+
*/
|
|
25
|
+
packRun?: PackRunEvidence;
|
|
26
|
+
}
|
|
27
|
+
/** Pack-run summary counts + timing (REQ-JIRAREG-005.A4). */
|
|
28
|
+
export interface PackRunEvidence {
|
|
29
|
+
runId: string;
|
|
30
|
+
executed: number;
|
|
31
|
+
passed: number;
|
|
32
|
+
failed: number;
|
|
33
|
+
unexecuted: number;
|
|
34
|
+
obsolete: number;
|
|
35
|
+
startedAt?: string;
|
|
36
|
+
finishedAt?: string;
|
|
37
|
+
/** Criterion ids whose case failed and need triage. */
|
|
38
|
+
triageCriterionIds?: string[];
|
|
39
|
+
}
|
|
40
|
+
/** Structural slice — same shape as publish.ts's watermarked client. */
|
|
41
|
+
export interface MilestoneJiraClient {
|
|
42
|
+
listCommentsDetailed(key: string): Promise<Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
body: string;
|
|
45
|
+
}>>;
|
|
46
|
+
addComment(key: string, body: string): Promise<{
|
|
47
|
+
id: string;
|
|
48
|
+
} | void>;
|
|
49
|
+
updateComment(key: string, commentId: string, body: string): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export interface PostMilestoneOptions {
|
|
52
|
+
/** Where to write soft-fail notes. Default: `<projectRoot>/.specship/jira-notes.log`. */
|
|
53
|
+
localNoteSink?: (note: string) => void;
|
|
54
|
+
/** Project root used to derive the default note sink. */
|
|
55
|
+
projectRoot?: string;
|
|
56
|
+
/** Override the watermark version tag (defaults to reading package.json). */
|
|
57
|
+
specshipVersion?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PostMilestoneResult {
|
|
60
|
+
status: 'created' | 'updated' | 'skipped' | 'soft_failed';
|
|
61
|
+
commentId?: string;
|
|
62
|
+
/** When soft_failed, the reason string that went to the note sink. */
|
|
63
|
+
reason?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Stable marker line placed at the TOP of every milestone comment.
|
|
67
|
+
* Key: kind + specId (+ criterion id for `criterion_verified`, +
|
|
68
|
+
* version for `release_stamped`, + from/to/symbol for `drift_transition`).
|
|
69
|
+
* The listComments scan finds a prior comment by this exact prefix.
|
|
70
|
+
*/
|
|
71
|
+
export declare function milestoneMarker(kind: MilestoneKind, ev: MilestoneEvidence): string;
|
|
72
|
+
/**
|
|
73
|
+
* Render the pack-run summary table (REQ-JIRAREG-005.A4). Deterministic
|
|
74
|
+
* ordering + a stable one-column-per-count shape so the diff between two
|
|
75
|
+
* runs is small.
|
|
76
|
+
*/
|
|
77
|
+
export declare function renderPackRunSummary(ev: PackRunEvidence): string;
|
|
78
|
+
/**
|
|
79
|
+
* A2: reject a URL that carries credentials, resolves to a private/local
|
|
80
|
+
* host, or uses a non-http(s) scheme. Any https host (github.com, GHE,
|
|
81
|
+
* GitLab, self-hosted) is acceptable evidence — enterprises don't run
|
|
82
|
+
* public GitHub.
|
|
83
|
+
*/
|
|
84
|
+
export declare function isPublicEvidenceUrl(url: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Render the human-readable milestone body. Callers never construct this
|
|
87
|
+
* directly — everything flows through `postMilestoneComment` so the
|
|
88
|
+
* watermark, marker, sanitization, and URL check apply uniformly.
|
|
89
|
+
*/
|
|
90
|
+
export declare function renderMilestoneBody(kind: MilestoneKind, ev: MilestoneEvidence, version: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* Post (or upsert) a milestone comment. See file header for the invariants.
|
|
93
|
+
*/
|
|
94
|
+
export declare function postMilestoneComment(client: MilestoneJiraClient, issueKey: string, kind: MilestoneKind, evidence: MilestoneEvidence, opts?: PostMilestoneOptions): Promise<PostMilestoneResult>;
|
|
95
|
+
//# sourceMappingURL=milestone-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestone-comment.d.ts","sourceRoot":"","sources":["../../src/jira/milestone-comment.ts"],"names":[],"mappings":"AAaA,wEAAwE;AACxE,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,eAAe,GACf,WAAW,GACX,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,YAAY,CAAC,EAAE,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