@rsaglobaltech/specgate 0.23.0 → 0.25.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/CHANGELOG.md +85 -0
- package/dist/packages/core/src/domain/Clarification.js +173 -0
- package/dist/packages/core/src/domain/Clarification.js.map +1 -0
- package/dist/packages/core/src/domain/DoneVerification.js +21 -2
- package/dist/packages/core/src/domain/DoneVerification.js.map +1 -1
- package/dist/packages/core/src/domain/DraftChecklist.js +16 -16
- package/dist/packages/core/src/domain/DraftChecklist.js.map +1 -1
- package/dist/packages/core/src/domain/HarnessRun.js.map +1 -1
- package/dist/packages/core/test/unit/clarification.test.js +161 -0
- package/dist/packages/core/test/unit/clarification.test.js.map +1 -0
- package/dist/packages/core/test/unit/done-verification.test.js +18 -0
- package/dist/packages/core/test/unit/done-verification.test.js.map +1 -1
- package/dist/scripts/answer.js +10 -0
- package/dist/scripts/answer.js.map +1 -0
- package/dist/scripts/ask.js +10 -0
- package/dist/scripts/ask.js.map +1 -0
- package/dist/scripts/brief_add.js +10 -0
- package/dist/scripts/brief_add.js.map +1 -0
- package/dist/scripts/cli/commands/change/ChangeCommand.js +87 -1
- package/dist/scripts/cli/commands/change/ChangeCommand.js.map +1 -1
- package/dist/scripts/cli/commands/harness/RunCommand.js +128 -8
- package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -1
- package/dist/scripts/cli/commands/quality/CheckCommand.js +6 -0
- package/dist/scripts/cli/commands/quality/CheckCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/ClarifyCommands.js +275 -0
- package/dist/scripts/cli/commands/spec/ClarifyCommands.js.map +1 -0
- package/dist/scripts/cli/commands/spec/DoneCommand.js +2 -1
- package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/StudioCommand.js +31 -0
- package/dist/scripts/cli/commands/spec/StudioCommand.js.map +1 -1
- package/dist/scripts/harness/events.js +57 -0
- package/dist/scripts/harness/events.js.map +1 -1
- package/dist/scripts/harness/prompt.js +2 -0
- package/dist/scripts/harness/prompt.js.map +1 -1
- package/dist/scripts/lib/brief-add.js +197 -0
- package/dist/scripts/lib/brief-add.js.map +1 -0
- package/dist/scripts/lib/change-impact.js +156 -0
- package/dist/scripts/lib/change-impact.js.map +1 -0
- package/dist/scripts/lib/clarification.js +300 -0
- package/dist/scripts/lib/clarification.js.map +1 -0
- package/dist/scripts/lib/harness-events.js +32 -1
- package/dist/scripts/lib/harness-events.js.map +1 -1
- package/dist/scripts/lib/harness-guard.js +186 -0
- package/dist/scripts/lib/harness-guard.js.map +1 -0
- package/dist/scripts/lib/in-flight.js +17 -4
- package/dist/scripts/lib/in-flight.js.map +1 -1
- package/dist/scripts/lib/live-detail.js +346 -0
- package/dist/scripts/lib/live-detail.js.map +1 -0
- package/dist/scripts/lib/live-model.js +125 -9
- package/dist/scripts/lib/live-model.js.map +1 -1
- package/dist/scripts/lib/live-page.js +465 -119
- package/dist/scripts/lib/live-page.js.map +1 -1
- package/dist/scripts/lib/surface.js +52 -0
- package/dist/scripts/lib/surface.js.map +1 -1
- package/dist/scripts/questions.js +10 -0
- package/dist/scripts/questions.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PROJECT = void 0;
|
|
37
|
+
exports.allQuestions = allQuestions;
|
|
38
|
+
exports.waiting = waiting;
|
|
39
|
+
exports.answer = answer;
|
|
40
|
+
exports.reviewed = reviewed;
|
|
41
|
+
exports.definedIn = definedIn;
|
|
42
|
+
exports.setWaiting = setWaiting;
|
|
43
|
+
exports.ask = ask;
|
|
44
|
+
const fs = __importStar(require("node:fs"));
|
|
45
|
+
const path = __importStar(require("node:path"));
|
|
46
|
+
const Clarification_1 = require("../../packages/core/src/domain/Clarification");
|
|
47
|
+
const ChangeWorkspace_1 = require("../../packages/core/src/infrastructure/ChangeWorkspace");
|
|
48
|
+
const live_detail_1 = require("./live-detail");
|
|
49
|
+
const MatrixCommand_1 = require("../cli/commands/spec/MatrixCommand");
|
|
50
|
+
/**
|
|
51
|
+
* Questions and answers on disk (REQ-187..189): each open change's
|
|
52
|
+
* `questions.md` and `assumptions.md`, and the project's own
|
|
53
|
+
* `docs/specs/questions.md` for requirements a capability already defines.
|
|
54
|
+
*/
|
|
55
|
+
/** The change a project-level question belongs to, as `questions` prints it. */
|
|
56
|
+
exports.PROJECT = "project";
|
|
57
|
+
const PROJECT_QUESTIONS = path.join("docs", "specs", "questions.md");
|
|
58
|
+
const PROJECT_ASSUMPTIONS = path.join("docs", "specs", "assumptions.md");
|
|
59
|
+
function changeDir(projectDir, change) {
|
|
60
|
+
return path.join(projectDir, "docs", "specs", "changes", change);
|
|
61
|
+
}
|
|
62
|
+
function questionsFile(projectDir, change) {
|
|
63
|
+
return change === exports.PROJECT
|
|
64
|
+
? path.join(projectDir, PROJECT_QUESTIONS)
|
|
65
|
+
: path.join(changeDir(projectDir, change), "questions.md");
|
|
66
|
+
}
|
|
67
|
+
function assumptionsFile(projectDir, change) {
|
|
68
|
+
return change === exports.PROJECT
|
|
69
|
+
? path.join(projectDir, PROJECT_ASSUMPTIONS)
|
|
70
|
+
: path.join(changeDir(projectDir, change), "assumptions.md");
|
|
71
|
+
}
|
|
72
|
+
function read(file) {
|
|
73
|
+
try {
|
|
74
|
+
return fs.readFileSync(file, "utf8");
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function write(file, text) {
|
|
81
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
82
|
+
fs.writeFileSync(file, text.endsWith("\n") ? text : `${text}\n`, "utf8");
|
|
83
|
+
}
|
|
84
|
+
/** Every question of every open change, and of the project. */
|
|
85
|
+
function allQuestions(projectDir) {
|
|
86
|
+
const out = [];
|
|
87
|
+
for (const change of [...(0, ChangeWorkspace_1.listChangeIds)(projectDir), exports.PROJECT]) {
|
|
88
|
+
const file = questionsFile(projectDir, change);
|
|
89
|
+
const md = read(file);
|
|
90
|
+
if (!md)
|
|
91
|
+
continue;
|
|
92
|
+
for (const q of (0, Clarification_1.questionTable)(md)) {
|
|
93
|
+
out.push({ ...q, change, file: path.relative(projectDir, file).split(path.sep).join("/") });
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
/** What waits for an answer: open questions, and requirements in Needs Clarification no open question names. */
|
|
99
|
+
function waiting(projectDir) {
|
|
100
|
+
const questions = allQuestions(projectDir).filter((q) => !q.answered);
|
|
101
|
+
const named = new Set(questions.flatMap((q) => q.blocks));
|
|
102
|
+
const seen = new Set();
|
|
103
|
+
const requirements = [];
|
|
104
|
+
for (const row of (0, live_detail_1.liveMatrix)(projectDir)) {
|
|
105
|
+
if (row.status !== "Needs Clarification" || named.has(row.requirement))
|
|
106
|
+
continue;
|
|
107
|
+
if (seen.has(row.requirement))
|
|
108
|
+
continue;
|
|
109
|
+
seen.add(row.requirement);
|
|
110
|
+
requirements.push({ requirement: row.requirement, title: row.title });
|
|
111
|
+
}
|
|
112
|
+
return { questions, requirements };
|
|
113
|
+
}
|
|
114
|
+
/** The changes that have a question with this id. */
|
|
115
|
+
function changesWith(projectDir, id) {
|
|
116
|
+
return [
|
|
117
|
+
...new Set(allQuestions(projectDir)
|
|
118
|
+
.filter((q) => q.id === id)
|
|
119
|
+
.map((q) => q.change)),
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
function pickChange(projectDir, id, change) {
|
|
123
|
+
const found = changesWith(projectDir, id);
|
|
124
|
+
if (change) {
|
|
125
|
+
if (!found.includes(change)) {
|
|
126
|
+
return {
|
|
127
|
+
ok: false,
|
|
128
|
+
code: "question_not_found",
|
|
129
|
+
message: `${change} has no question ${id}.`,
|
|
130
|
+
changes: found,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return change;
|
|
134
|
+
}
|
|
135
|
+
if (found.length === 0) {
|
|
136
|
+
return {
|
|
137
|
+
ok: false,
|
|
138
|
+
code: "question_not_found",
|
|
139
|
+
message: `No open change has a question ${id}.`,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (found.length > 1) {
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
code: "question_ambiguous",
|
|
146
|
+
message: `${found.length} changes have a question ${id}: ${found.join(", ")}. Say which with --change.`,
|
|
147
|
+
changes: found,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return found[0];
|
|
151
|
+
}
|
|
152
|
+
/** Write the answer, add its assumption to review, and say which requirements to revise (REQ-188). */
|
|
153
|
+
function answer(projectDir, id, text, change) {
|
|
154
|
+
const picked = pickChange(projectDir, id, change);
|
|
155
|
+
if (typeof picked !== "string")
|
|
156
|
+
return picked;
|
|
157
|
+
const qFile = questionsFile(projectDir, picked);
|
|
158
|
+
const written = (0, Clarification_1.answerQuestion)(read(qFile) || "", id, text);
|
|
159
|
+
if (!written.ok) {
|
|
160
|
+
return {
|
|
161
|
+
ok: false,
|
|
162
|
+
code: written.code,
|
|
163
|
+
message: written.code === "answer_deferred"
|
|
164
|
+
? `"${text}" puts the decision off; an answer decides. Answer when it is decided.`
|
|
165
|
+
: `${picked} has no question ${id}.`,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const aFile = assumptionsFile(projectDir, picked);
|
|
169
|
+
const added = (0, Clarification_1.addAssumption)(read(aFile), picked, {
|
|
170
|
+
text,
|
|
171
|
+
usedIn: written.blocks,
|
|
172
|
+
why: id,
|
|
173
|
+
});
|
|
174
|
+
write(qFile, written.md);
|
|
175
|
+
write(aFile, added.md);
|
|
176
|
+
return { ok: true, change: picked, question: id, assumption: added.id, revise: written.blocks };
|
|
177
|
+
}
|
|
178
|
+
/** Mark the question's assumptions reviewed: the spec reflects the answer (REQ-188). */
|
|
179
|
+
function reviewed(projectDir, id, change) {
|
|
180
|
+
const picked = pickChange(projectDir, id, change);
|
|
181
|
+
if (typeof picked !== "string")
|
|
182
|
+
return picked;
|
|
183
|
+
const aFile = assumptionsFile(projectDir, picked);
|
|
184
|
+
const r = (0, Clarification_1.reviewAssumptions)(read(aFile) || "", id);
|
|
185
|
+
if (r.ids.length === 0) {
|
|
186
|
+
return {
|
|
187
|
+
ok: false,
|
|
188
|
+
code: "nothing_to_review",
|
|
189
|
+
message: `No assumption from ${id} is waiting for review in ${picked}.`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
write(aFile, r.md);
|
|
193
|
+
return { ok: true, change: picked, ids: r.ids };
|
|
194
|
+
}
|
|
195
|
+
/** Where a requirement is defined: the open change that adds or modifies it, or the capability spec. */
|
|
196
|
+
function definedIn(projectDir, req) {
|
|
197
|
+
const heading = new RegExp(`^###\\s+Requirement:\\s+${req}\\b`, "m");
|
|
198
|
+
for (const change of (0, ChangeWorkspace_1.listChangeIds)(projectDir)) {
|
|
199
|
+
const specs = path.join(changeDir(projectDir, change), "specs");
|
|
200
|
+
for (const cap of safeDirs(specs)) {
|
|
201
|
+
const file = path.join(specs, cap, "spec.md");
|
|
202
|
+
if (heading.test(read(file) || ""))
|
|
203
|
+
return { change, file };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const caps = path.join(projectDir, "docs", "specs", "capabilities");
|
|
207
|
+
for (const cap of safeDirs(caps)) {
|
|
208
|
+
const file = path.join(caps, cap, "spec.md");
|
|
209
|
+
if (heading.test(read(file) || ""))
|
|
210
|
+
return { change: exports.PROJECT, file };
|
|
211
|
+
}
|
|
212
|
+
const spec = path.join(projectDir, "spec.md");
|
|
213
|
+
if (new RegExp(`^#{2,3}\\s+${req}\\b`, "m").test(read(spec) || ""))
|
|
214
|
+
return { change: exports.PROJECT, file: spec };
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* A requirement of `spec.md` keeps its status in tables — the summary in
|
|
219
|
+
* `spec.md` and the matrix — whose last cell is the status: set both.
|
|
220
|
+
*/
|
|
221
|
+
function setWaitingInTables(projectDir, req) {
|
|
222
|
+
let done = false;
|
|
223
|
+
for (const rel of ["spec.md", path.join("docs", "specs", "traceability.md")]) {
|
|
224
|
+
const file = path.join(projectDir, rel);
|
|
225
|
+
const text = read(file);
|
|
226
|
+
if (!text)
|
|
227
|
+
continue;
|
|
228
|
+
const row = new RegExp(`^(\\|\\s*${req}\\s*\\|.*\\|)\\s*[^|]+?\\s*\\|\\s*$`, "gm");
|
|
229
|
+
const next = text.replace(row, (_m, head) => `${head} Needs Clarification |`);
|
|
230
|
+
if (next !== text) {
|
|
231
|
+
write(file, next);
|
|
232
|
+
done = true;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return done;
|
|
236
|
+
}
|
|
237
|
+
function safeDirs(dir) {
|
|
238
|
+
try {
|
|
239
|
+
return fs
|
|
240
|
+
.readdirSync(dir, { withFileTypes: true })
|
|
241
|
+
.filter((e) => e.isDirectory())
|
|
242
|
+
.map((e) => e.name);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The requirement's trace status set to Needs Clarification in the file that
|
|
250
|
+
* defines it, and the derived matrix refreshed. `apply` writes only the
|
|
251
|
+
* statuses a delivery moves through, and this one is not.
|
|
252
|
+
*/
|
|
253
|
+
function setWaiting(file, projectDir, req) {
|
|
254
|
+
if (path.basename(file) === "spec.md" && path.dirname(file) === projectDir) {
|
|
255
|
+
return setWaitingInTables(projectDir, req);
|
|
256
|
+
}
|
|
257
|
+
const lines = (read(file) || "").split("\n");
|
|
258
|
+
const head = new RegExp(`^(?:###\\s+Requirement:|##)\\s+${req}\\b`);
|
|
259
|
+
const start = lines.findIndex((l) => head.test(l));
|
|
260
|
+
if (start === -1)
|
|
261
|
+
return false;
|
|
262
|
+
for (let i = start + 1; i < lines.length && !/^#{2,3}\s(?!#)/.test(lines[i]); i += 1) {
|
|
263
|
+
if (!/<!--\s*specgate:trace\b/.test(lines[i]))
|
|
264
|
+
continue;
|
|
265
|
+
lines[i] = /\bstatus=/.test(lines[i])
|
|
266
|
+
? lines[i].replace(/\bstatus=(?:"[^"]*"|[^\s"]+?)(?=\s|-->)/, 'status="Needs Clarification"')
|
|
267
|
+
: lines[i].replace(/<!--\s*specgate:trace/, '<!-- specgate:trace status="Needs Clarification"');
|
|
268
|
+
write(file, lines.join("\n"));
|
|
269
|
+
try {
|
|
270
|
+
(0, MatrixCommand_1.refreshDerivedMatrix)(projectDir);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
/* the next validate refreshes it */
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
/** Add the question to where the requirement is defined, and set it waiting (REQ-189). */
|
|
280
|
+
function ask(projectDir, req, text) {
|
|
281
|
+
const where = definedIn(projectDir, req);
|
|
282
|
+
if (!where) {
|
|
283
|
+
return {
|
|
284
|
+
ok: false,
|
|
285
|
+
code: "requirement_not_found",
|
|
286
|
+
message: `${req} is not defined by an open change or a capability spec.`,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
const qFile = questionsFile(projectDir, where.change);
|
|
290
|
+
const added = (0, Clarification_1.addQuestion)(read(qFile), where.change, text, [req]);
|
|
291
|
+
write(qFile, added.md);
|
|
292
|
+
setWaiting(where.file, projectDir, req);
|
|
293
|
+
return {
|
|
294
|
+
ok: true,
|
|
295
|
+
change: where.change,
|
|
296
|
+
question: added.id,
|
|
297
|
+
file: path.relative(projectDir, qFile).split(path.sep).join("/"),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=clarification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clarification.js","sourceRoot":"","sources":["../../../scripts/lib/clarification.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,oCAWC;AAGD,0BAeC;AAuDD,wBA6BC;AAGD,4BAkBC;AAGD,8BAqBC;AAsCD,gCAyBC;AAGD,kBAyBC;AArTD,4CAA8B;AAC9B,gD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QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -33,9 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.EVENTS_DIR = void 0;
|
|
36
|
+
exports.QUEUE_FILE = exports.EVENTS_DIR = void 0;
|
|
37
37
|
exports.eventsFileFor = eventsFileFor;
|
|
38
38
|
exports.appendEvent = appendEvent;
|
|
39
|
+
exports.writeQueue = writeQueue;
|
|
40
|
+
exports.promptFileFor = promptFileFor;
|
|
41
|
+
exports.keepPrompt = keepPrompt;
|
|
39
42
|
const fs = __importStar(require("node:fs"));
|
|
40
43
|
const path = __importStar(require("node:path"));
|
|
41
44
|
const HarnessEvents_1 = require("../../packages/core/src/domain/HarnessEvents");
|
|
@@ -71,4 +74,32 @@ function appendEvent(file, event, req, attempt, env = process.env) {
|
|
|
71
74
|
/* the view must not break the run */
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
/** The run's queue, in the order it works through it (REQ-182). */
|
|
78
|
+
exports.QUEUE_FILE = "queue.json";
|
|
79
|
+
/** Record which requirements this run will work on, in order; never throws. */
|
|
80
|
+
function writeQueue(projectDir, reqs, t = Math.floor(Date.now() / 1000)) {
|
|
81
|
+
try {
|
|
82
|
+
const dir = path.dirname(eventsFileFor(projectDir, "x"));
|
|
83
|
+
fs.writeFileSync(path.join(dir, exports.QUEUE_FILE), JSON.stringify({ t, queue: reqs }), "utf8");
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
/* the view must not break the run */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** Where the live view keeps the prompt an attempt was given, git-ignored with the events. */
|
|
90
|
+
function promptFileFor(projectDir, req, attempt) {
|
|
91
|
+
return path.join(projectDir, exports.EVENTS_DIR, "prompts", `${req}-${attempt}.md`);
|
|
92
|
+
}
|
|
93
|
+
/** Keep the prompt an attempt was given, for the live view; never throws. */
|
|
94
|
+
function keepPrompt(projectDir, req, attempt, prompt) {
|
|
95
|
+
try {
|
|
96
|
+
eventsFileFor(projectDir, req);
|
|
97
|
+
const file = promptFileFor(projectDir, req, attempt);
|
|
98
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
99
|
+
fs.writeFileSync(file, prompt, "utf8");
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
/* the view must not break the run */
|
|
103
|
+
}
|
|
104
|
+
}
|
|
74
105
|
//# sourceMappingURL=harness-events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-events.js","sourceRoot":"","sources":["../../../scripts/lib/harness-events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,sCAUC;AAGD,kCAeC;
|
|
1
|
+
{"version":3,"file":"harness-events.js","sourceRoot":"","sources":["../../../scripts/lib/harness-events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,sCAUC;AAGD,kCAeC;AAMD,gCAWC;AAGD,sCAEC;AAGD,gCASC;AA/ED,4CAA8B;AAC9B,gDAAkC;AAClC,gFAKsD;AAEtD;;;GAGG;AAEU,QAAA,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE1D,oFAAoF;AACpF,SAAgB,aAAa,CAAC,UAAkB,EAAE,GAAW;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAU,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CA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AAC,CAAC;QACzD,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;AACH,CAAC;AAED,8FAA8F;AAC9F,SAAgB,aAAa,CAAC,UAAkB,EAAE,GAAW,EAAE,OAAe;IAC5E,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAU,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,OAAO,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,6EAA6E;AAC7E,SAAgB,UAAU,CAAC,UAAkB,EAAE,GAAW,EAAE,OAAe,EAAE,MAAc;IACzF,IAAI,CAAC;QACH,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACrD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.copyableFiles = copyableFiles;
|
|
37
|
+
exports.freeBytes = freeBytes;
|
|
38
|
+
exports.minFreeBytes = minFreeBytes;
|
|
39
|
+
exports.lowDiskMessage = lowDiskMessage;
|
|
40
|
+
exports.orderAsGiven = orderAsGiven;
|
|
41
|
+
exports.existingBranchAction = existingBranchAction;
|
|
42
|
+
exports.branchMergedInto = branchMergedInto;
|
|
43
|
+
exports.runLockHolder = runLockHolder;
|
|
44
|
+
exports.acquireRunLock = acquireRunLock;
|
|
45
|
+
const fs = __importStar(require("node:fs"));
|
|
46
|
+
const path = __importStar(require("node:path"));
|
|
47
|
+
const node_child_process_1 = require("node:child_process");
|
|
48
|
+
/**
|
|
49
|
+
* What keeps a long harness run from hurting itself (REQ-184..186): copies
|
|
50
|
+
* that leave build caches behind, a disk that fills up, an order nobody asked
|
|
51
|
+
* for, old branches in the way, and two runs in one working copy.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* The files a copy of the project needs: everything git tracks or would track,
|
|
55
|
+
* relative to `dir`. Build caches, dependencies and test output are ignored by
|
|
56
|
+
* the project and stay out — the in-flight copy of a web app carried its whole
|
|
57
|
+
* `.next/cache` until the disk was full (REQ-184). `null` outside a git
|
|
58
|
+
* repository.
|
|
59
|
+
*/
|
|
60
|
+
function copyableFiles(dir) {
|
|
61
|
+
const r = (0, node_child_process_1.spawnSync)("git", ["ls-files", "-z", "--cached", "--others", "--exclude-standard"], {
|
|
62
|
+
cwd: dir,
|
|
63
|
+
encoding: "utf8",
|
|
64
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
65
|
+
});
|
|
66
|
+
if (r.status !== 0)
|
|
67
|
+
return null;
|
|
68
|
+
return [...new Set(r.stdout.split("\0").filter(Boolean))].filter((f) => fs.existsSync(path.join(dir, f)));
|
|
69
|
+
}
|
|
70
|
+
const GB = 1024 ** 3;
|
|
71
|
+
const gb = (n) => `${Math.round((n / GB) * 10) / 10} GB`;
|
|
72
|
+
/** The free space under `dir`, in bytes; `null` when the platform cannot say. */
|
|
73
|
+
function freeBytes(dir) {
|
|
74
|
+
try {
|
|
75
|
+
const st = fs.statfsSync(dir);
|
|
76
|
+
return Number(st.bavail) * Number(st.bsize);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** The free space a requirement needs before it starts: 2 GB, or SPECGATE_HARNESS_MIN_FREE_GB. */
|
|
83
|
+
function minFreeBytes(env = process.env) {
|
|
84
|
+
const n = Number(env.SPECGATE_HARNESS_MIN_FREE_GB);
|
|
85
|
+
return (Number.isFinite(n) && n >= 0 ? n : 2) * GB;
|
|
86
|
+
}
|
|
87
|
+
/** Why a requirement should not start for lack of disk, or `null` when there is room. */
|
|
88
|
+
function lowDiskMessage(free, min, where) {
|
|
89
|
+
if (free === null || free >= min)
|
|
90
|
+
return null;
|
|
91
|
+
return (`only ${gb(free)} free on ${where}; a requirement needs at least ${gb(min)} ` +
|
|
92
|
+
`(a worktree, its dependencies and its build). Free some space and re-run; ` +
|
|
93
|
+
`SPECGATE_HARNESS_MIN_FREE_GB changes the threshold.`);
|
|
94
|
+
}
|
|
95
|
+
/** The requirements in the order `--req` gave them; the plan's order without it (REQ-185). */
|
|
96
|
+
function orderAsGiven(pending, given) {
|
|
97
|
+
if (given.length === 0)
|
|
98
|
+
return pending;
|
|
99
|
+
const at = new Map(given.map((id, i) => [id, i]));
|
|
100
|
+
return [...pending].sort((a, b) => (at.get(a.requirement) ?? Infinity) - (at.get(b.requirement) ?? Infinity));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* What to do with a requirement's branch before it runs (REQ-185). A branch
|
|
104
|
+
* already merged into the one the run starts from holds nothing that would be
|
|
105
|
+
* lost: it is recreated, as `--force` would, without asking for `--force`.
|
|
106
|
+
*/
|
|
107
|
+
function existingBranchAction(b) {
|
|
108
|
+
if (!b.exists)
|
|
109
|
+
return "new";
|
|
110
|
+
if (b.resume)
|
|
111
|
+
return "resume";
|
|
112
|
+
if (b.force || b.merged)
|
|
113
|
+
return "recreate";
|
|
114
|
+
return "skip";
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Whether a requirement's branch holds work and all of it is already in
|
|
118
|
+
* `base` (REQ-185). A branch with no commit of its own does not count: an
|
|
119
|
+
* interrupted attempt leaves one, with its work in a worktree still to resume.
|
|
120
|
+
*/
|
|
121
|
+
function branchMergedInto(projectDir, branch, base) {
|
|
122
|
+
const run = (...args) => (0, node_child_process_1.spawnSync)("git", args, { cwd: projectDir, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
|
|
123
|
+
const tip = run("rev-parse", "--verify", "--quiet", branch).stdout.trim();
|
|
124
|
+
if (!tip)
|
|
125
|
+
return false;
|
|
126
|
+
if (run("merge-base", "--is-ancestor", tip, base).status !== 0)
|
|
127
|
+
return false;
|
|
128
|
+
// On the base's own line, the tip is a commit the base already had: the
|
|
129
|
+
// branch made nothing. Merged work reaches the base through a merge.
|
|
130
|
+
const line = new Set(run("rev-list", "--first-parent", base).stdout.split("\n"));
|
|
131
|
+
if (line.has(tip))
|
|
132
|
+
return false;
|
|
133
|
+
return !run("worktree", "list", "--porcelain").stdout.includes(`branch refs/heads/${branch}`);
|
|
134
|
+
}
|
|
135
|
+
// Beside the events, which git ignores: a lock that showed as an untracked
|
|
136
|
+
// file made the run's own workers refuse a working tree that was not clean.
|
|
137
|
+
const LOCK = path.join(".harness", "events", "run.lock");
|
|
138
|
+
function alive(pid) {
|
|
139
|
+
try {
|
|
140
|
+
process.kill(pid, 0);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
return e.code === "EPERM";
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** The run holding the working copy, or `null` when none does (a lock whose process is gone does not count). */
|
|
148
|
+
function runLockHolder(projectDir) {
|
|
149
|
+
try {
|
|
150
|
+
const lock = JSON.parse(fs.readFileSync(path.join(projectDir, LOCK), "utf8"));
|
|
151
|
+
return Number.isInteger(lock.pid) && alive(lock.pid) ? lock : null;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Take the working copy for this run (REQ-186): the post-merge gate runs in it,
|
|
159
|
+
* and a second run, or tests started by hand, sharing it broke that gate and
|
|
160
|
+
* undid a merge whose attempt had passed. Returns the release, or `null` when
|
|
161
|
+
* another live run holds it.
|
|
162
|
+
*/
|
|
163
|
+
function acquireRunLock(projectDir, reqs) {
|
|
164
|
+
if (runLockHolder(projectDir))
|
|
165
|
+
return null;
|
|
166
|
+
const file = path.join(projectDir, LOCK);
|
|
167
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
168
|
+
const ignore = path.join(path.dirname(file), ".gitignore");
|
|
169
|
+
if (!fs.existsSync(ignore))
|
|
170
|
+
fs.writeFileSync(ignore, "*\n", "utf8");
|
|
171
|
+
const lock = { pid: process.pid, started: Math.floor(Date.now() / 1000), reqs };
|
|
172
|
+
fs.writeFileSync(file, JSON.stringify(lock), "utf8");
|
|
173
|
+
const release = () => {
|
|
174
|
+
try {
|
|
175
|
+
const now = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
176
|
+
if (now.pid === process.pid)
|
|
177
|
+
fs.rmSync(file, { force: true });
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
/* already gone */
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
process.once("exit", release);
|
|
184
|
+
return release;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=harness-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-guard.js","sourceRoot":"","sources":["../../../scripts/lib/harness-guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,sCAUC;AAMD,8BAOC;AAGD,oCAGC;AAGD,wCAOC;AAGD,oCASC;AAOD,oDAUC;AAOD,4CAWC;AAsBD,sCAOC;AAQD,wCAkBC;AA9JD,4CAA8B;AAC9B,gDAAkC;AAClC,2DAA+C;AAE/C;;;;GAIG;AAEH;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,GAAW;IACvC,MAAM,CAAC,GAAG,IAAA,8BAAS,EAAC,KAAK,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,EAAE;QAC3F,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,MAAM;QAChB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,CAAC,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY,CAAC;YACjE,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG;gBAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,CAAC;QAAC,MAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -40,6 +40,7 @@ exports.inFlightRequirements = inFlightRequirements;
|
|
|
40
40
|
exports.changeRequirements = changeRequirements;
|
|
41
41
|
exports.inFlightView = inFlightView;
|
|
42
42
|
const fs = __importStar(require("node:fs"));
|
|
43
|
+
const harness_guard_1 = require("./harness-guard");
|
|
43
44
|
const os = __importStar(require("node:os"));
|
|
44
45
|
const path = __importStar(require("node:path"));
|
|
45
46
|
const SpecParser_1 = require("../../packages/core/src/domain/SpecParser");
|
|
@@ -150,10 +151,22 @@ function inFlightView(projectDir) {
|
|
|
150
151
|
// Commands leave through process.exit(), which skips `finally`: the copy is
|
|
151
152
|
// removed on exit too.
|
|
152
153
|
process.once("exit", cleanup);
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
// What git keeps, never build caches or dependencies (REQ-184); a folder
|
|
155
|
+
// outside git falls back to skipping the usual ones by name.
|
|
156
|
+
const files = (0, harness_guard_1.copyableFiles)(projectDir);
|
|
157
|
+
if (files) {
|
|
158
|
+
for (const f of files) {
|
|
159
|
+
const to = path.join(dir, f);
|
|
160
|
+
fs.mkdirSync(path.dirname(to), { recursive: true });
|
|
161
|
+
fs.copyFileSync(path.join(projectDir, f), to);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
fs.cpSync(projectDir, dir, {
|
|
166
|
+
recursive: true,
|
|
167
|
+
filter: (src) => !SKIP.has(path.basename(src)),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
157
170
|
const problems = [];
|
|
158
171
|
const repo = new DiskProjectRepository_1.DiskProjectRepository(dir);
|
|
159
172
|
for (const change of (0, ChangeWorkspace_1.listChangeIds)(dir)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-flight.js","sourceRoot":"","sources":["../../../scripts/lib/in-flight.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"in-flight.js","sourceRoot":"","sources":["../../../scripts/lib/in-flight.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,4CAKC;AAGD,wCAQC;AAGD,oDAMC;AAGD,gDAsBC;AAoCD,oCA4DC;AAvMD,4CAA8B;AAC9B,mDAAgD;AAChD,4CAA8B;AAC9B,gDAAkC;AAClC,0EAAuE;AACvE,mGAAgG;AAChG,wGAAqG;AACrG,4FAAmG;AAEnG,oFAAkF;AAClF,+CAAqC;AACrC,sEAA0E;AAG1E;;;;;;;;;;;GAWG;AAEH,sFAAsF;AACzE,QAAA,SAAS,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAWjE,gFAAgF;AAChF,SAAS,SAAS,CAAC,CAAc;IAC/B,IAAI,CAAC;QACH,OAAO,IAAA,kCAAgB,EAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;A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