architecture-harness 0.27.0 → 0.27.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "architecture-harness",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Architecture gates, lint rules and scaffolding for the bounded-vertical-slice architecture",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"bin": {
|
|
35
|
-
"qc": "./src/cli/qc.mjs"
|
|
35
|
+
"qc": "./src/cli/qc.mjs",
|
|
36
|
+
"architecture-harness": "./src/cli/qc.mjs"
|
|
36
37
|
},
|
|
37
38
|
"exports": {
|
|
38
39
|
".": "./src/index.mjs",
|
package/src/cli/cli.test.mjs
CHANGED
|
@@ -11,6 +11,14 @@ import { runInit } from "./init.mjs";
|
|
|
11
11
|
import { installHooks } from "./install-hooks.mjs";
|
|
12
12
|
import { runCheck } from "./check.mjs";
|
|
13
13
|
|
|
14
|
+
test("both package bin names point to the existing CLI file", () => {
|
|
15
|
+
const packageUrl = new URL("../../package.json", import.meta.url);
|
|
16
|
+
const { bin } = JSON.parse(readFileSync(packageUrl, "utf8"));
|
|
17
|
+
assert.equal(bin.qc, "./src/cli/qc.mjs");
|
|
18
|
+
assert.equal(bin["architecture-harness"], bin.qc);
|
|
19
|
+
assert.ok(existsSync(new URL(bin.qc, packageUrl)));
|
|
20
|
+
});
|
|
21
|
+
|
|
14
22
|
function repo() {
|
|
15
23
|
const dir = mkdtempSync(path.join(tmpdir(), "qc-cli-"));
|
|
16
24
|
execFileSync("git", ["init", "-q"], { cwd: dir });
|
package/src/cli/fleet-node.mjs
CHANGED
|
@@ -309,7 +309,7 @@ export async function nodeStatus({ root = process.cwd(), fleet, fetch = nodeFetc
|
|
|
309
309
|
const leader = running && record.leader ? fleet.self : recent.find(node => peers[node.id].leader === true && (peers[node.id].term ?? 1) >= highestTerm(root))?.id ?? "unknown";
|
|
310
310
|
const proposal = readState(root, "proposal");
|
|
311
311
|
return `node=${status} leader=${leader} peers=${recent.length}/${others.length}` +
|
|
312
|
-
(proposal.id && validTerm(proposal.term) ? `\nproposed Leader ${proposal.id} term ${proposal.term}: run
|
|
312
|
+
(proposal.id && validTerm(proposal.term) ? `\nproposed Leader ${proposal.id} term ${proposal.term}: run npx architecture-harness fleet confirm-leader` : "");
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
/** Consume assignments only after checking the sender's latest leadership claim. */
|
|
@@ -339,6 +339,8 @@ test("status counts only known other senders in the inclusive 90-second window",
|
|
|
339
339
|
writeState(root, "peers", { a: { time: now, leader: true }, b: { time: now - 90000, leader: true },
|
|
340
340
|
inactive: { time: now - 90001, leader: true }, unaddressed: { time: now + 1, leader: true }, unknown: { time: now, leader: true } });
|
|
341
341
|
assert.equal(await nodeStatus(p.deps), "node=stopped leader=b peers=1/3");
|
|
342
|
+
writeState(root, "proposal", { id: "b", term: 2 });
|
|
343
|
+
assert.match(await nodeStatus(p.deps), /proposed Leader b term 2: run npx architecture-harness fleet confirm-leader/);
|
|
342
344
|
});
|
|
343
345
|
|
|
344
346
|
test("serve schedules heartbeats every 30 seconds, retries every second and closes cleanly", async t => {
|
package/src/cli/fleet.test.mjs
CHANGED
|
@@ -486,7 +486,7 @@ test("status prints the pending Leader proposal", async t => {
|
|
|
486
486
|
writeState(f.cwd, "proposal", { id: "b2", term: 2 });
|
|
487
487
|
const result = await f.run(["status"], { origin: () => "o/r", gh: fakeGh([]), git: () => "" });
|
|
488
488
|
assert.equal(result.code, 0);
|
|
489
|
-
assert.ok(result.lines.includes("proposed Leader b2 term 2: run
|
|
489
|
+
assert.ok(result.lines.includes("proposed Leader b2 term 2: run npx architecture-harness fleet confirm-leader"));
|
|
490
490
|
});
|
|
491
491
|
|
|
492
492
|
|