@rsaglobaltech/specgate 0.27.9 → 1.0.0-rc.2
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/CHANGELOG.md +57 -0
- package/dist/packages/core/src/application/ValidateChangeUseCase.js +19 -3
- package/dist/packages/core/src/application/ValidateChangeUseCase.js.map +1 -1
- package/dist/packages/core/src/domain/ApiContract.js +157 -0
- package/dist/packages/core/src/domain/ApiContract.js.map +1 -0
- package/dist/packages/core/src/domain/Approvals.js +127 -0
- package/dist/packages/core/src/domain/Approvals.js.map +1 -0
- package/dist/packages/core/src/domain/ChangeLayers.js +285 -0
- package/dist/packages/core/src/domain/ChangeLayers.js.map +1 -0
- package/dist/packages/core/src/domain/HarnessConfig.js.map +1 -1
- package/dist/packages/core/src/domain/HarnessGaps.js +182 -0
- package/dist/packages/core/src/domain/HarnessGaps.js.map +1 -0
- package/dist/packages/core/src/domain/HarnessReport.js +16 -1
- package/dist/packages/core/src/domain/HarnessReport.js.map +1 -1
- package/dist/packages/core/src/domain/HarnessRun.js.map +1 -1
- package/dist/packages/core/src/domain/Principles.js +119 -0
- package/dist/packages/core/src/domain/Principles.js.map +1 -0
- package/dist/packages/core/src/domain/RequirementGraph.js +12 -1
- package/dist/packages/core/src/domain/RequirementGraph.js.map +1 -1
- package/dist/packages/core/src/domain/Workspace.js +150 -0
- package/dist/packages/core/src/domain/Workspace.js.map +1 -0
- package/dist/packages/core/src/domain/WorkspaceStory.js +176 -0
- package/dist/packages/core/src/domain/WorkspaceStory.js.map +1 -0
- package/dist/packages/core/src/index.js +1 -0
- package/dist/packages/core/src/index.js.map +1 -1
- package/dist/packages/core/src/infrastructure/HarnessConfigFile.js +12 -0
- package/dist/packages/core/src/infrastructure/HarnessConfigFile.js.map +1 -1
- package/dist/packages/mcp-spec-driven/src/tools.js +18 -0
- package/dist/packages/mcp-spec-driven/src/tools.js.map +1 -1
- package/dist/scripts/alm/cli.js +45 -4
- package/dist/scripts/alm/cli.js.map +1 -1
- package/dist/scripts/alm/clients.js +3 -1
- package/dist/scripts/alm/clients.js.map +1 -1
- package/dist/scripts/alm/phases.js +279 -0
- package/dist/scripts/alm/phases.js.map +1 -0
- package/dist/scripts/alm/port.js +33 -5
- package/dist/scripts/alm/port.js.map +1 -1
- package/dist/scripts/alm/providers/azure.js +72 -11
- package/dist/scripts/alm/providers/azure.js.map +1 -1
- package/dist/scripts/alm/providers/github.js +67 -7
- package/dist/scripts/alm/providers/github.js.map +1 -1
- package/dist/scripts/alm/providers/index.js +8 -2
- package/dist/scripts/alm/providers/index.js.map +1 -1
- package/dist/scripts/alm/providers/jira.js +86 -8
- package/dist/scripts/alm/providers/jira.js.map +1 -1
- package/dist/scripts/alm/providers/linear.js +167 -0
- package/dist/scripts/alm/providers/linear.js.map +1 -0
- package/dist/scripts/change/artifacts.js +15 -1
- package/dist/scripts/change/artifacts.js.map +1 -1
- package/dist/scripts/change/instructions.js +47 -5
- package/dist/scripts/change/instructions.js.map +1 -1
- package/dist/scripts/cli/commands/alm/PhaseCommand.js +153 -0
- package/dist/scripts/cli/commands/alm/PhaseCommand.js.map +1 -0
- package/dist/scripts/cli/commands/alm/PullCommand.js +33 -2
- package/dist/scripts/cli/commands/alm/PullCommand.js.map +1 -1
- package/dist/scripts/cli/commands/alm/pull-back.js +104 -0
- package/dist/scripts/cli/commands/alm/pull-back.js.map +1 -0
- package/dist/scripts/cli/commands/change/ChangeCommand.js +149 -15
- package/dist/scripts/cli/commands/change/ChangeCommand.js.map +1 -1
- package/dist/scripts/cli/commands/change/TicketCommand.js +20 -7
- package/dist/scripts/cli/commands/change/TicketCommand.js.map +1 -1
- package/dist/scripts/cli/commands/harness/RunCommand.js +64 -20
- package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -1
- package/dist/scripts/cli/commands/project/AdoptCommand.js +44 -4
- package/dist/scripts/cli/commands/project/AdoptCommand.js.map +1 -1
- package/dist/scripts/cli/commands/project/InitProjectCommand.js +9 -14
- package/dist/scripts/cli/commands/project/InitProjectCommand.js.map +1 -1
- package/dist/scripts/cli/commands/project/MigrateCommand.js +166 -0
- package/dist/scripts/cli/commands/project/MigrateCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/OnboardCommand.js +23 -5
- package/dist/scripts/cli/commands/project/OnboardCommand.js.map +1 -1
- package/dist/scripts/cli/commands/quality/CheckCommand.js +25 -0
- package/dist/scripts/cli/commands/quality/CheckCommand.js.map +1 -1
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +15 -0
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/ContractCommand.js +117 -0
- package/dist/scripts/cli/commands/spec/ContractCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/DoneCommand.js +22 -0
- package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/DraftCommand.js +22 -8
- package/dist/scripts/cli/commands/spec/DraftCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/DriftCommand.js +128 -0
- package/dist/scripts/cli/commands/spec/DriftCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/StatusCommand.js +85 -0
- package/dist/scripts/cli/commands/spec/StatusCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/StudioCommand.js +48 -6
- package/dist/scripts/cli/commands/spec/StudioCommand.js.map +1 -1
- package/dist/scripts/cli/commands/workspace/WorkspaceCommand.js +612 -0
- package/dist/scripts/cli/commands/workspace/WorkspaceCommand.js.map +1 -0
- package/dist/scripts/contract.js +10 -0
- package/dist/scripts/contract.js.map +1 -0
- package/dist/scripts/docs/nav.js +16 -1
- package/dist/scripts/docs/nav.js.map +1 -1
- package/dist/scripts/draft/drafting-guide.js +6 -0
- package/dist/scripts/draft/drafting-guide.js.map +1 -1
- package/dist/scripts/draft/ticket-guide.js +5 -0
- package/dist/scripts/draft/ticket-guide.js.map +1 -1
- package/dist/scripts/drift.js +10 -0
- package/dist/scripts/drift.js.map +1 -0
- package/dist/scripts/harness/gap-evidence.js +149 -0
- package/dist/scripts/harness/gap-evidence.js.map +1 -0
- package/dist/scripts/harness/prompt.js +54 -1
- package/dist/scripts/harness/prompt.js.map +1 -1
- package/dist/scripts/harness/report.js +104 -5
- package/dist/scripts/harness/report.js.map +1 -1
- package/dist/scripts/lib/approvals.js +243 -0
- package/dist/scripts/lib/approvals.js.map +1 -0
- package/dist/scripts/lib/change-review.js +19 -11
- package/dist/scripts/lib/change-review.js.map +1 -1
- package/dist/scripts/lib/contracts.js +211 -0
- package/dist/scripts/lib/contracts.js.map +1 -0
- package/dist/scripts/lib/drift.js +80 -0
- package/dist/scripts/lib/drift.js.map +1 -0
- package/dist/scripts/lib/live-model.js +1 -0
- package/dist/scripts/lib/live-model.js.map +1 -1
- package/dist/scripts/lib/migrate.js +264 -0
- package/dist/scripts/lib/migrate.js.map +1 -0
- package/dist/scripts/lib/role-packages.js +230 -0
- package/dist/scripts/lib/role-packages.js.map +1 -0
- package/dist/scripts/lib/steering.js +180 -0
- package/dist/scripts/lib/steering.js.map +1 -0
- package/dist/scripts/lib/studio-app-page.js +28 -5
- package/dist/scripts/lib/studio-app-page.js.map +1 -1
- package/dist/scripts/lib/studio-app.js +29 -0
- package/dist/scripts/lib/studio-app.js.map +1 -1
- package/dist/scripts/lib/studio-route.js +20 -0
- package/dist/scripts/lib/studio-route.js.map +1 -1
- package/dist/scripts/lib/surface.js +55 -0
- package/dist/scripts/lib/surface.js.map +1 -1
- package/dist/scripts/lib/workspace-draft.js +146 -0
- package/dist/scripts/lib/workspace-draft.js.map +1 -0
- package/dist/scripts/lib/workspace-live-page.js +90 -0
- package/dist/scripts/lib/workspace-live-page.js.map +1 -0
- package/dist/scripts/lib/workspace-live.js +199 -0
- package/dist/scripts/lib/workspace-live.js.map +1 -0
- package/dist/scripts/lib/workspace.js +619 -0
- package/dist/scripts/lib/workspace.js.map +1 -0
- package/dist/scripts/migrate.js +10 -0
- package/dist/scripts/migrate.js.map +1 -0
- package/dist/scripts/schema/registry.js +12 -0
- package/dist/scripts/schema/registry.js.map +1 -1
- package/dist/scripts/workspace.js +10 -0
- package/dist/scripts/workspace.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PullCommand.js","sourceRoot":"","sources":["../../../../../scripts/cli/commands/alm/PullCommand.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PullCommand.js","sourceRoot":"","sources":["../../../../../scripts/cli/commands/alm/PullCommand.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CH,8BAmBC;AAyCD,oBA2JC;AAlQD,4CAA8B;AAC9B,gDAAkC;AAElC,4DAA8D;AAC9D,8CAAiE;AACjE,0DAAgE;AAChE,4CAAkD;AAClD,kDAAkD;AAElD,gDAAgF;AAChF,2CAAuC;AAEvC,kGAAoG;AACpG,sFAI4D;AAE5D,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAwB/C,SAAgB,SAAS,CAAC,IAAc;IACtC,MAAM,IAAI,GAAgB;QACxB,UAAU,EAAE,GAAG;QACf,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACd,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,eAAe,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CA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side `scripts/alm/` for the reason `alm pull` is: ADR-0021 keeps the ALM
|
|
6
|
+
* subsystem from writing the spec tree, and a note is written into the
|
|
7
|
+
* change. It is written where `change note` writes — `review.md` — and nowhere
|
|
8
|
+
* else: a comment on a ticket is a request a person reads and folds in, never
|
|
9
|
+
* a rewrite of the proposal or the delta.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.pullBack = pullBack;
|
|
46
|
+
const crypto = __importStar(require("node:crypto"));
|
|
47
|
+
const change_review_1 = require("../../../lib/change-review");
|
|
48
|
+
const hash = (text) => crypto.createHash("sha256").update(text).digest("hex");
|
|
49
|
+
/** One line of a note: a ticket's text, flattened and kept short enough to read in a table. */
|
|
50
|
+
function oneLine(text, max = 400) {
|
|
51
|
+
const flat = text.replace(/\s+/g, " ").trim();
|
|
52
|
+
return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Bring back each open change's new comments and changed description.
|
|
56
|
+
*
|
|
57
|
+
* The first pull of a ticket records its description and comes back with its
|
|
58
|
+
* comments; from then on only what changed is noted, so pulling twice adds
|
|
59
|
+
* nothing.
|
|
60
|
+
*/
|
|
61
|
+
async function pullBack(projectDir, changes, map, client, opts) {
|
|
62
|
+
const actions = [];
|
|
63
|
+
for (const change of changes) {
|
|
64
|
+
if (change.archived || !change.ticket)
|
|
65
|
+
continue;
|
|
66
|
+
const ticket = change.ticket;
|
|
67
|
+
const record = (map[change.id] ??= { ticket });
|
|
68
|
+
const note = (action, text) => {
|
|
69
|
+
actions.push({ change: change.id, issue: ticket, action, text });
|
|
70
|
+
if (!opts.dryRun && action !== "comments-unsupported") {
|
|
71
|
+
(0, change_review_1.noteChange)(projectDir, change.id, text, "", opts.today);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
if (client.capabilities.readText && typeof client.readIssueText === "function") {
|
|
75
|
+
const { body } = await client.readIssueText(ticket);
|
|
76
|
+
const now = hash(body);
|
|
77
|
+
if (record.description && record.description !== now) {
|
|
78
|
+
note("description", `The description of ${ticket} changed: ${oneLine(body)}`);
|
|
79
|
+
}
|
|
80
|
+
if (!opts.dryRun)
|
|
81
|
+
record.description = now;
|
|
82
|
+
}
|
|
83
|
+
if (!client.capabilities.comments || typeof client.listComments !== "function") {
|
|
84
|
+
actions.push({
|
|
85
|
+
change: change.id,
|
|
86
|
+
issue: ticket,
|
|
87
|
+
action: "comments-unsupported",
|
|
88
|
+
text: `This provider cannot read the comments of ${ticket}; read them on the board.`,
|
|
89
|
+
});
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const seen = new Set(record.comments ?? []);
|
|
93
|
+
for (const comment of await client.listComments(ticket)) {
|
|
94
|
+
if (seen.has(comment.id))
|
|
95
|
+
continue;
|
|
96
|
+
note("comment", `Comment on ${ticket}${comment.author ? ` by ${comment.author}` : ""}: ${oneLine(comment.body)}`);
|
|
97
|
+
seen.add(comment.id);
|
|
98
|
+
}
|
|
99
|
+
if (!opts.dryRun)
|
|
100
|
+
record.comments = [...seen];
|
|
101
|
+
}
|
|
102
|
+
return actions;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=pull-back.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull-back.js","sourceRoot":"","sources":["../../../../../scripts/cli/commands/alm/pull-back.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,4BAiDC;AA5ED,oDAAsC;AACtC,8DAAwD;AAWxD,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEtF,+FAA+F;AAC/F,SAAS,OAAO,CAAC,IAAY,EAAE,GAAG,GAAG,GAAG;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,C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ages/core/src/applicatio
|
|
|
68
68
|
const DiskProjectRepository_1 = require("../../../../packages/core/src/infrastructure/DiskProjectRepository");
|
|
69
69
|
const ChangeWorkspace_1 = require("../../../../packages/core/src/infrastructure/ChangeWorkspace");
|
|
70
70
|
const ChangeTemplates_1 = require("../../../../packages/core/src/domain/ChangeTemplates");
|
|
71
|
+
const ChangeLayers_1 = require("../../../../packages/core/src/domain/ChangeLayers");
|
|
71
72
|
const ValidateChangeUseCase_1 = require("../../../../packages/core/src/application/ValidateChangeUseCase");
|
|
72
73
|
const capability_specs_1 = require("../../../lib/capability-specs");
|
|
73
74
|
const change_impact_1 = require("../../../lib/change-impact");
|
|
@@ -147,14 +148,14 @@ function usage() {
|
|
|
147
148
|
` ${ui_1.c.bold}USAGE${ui_1.c.reset}\n` +
|
|
148
149
|
` ${ui_1.c.cyan}specgate change${ui_1.c.reset} <new|list|show|status|instructions|author|validate|impact|approve|note|archive> [options]\n\n` +
|
|
149
150
|
` ${ui_1.c.bold}SUBCOMMANDS${ui_1.c.reset}\n` +
|
|
150
|
-
` ${ui_1.c.green}new <id>${ui_1.c.reset} ${ui_1.c.dim}Scaffold a change
|
|
151
|
+
` ${ui_1.c.green}new <id>${ui_1.c.reset} ${ui_1.c.dim}Scaffold a change: discover, design, tasks and a delta (--schema spec-driven keeps 0.27's layout).${ui_1.c.reset}\n` +
|
|
151
152
|
` ${ui_1.c.green}list${ui_1.c.reset} ${ui_1.c.dim}Active changes with task progress.${ui_1.c.reset}\n` +
|
|
152
153
|
` ${ui_1.c.green}show <id>${ui_1.c.reset} ${ui_1.c.dim}Proposal, deltas and what they touch.${ui_1.c.reset}\n` +
|
|
153
154
|
` ${ui_1.c.green}status [id]${ui_1.c.reset} ${ui_1.c.dim}Which artefact to write next.${ui_1.c.reset}\n` +
|
|
154
155
|
` ${ui_1.c.green}author <id>${ui_1.c.reset} ${ui_1.c.dim}Have an agent write one artefact, confined to the change.${ui_1.c.reset}\n` +
|
|
155
156
|
` ${ui_1.c.green}validate [id]${ui_1.c.reset} ${ui_1.c.dim}Check the deltas against the capability specs.${ui_1.c.reset}\n` +
|
|
156
157
|
` ${ui_1.c.green}impact <REQ|id>${ui_1.c.reset} ${ui_1.c.dim}Spec, features, tests, files and requirements a change to it touches.${ui_1.c.reset}\n` +
|
|
157
|
-
` ${ui_1.c.green}approve <id>${ui_1.c.reset} ${ui_1.c.dim}
|
|
158
|
+
` ${ui_1.c.green}approve <id>${ui_1.c.reset} ${ui_1.c.dim}Approve the layers you own (--layer discover|design|tasks): Build waits for all.${ui_1.c.reset}\n` +
|
|
158
159
|
` ${ui_1.c.green}note <id> "<text>"${ui_1.c.reset} ${ui_1.c.dim}Ask the draft for a change in your words (--req REQ).${ui_1.c.reset}\n` +
|
|
159
160
|
` ${ui_1.c.green}archive <id>${ui_1.c.reset} ${ui_1.c.dim}Once its requirements are Implemented: merge, sync traceability, archive.${ui_1.c.reset}\n\n` +
|
|
160
161
|
` ${ui_1.c.bold}OPTIONS${ui_1.c.reset}\n` +
|
|
@@ -202,6 +203,8 @@ function parseArgs(argv) {
|
|
|
202
203
|
opts.modify.push(argv[++i]);
|
|
203
204
|
else if (a === "--req" && argv[i + 1])
|
|
204
205
|
opts.req = argv[++i];
|
|
206
|
+
else if (a === "--layer" && argv[i + 1])
|
|
207
|
+
opts.layer = argv[++i];
|
|
205
208
|
else if (a === "--schema" && argv[i + 1])
|
|
206
209
|
opts.schema = argv[++i];
|
|
207
210
|
else if (a === "--reserve" && argv[i + 1])
|
|
@@ -424,7 +427,8 @@ function cmdNew(opts) {
|
|
|
424
427
|
const reqRange = (0, ChangeWorkspace_1.reserveReqRange)(projectDir, opts.reserve);
|
|
425
428
|
const config = {
|
|
426
429
|
...ChangeWorkspace_1.DEFAULT_CONFIG,
|
|
427
|
-
|
|
430
|
+
// ADR-0042: a new change is layered unless the person names a schema.
|
|
431
|
+
schema: opts.schema || ChangeLayers_1.LAYERED_SCHEMA,
|
|
428
432
|
created: new Date().toISOString().slice(0, 10),
|
|
429
433
|
rigor: opts.full ? "full" : "lite",
|
|
430
434
|
req_range: reqRange,
|
|
@@ -436,10 +440,18 @@ function cmdNew(opts) {
|
|
|
436
440
|
created.push(path.relative(projectDir, file).split(path.sep).join("/"));
|
|
437
441
|
};
|
|
438
442
|
write(path.join(dir, ChangeWorkspace_1.CHANGE_CONFIG_FILE), (0, ChangeWorkspace_1.renderConfig)(config));
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
write(path.join(dir, "design.md"), (0,
|
|
443
|
+
if (config.schema === ChangeLayers_1.LAYERED_SCHEMA) {
|
|
444
|
+
// REQ-282: each layer with its owner.
|
|
445
|
+
write(path.join(dir, "discover.md"), (0, ChangeLayers_1.templateDiscover)(changeId));
|
|
446
|
+
write(path.join(dir, "design.md"), (0, ChangeLayers_1.templateLayeredDesign)(changeId));
|
|
447
|
+
write(path.join(dir, "tasks.md"), (0, ChangeLayers_1.templateLayeredTasks)());
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
write(path.join(dir, "proposal.md"), (0, ChangeTemplates_1.templateProposal)(changeId));
|
|
451
|
+
write(path.join(dir, "tasks.md"), (0, ChangeTemplates_1.templateTasks)());
|
|
452
|
+
if (opts.full)
|
|
453
|
+
write(path.join(dir, "design.md"), (0, ChangeTemplates_1.templateDesign)(changeId));
|
|
454
|
+
}
|
|
443
455
|
if (opts.capability) {
|
|
444
456
|
write(path.join(p.changeSpecs(changeId), opts.capability, "spec.md"), (0, ChangeTemplates_1.templateDelta)(opts.capability, reqRange[0], (0, DiskLanguageRepository_1.phrases)(projectDir)));
|
|
445
457
|
}
|
|
@@ -466,7 +478,11 @@ function cmdNew(opts) {
|
|
|
466
478
|
created.map((f) => ui.fileLine("added", f)).join("") +
|
|
467
479
|
(VERB === "propose"
|
|
468
480
|
? ui.next("specgate apply", "after you write the delta, a test that names each requirement, and the code")
|
|
469
|
-
: ui.next(`specgate change validate ${changeId}`,
|
|
481
|
+
: ui.next(`specgate change validate ${changeId}`,
|
|
482
|
+
// ADR-0042: a layered change starts from its Discover.
|
|
483
|
+
config.schema === ChangeLayers_1.LAYERED_SCHEMA
|
|
484
|
+
? "after you write discover.md, the delta, then design.md and tasks.md"
|
|
485
|
+
: "after you write the proposal, then the delta")));
|
|
470
486
|
});
|
|
471
487
|
}
|
|
472
488
|
/** The open change whose delta already modifies a requirement, if one does (REQ-190). */
|
|
@@ -518,23 +534,35 @@ function cmdList(opts) {
|
|
|
518
534
|
});
|
|
519
535
|
}
|
|
520
536
|
// ── show ──────────────────────────────────────────────────────────────────────
|
|
521
|
-
/**
|
|
537
|
+
/**
|
|
538
|
+
* `change approve <id> [--layer discover|design|tasks]` — a person approves the
|
|
539
|
+
* layers they own; Build waits until every layer is approved (REQ-206, REQ-311).
|
|
540
|
+
*/
|
|
522
541
|
function cmdApprove(opts) {
|
|
523
542
|
const projectDir = (0, project_root_1.resolveProjectDir)(opts.projectDir);
|
|
524
543
|
const id = opts.positional[0];
|
|
525
544
|
const nullShape = { approve: null };
|
|
545
|
+
const layer = opts.layer;
|
|
526
546
|
const r = id
|
|
527
|
-
? (0, change_review_1.approveChange)(projectDir, id, new Date().toISOString().slice(0, 10))
|
|
547
|
+
? (0, change_review_1.approveChange)(projectDir, id, new Date().toISOString().slice(0, 10), layer)
|
|
528
548
|
: { ok: false, code: "change_not_found", message: "approve needs a change id." };
|
|
529
549
|
if (!r.ok) {
|
|
530
550
|
return fail(opts, nullShape, [
|
|
531
551
|
(0, diagnostics_1.error)(r.code, r.message, {
|
|
532
552
|
target: id,
|
|
533
|
-
fix:
|
|
553
|
+
fix: r.fix ||
|
|
554
|
+
"Answer its questions and fix what specgate draft --check reports, then approve again.",
|
|
534
555
|
}),
|
|
535
556
|
]);
|
|
536
557
|
}
|
|
537
|
-
emit(opts, { approve: r }, () =>
|
|
558
|
+
emit(opts, { approve: r }, () => {
|
|
559
|
+
const did = r.layers && r.layers.length ? ` — ${r.layers.join(", ")}` : "";
|
|
560
|
+
process.stdout.write(ui.header("change approve", id) +
|
|
561
|
+
(r.approved
|
|
562
|
+
? ui.ok(`${id} approved on ${r.approved}${did}.`)
|
|
563
|
+
: ui.ok(`Recorded${did}. Still waiting: ${(r.pending || []).join(", ")}.`)) +
|
|
564
|
+
"\n");
|
|
565
|
+
});
|
|
538
566
|
}
|
|
539
567
|
/** `change note <id> "<text>" [--req REQ]` — a change asked in the reviewer's words (REQ-207). */
|
|
540
568
|
function cmdNote(opts) {
|
|
@@ -601,8 +629,11 @@ function cmdShow(opts) {
|
|
|
601
629
|
removed: parsed.removed.map((r) => r.heading),
|
|
602
630
|
};
|
|
603
631
|
});
|
|
604
|
-
|
|
605
|
-
const
|
|
632
|
+
// The Discover of a layered change, the proposal of a 0.27 one.
|
|
633
|
+
const discoverFile = ["discover.md", ChangeLayers_1.LEGACY_DISCOVER]
|
|
634
|
+
.map((f) => path.join(p.change(changeId), f))
|
|
635
|
+
.find((f) => fs.existsSync(f));
|
|
636
|
+
const proposal = discoverFile ? fs.readFileSync(discoverFile, "utf8") : "";
|
|
606
637
|
const titleMatch = /^#\s+(.+)$/m.exec(proposal);
|
|
607
638
|
const progress = (0, ChangeWorkspace_1.taskProgress)(projectDir, changeId);
|
|
608
639
|
emit(opts, {
|
|
@@ -662,7 +693,7 @@ function cmdStatus(opts) {
|
|
|
662
693
|
const isPlanningComplete = artifacts.every((a) => a.status === "done" || a.status === "skipped");
|
|
663
694
|
const nextSteps = artifacts
|
|
664
695
|
.filter((a) => a.status === "ready")
|
|
665
|
-
.map((a) => `Write ${a.outputPath}`);
|
|
696
|
+
.map((a) => `Write ${a.outputPath}${a.owner ? ` (${a.owner})` : ""}`);
|
|
666
697
|
if (isPlanningComplete && progress.remaining > 0) {
|
|
667
698
|
nextSteps.push(`Work through tasks.md (${progress.remaining} remaining)`);
|
|
668
699
|
}
|
|
@@ -883,6 +914,99 @@ function authorPrompt(changeId, artifact, instructions) {
|
|
|
883
914
|
parts.push(`When finished, the change must pass \`specgate change validate ${changeId}\`.`);
|
|
884
915
|
return parts.join("\n");
|
|
885
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* REQ-287: a layered change's Discover as it was agreed — in the commit that
|
|
919
|
+
* recorded the approval, or else the first one that held it — against the
|
|
920
|
+
* working copy. Outside git, or before the first commit, there is nothing to
|
|
921
|
+
* compare with.
|
|
922
|
+
*/
|
|
923
|
+
function storyRewritten(projectDir, changeId) {
|
|
924
|
+
if ((0, ChangeWorkspace_1.readConfig)(projectDir, changeId).schema !== ChangeLayers_1.LAYERED_SCHEMA)
|
|
925
|
+
return null;
|
|
926
|
+
const dir = (0, ChangeWorkspace_1.paths)(projectDir).change(changeId);
|
|
927
|
+
const file = path.join(dir, "discover.md");
|
|
928
|
+
if (!fs.existsSync(file))
|
|
929
|
+
return null;
|
|
930
|
+
const git = (...args) => (0, node_child_process_1.spawnSync)("git", ["-C", projectDir, ...args], { encoding: "utf8" });
|
|
931
|
+
const top = git("rev-parse", "--show-toplevel");
|
|
932
|
+
if (top.status !== 0)
|
|
933
|
+
return null;
|
|
934
|
+
const rel = (f) => path
|
|
935
|
+
.relative(fs.realpathSync.native(top.stdout.trim()), fs.realpathSync.native(f))
|
|
936
|
+
.split(path.sep)
|
|
937
|
+
.join("/");
|
|
938
|
+
const earliest = (args) => {
|
|
939
|
+
const r = git("log", "--format=%h", ...args);
|
|
940
|
+
const shas = r.status === 0 ? r.stdout.trim().split(/\r?\n/).filter(Boolean) : [];
|
|
941
|
+
return shas[shas.length - 1] || "";
|
|
942
|
+
};
|
|
943
|
+
const config = path.join(dir, ChangeWorkspace_1.CHANGE_CONFIG_FILE);
|
|
944
|
+
const approved = (0, ChangeWorkspace_1.readConfig)(projectDir, changeId).approved
|
|
945
|
+
? earliest(["-S", "approved:", "--", rel(config)])
|
|
946
|
+
: "";
|
|
947
|
+
const sha = approved || earliest(["--diff-filter=A", "--", rel(file)]);
|
|
948
|
+
if (!sha)
|
|
949
|
+
return null;
|
|
950
|
+
const baseline = git("show", `${sha}:${rel(file)}`);
|
|
951
|
+
if (baseline.status !== 0)
|
|
952
|
+
return null;
|
|
953
|
+
if (!(0, ChangeLayers_1.discoverRewritten)(baseline.stdout, fs.readFileSync(file, "utf8")))
|
|
954
|
+
return null;
|
|
955
|
+
return (0, diagnostics_1.warning)("layer_discover_rewritten", `discover.md differs from the story agreed at ${sha}${approved ? " (approved)" : ""}.`, {
|
|
956
|
+
target: changeId,
|
|
957
|
+
file: `docs/specs/changes/${changeId}/discover.md`,
|
|
958
|
+
fix: `The business story stays put while the design changes: restore it (\`git checkout ${sha} -- ${rel(file)}\`), or have ${(0, ChangeLayers_1.layer)("discover").owner} agree the new story.`,
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* REQ-350: what `change approve` would refuse a layered change for, said by
|
|
963
|
+
* `change validate` first. A change that validated was refused at approval
|
|
964
|
+
* for a requirement with no kind (truck-flote, MS-10): one rule set, run twice.
|
|
965
|
+
*/
|
|
966
|
+
function notApprovable(projectDir, id) {
|
|
967
|
+
let layeredChange = false;
|
|
968
|
+
try {
|
|
969
|
+
layeredChange = (0, ChangeWorkspace_1.readConfig)(projectDir, id).schema === ChangeLayers_1.LAYERED_SCHEMA;
|
|
970
|
+
}
|
|
971
|
+
catch {
|
|
972
|
+
return [];
|
|
973
|
+
}
|
|
974
|
+
if (!layeredChange)
|
|
975
|
+
return [];
|
|
976
|
+
return (0, change_review_1.approvalBlockers)(projectDir, id)
|
|
977
|
+
.filter((b) => b.code !== "draft_no_specs")
|
|
978
|
+
.map((b) => (0, diagnostics_1.error)("change_not_approvable", b.message, {
|
|
979
|
+
target: id,
|
|
980
|
+
fix: `Fix it before review: \`specgate change approve ${id}\` refuses the change until then.`,
|
|
981
|
+
}));
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* REQ-352: requirements of one change that name the same feature file.
|
|
985
|
+
* Archiving lays one feature file per requirement, so the second replaced the
|
|
986
|
+
* first's scenarios and `check` failed far from the cause (truck-flote, MS-9).
|
|
987
|
+
*/
|
|
988
|
+
function sharedFeatureFiles(projectDir, id) {
|
|
989
|
+
const byFile = new Map();
|
|
990
|
+
for (const d of (0, ChangeWorkspace_1.listDeltas)(projectDir, id)) {
|
|
991
|
+
const delta = (0, SpecParser_1.parseDelta)(fs.readFileSync(d.file, "utf8"));
|
|
992
|
+
for (const r of [...delta.added, ...delta.modified]) {
|
|
993
|
+
const feature = (r.trace && r.trace.feature) || "";
|
|
994
|
+
if (!feature || !r.id)
|
|
995
|
+
continue;
|
|
996
|
+
byFile.set(feature, [...(byFile.get(feature) || []), r.id]);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
const out = [];
|
|
1000
|
+
for (const [file, ids] of byFile) {
|
|
1001
|
+
if (ids.length < 2)
|
|
1002
|
+
continue;
|
|
1003
|
+
out.push((0, diagnostics_1.error)("change_feature_shared", `${ids.join(", ")} all name ${file}: archiving writes one feature file per requirement, so one would replace the others' scenarios.`, {
|
|
1004
|
+
target: id,
|
|
1005
|
+
fix: `Give each requirement a feature file of its own (feature=features/<capability>/${ids[0]}.feature, …).`,
|
|
1006
|
+
}));
|
|
1007
|
+
}
|
|
1008
|
+
return out;
|
|
1009
|
+
}
|
|
886
1010
|
function cmdValidate(opts) {
|
|
887
1011
|
const projectDir = (0, project_root_1.resolveProjectDir)(opts.projectDir);
|
|
888
1012
|
const requested = opts.positional[0];
|
|
@@ -905,6 +1029,10 @@ function cmdValidate(opts) {
|
|
|
905
1029
|
}
|
|
906
1030
|
const items = ids.map((id) => {
|
|
907
1031
|
const result = new ValidateChangeUseCase_1.ValidateChangeUseCase(new DiskProjectRepository_1.DiskProjectRepository(projectDir)).execute(id, opts);
|
|
1032
|
+
const rewritten = storyRewritten(projectDir, id);
|
|
1033
|
+
if (rewritten)
|
|
1034
|
+
result.diagnostics.push(rewritten);
|
|
1035
|
+
result.diagnostics.push(...sharedFeatureFiles(projectDir, id), ...notApprovable(projectDir, id));
|
|
908
1036
|
const failed = opts.strict ? result.diagnostics.length > 0 : (0, diagnostics_1.hasErrors)(result.diagnostics);
|
|
909
1037
|
// What each delta rewrites, as it reads now: on first sight, or on
|
|
910
1038
|
// --rebased once the delta was rewritten over a requirement that moved (REQ-168).
|
|
@@ -955,6 +1083,12 @@ function cmdArchive(opts) {
|
|
|
955
1083
|
}),
|
|
956
1084
|
]);
|
|
957
1085
|
}
|
|
1086
|
+
// REQ-352: two requirements naming one feature file would lose scenarios.
|
|
1087
|
+
if (fs.existsSync((0, ChangeWorkspace_1.paths)(projectDir).change(changeId))) {
|
|
1088
|
+
const shared = sharedFeatureFiles(projectDir, changeId);
|
|
1089
|
+
if (shared.length)
|
|
1090
|
+
return fail(opts, nullShape, shared);
|
|
1091
|
+
}
|
|
958
1092
|
// A draft (a change opened from a brief) is archived only once its
|
|
959
1093
|
// checklist passes: reservas_app archived one with two findings open and
|
|
960
1094
|
// nothing said so (#57). `--force` archives anyway, as it does for tasks.
|