@mstar-harness/cli 4.0.8 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mstar-harness.js +48 -16
- package/package.json +1 -1
package/dist/mstar-harness.js
CHANGED
|
@@ -56,6 +56,7 @@ __export(exports_engine, {
|
|
|
56
56
|
AUDIT_EFFORTS: () => AUDIT_EFFORTS,
|
|
57
57
|
AUDIT_PRIORITIES: () => AUDIT_PRIORITIES,
|
|
58
58
|
AUDIT_RISKS: () => AUDIT_RISKS,
|
|
59
|
+
BUDGET_LABELS: () => BUDGET_LABELS,
|
|
59
60
|
CATALOG_EXPORT_VERSION: () => CATALOG_EXPORT_VERSION,
|
|
60
61
|
CATALOG_IMPORT_PLAN_VERSION: () => CATALOG_IMPORT_PLAN_VERSION,
|
|
61
62
|
CATALOG_REGISTRATION_JOURNAL_VERSION: () => CATALOG_REGISTRATION_JOURNAL_VERSION,
|
|
@@ -126,7 +127,9 @@ __export(exports_engine, {
|
|
|
126
127
|
ProjectionError: () => ProjectionError,
|
|
127
128
|
QC_REVIEWER_PARAMS: () => QC_REVIEWER_PARAMS,
|
|
128
129
|
QC_VERDICTS: () => QC_VERDICTS,
|
|
130
|
+
RETURN_SHAPE_LABELS: () => RETURN_SHAPE_LABELS,
|
|
129
131
|
REVIEW_EMOJI: () => REVIEW_EMOJI,
|
|
132
|
+
REVIEW_SEAT_ROLES: () => REVIEW_SEAT_ROLES,
|
|
130
133
|
ROADMAP_STATUSES: () => ROADMAP_STATUSES,
|
|
131
134
|
ROLE_MAPPING: () => ROLE_MAPPING,
|
|
132
135
|
RUNTIME_HEADING_ALIASES: () => RUNTIME_HEADING_ALIASES,
|
|
@@ -12328,7 +12331,7 @@ function withExecutionTransaction(context, transition) {
|
|
|
12328
12331
|
}
|
|
12329
12332
|
});
|
|
12330
12333
|
}
|
|
12331
|
-
async function withExecutionReadTransaction(context, body) {
|
|
12334
|
+
async function withExecutionReadTransaction(context, body, requires = "ordinary execution reads require an active authority") {
|
|
12332
12335
|
const handle = await openStore(context, "read");
|
|
12333
12336
|
try {
|
|
12334
12337
|
if (handle.execution === null) {
|
|
@@ -12339,7 +12342,7 @@ async function withExecutionReadTransaction(context, body) {
|
|
|
12339
12342
|
try {
|
|
12340
12343
|
const meta = readExecutionMetaRow(db);
|
|
12341
12344
|
if (meta.authorityState !== "active") {
|
|
12342
|
-
throw new ExecutionError("execution.not-active", `the execution authority is ${meta.authorityState};
|
|
12345
|
+
throw new ExecutionError("execution.not-active", `the execution authority is ${meta.authorityState}; ${requires}. ` + `A staged store is inspectable only through migration diagnostics.`);
|
|
12343
12346
|
}
|
|
12344
12347
|
const store = readStoreIdentity(db);
|
|
12345
12348
|
const result = body({ db, storeId: store.storeId, epoch: store.epoch, execution: meta });
|
|
@@ -13185,7 +13188,7 @@ async function readWorkflowOperationReplayBeforeProof(context, read, input) {
|
|
|
13185
13188
|
if (replay === null)
|
|
13186
13189
|
return null;
|
|
13187
13190
|
return { replay, storeId: tx.storeId, epoch: tx.epoch, revision: requireWorkflowState(tx, read.workflowId).revision };
|
|
13188
|
-
});
|
|
13191
|
+
}, "a workflow transition requires an active authority");
|
|
13189
13192
|
}
|
|
13190
13193
|
function readOperationReplay(tx, input) {
|
|
13191
13194
|
const recorded = readCommittedOperation(tx.db, tx.epoch, input.operationId);
|
|
@@ -15749,7 +15752,7 @@ function projectBucketOf(row) {
|
|
|
15749
15752
|
try {
|
|
15750
15753
|
assertSafePathComponent(metadata.project_id, "metadata.project_id");
|
|
15751
15754
|
} catch (error) {
|
|
15752
|
-
throw new CoordinationError("coordination.invalid-input",
|
|
15755
|
+
throw new CoordinationError("coordination.invalid-input", "Invalid metadata.project_id: it must be a single safe path component. Correct the plan row's project_id, then retry. Inspect workflow state with mstar status validate.", { field: "metadata.project_id", cause: error instanceof Error ? error.message : String(error) });
|
|
15753
15756
|
}
|
|
15754
15757
|
return metadata.project_id;
|
|
15755
15758
|
}
|
|
@@ -36902,7 +36905,7 @@ import fs23 from "node:fs";
|
|
|
36902
36905
|
// package.json
|
|
36903
36906
|
var package_default = {
|
|
36904
36907
|
name: "@mstar-harness/cli",
|
|
36905
|
-
version: "4.0.
|
|
36908
|
+
version: "4.0.9",
|
|
36906
36909
|
description: "Morning Star harness CLI \u2014 installer bootstrap, canonical command adapter, and stdio MCP server.",
|
|
36907
36910
|
repository: {
|
|
36908
36911
|
type: "git",
|
|
@@ -36952,7 +36955,7 @@ var package_default = {
|
|
|
36952
36955
|
// ../engine/package.json
|
|
36953
36956
|
var package_default2 = {
|
|
36954
36957
|
name: "@mstar-harness/engine",
|
|
36955
|
-
version: "4.0.
|
|
36958
|
+
version: "4.0.9",
|
|
36956
36959
|
description: "Morning Star Harness Workflow Engine \u2014 deterministic workflow enforcement library (path, status, lease, dispatch, sdd, iteration, lint gates).",
|
|
36957
36960
|
license: "MIT",
|
|
36958
36961
|
repository: {
|
|
@@ -57687,7 +57690,7 @@ import { existsSync as existsSync32, readdirSync as readdirSync19, readFileSync
|
|
|
57687
57690
|
import { randomUUID as randomUUID52 } from "node:crypto";
|
|
57688
57691
|
import path15 from "node:path";
|
|
57689
57692
|
init_engine();
|
|
57690
|
-
import { readFileSync as readFileSync62, writeFileSync as writeFileSync22 } from "node:fs";
|
|
57693
|
+
import { readFileSync as readFileSync62, realpathSync as realpathSync22, statSync as statSync11, writeFileSync as writeFileSync22 } from "node:fs";
|
|
57691
57694
|
import path16 from "node:path";
|
|
57692
57695
|
init_engine();
|
|
57693
57696
|
import { randomUUID as randomUUID62 } from "node:crypto";
|
|
@@ -57705,19 +57708,19 @@ init_engine();
|
|
|
57705
57708
|
import { readFileSync as readFileSync102 } from "node:fs";
|
|
57706
57709
|
import path20 from "node:path";
|
|
57707
57710
|
init_engine();
|
|
57708
|
-
import { existsSync as existsSync42, readFileSync as readFileSync112, readdirSync as readdirSync22, realpathSync as
|
|
57711
|
+
import { existsSync as existsSync42, readFileSync as readFileSync112, readdirSync as readdirSync22, realpathSync as realpathSync32, statSync as statSync22 } from "node:fs";
|
|
57709
57712
|
import path222 from "node:path";
|
|
57710
57713
|
init_engine();
|
|
57711
57714
|
import path21 from "node:path";
|
|
57712
57715
|
import { execFileSync as execFileSync22 } from "node:child_process";
|
|
57713
|
-
import { existsSync as existsSync52, readFileSync as readFileSync122, statSync as
|
|
57716
|
+
import { existsSync as existsSync52, readFileSync as readFileSync122, statSync as statSync32 } from "node:fs";
|
|
57714
57717
|
import path23 from "node:path";
|
|
57715
57718
|
init_engine();
|
|
57716
57719
|
import { existsSync as existsSync62, readFileSync as readFileSync132, renameSync as renameSync3, unlinkSync as unlinkSync5, openSync as openSync7, fstatSync as fstatSync6, lstatSync as lstatSync5, closeSync as closeSync7, linkSync as linkSync2 } from "node:fs";
|
|
57717
57720
|
import path24 from "node:path";
|
|
57718
57721
|
import { randomUUID as randomUUID72 } from "node:crypto";
|
|
57719
57722
|
init_engine();
|
|
57720
|
-
import fs13, { realpathSync as
|
|
57723
|
+
import fs13, { realpathSync as realpathSync42 } from "node:fs";
|
|
57721
57724
|
import { createHash as createHash22 } from "node:crypto";
|
|
57722
57725
|
import path25 from "node:path";
|
|
57723
57726
|
import { closeSync as closeSync22, constants as fsConstants2, fstatSync as fstatSync22, lstatSync as lstatSync22, openSync as openSync22, readFileSync as readFileSync142 } from "node:fs";
|
|
@@ -62976,10 +62979,39 @@ function targetRefusal(id, supplied) {
|
|
|
62976
62979
|
}]
|
|
62977
62980
|
});
|
|
62978
62981
|
}
|
|
62982
|
+
function probeIdentity(target) {
|
|
62983
|
+
try {
|
|
62984
|
+
const real = realpathSync22(target);
|
|
62985
|
+
const stats = statSync11(real);
|
|
62986
|
+
return { kind: "identity", real, dev: stats.dev, ino: stats.ino };
|
|
62987
|
+
} catch (error62) {
|
|
62988
|
+
const code2 = error62.code;
|
|
62989
|
+
return code2 === "ENOENT" ? { kind: "absent" } : { kind: "unreadable", reason: code2 ?? String(error62) };
|
|
62990
|
+
}
|
|
62991
|
+
}
|
|
62992
|
+
function controlRootRefusal(verb, target, real) {
|
|
62993
|
+
const cause = real === null || real === target ? `the resolved target ${target} is this invocation's control root` : `the resolved target ${target} resolves to ${real}, which is this invocation's control root`;
|
|
62994
|
+
return new SddScriptError(`${verb}: ${cause}, and a control root is not an admitted execution target. ` + "Pass --harness <absolute-path> naming a harness other than this control root, or invoke from a checkout where no control root is discovered. " + "To back up or move a control root's own store, use mstar store backup.", 2);
|
|
62995
|
+
}
|
|
62979
62996
|
function executionContext(target, invocation, verb) {
|
|
62980
62997
|
const root = path16.resolve(target);
|
|
62981
|
-
if (invocation.controlRoot !== null
|
|
62982
|
-
|
|
62998
|
+
if (invocation.controlRoot !== null) {
|
|
62999
|
+
if (root === path16.resolve(invocation.controlRoot))
|
|
63000
|
+
throw controlRootRefusal(verb, root, null);
|
|
63001
|
+
const control = probeIdentity(invocation.controlRoot);
|
|
63002
|
+
if (control.kind === "unreadable") {
|
|
63003
|
+
throw new SddScriptError(`${verb}: this invocation's control root ${invocation.controlRoot} cannot be resolved for identity comparison (${control.reason}), so ${root} cannot be compared with it. ` + "Run the call from a checkout whose control root is readable, or from one where no control root is discovered.", 2);
|
|
63004
|
+
}
|
|
63005
|
+
if (control.kind === "identity") {
|
|
63006
|
+
const named = probeIdentity(root);
|
|
63007
|
+
if (named.kind !== "identity") {
|
|
63008
|
+
const why = named.kind === "absent" ? "does not resolve to a readable path" : `cannot be resolved for identity comparison (${named.reason})`;
|
|
63009
|
+
throw new SddScriptError(`${verb}: the target ${root} ${why}, so it cannot be compared with this invocation's control root ${control.real}. ` + "Pass --harness <absolute-path> naming an existing harness directory.", 2);
|
|
63010
|
+
}
|
|
63011
|
+
if (named.real === control.real || named.dev === control.dev && named.ino === control.ino) {
|
|
63012
|
+
throw controlRootRefusal(verb, root, named.real);
|
|
63013
|
+
}
|
|
63014
|
+
}
|
|
62983
63015
|
}
|
|
62984
63016
|
return { harnessDir: root };
|
|
62985
63017
|
}
|
|
@@ -64355,7 +64387,7 @@ function absolute4(cwd, input2) {
|
|
|
64355
64387
|
}
|
|
64356
64388
|
function canonicalPath2(target) {
|
|
64357
64389
|
try {
|
|
64358
|
-
return
|
|
64390
|
+
return realpathSync32(target);
|
|
64359
64391
|
} catch {
|
|
64360
64392
|
return path222.resolve(target);
|
|
64361
64393
|
}
|
|
@@ -64654,7 +64686,7 @@ async function execute8(id, input2, context2) {
|
|
|
64654
64686
|
const abs = absolute4(context2.cwd, target);
|
|
64655
64687
|
if (!existsSync42(abs))
|
|
64656
64688
|
throw new Error(`lint target not found: ${abs}`);
|
|
64657
|
-
const isDir =
|
|
64689
|
+
const isDir = statSync22(abs).isDirectory();
|
|
64658
64690
|
const targets = !isDir ? [abs] : forced === "provenance" ? collectTargets(abs, (file2) => provenanceExtensions[path222.extname(file2).toLowerCase()] === true) : collectTargets(abs);
|
|
64659
64691
|
const results = targets.map((file2) => ({ file: file2, ...lintOne(file2, forced, input2.prVariant === true) }));
|
|
64660
64692
|
return results.some((result) => result.violations.length) ? refusal(id, results.flatMap((r) => r.violations)[0]?.code ?? "lint.violations", "lint violations found", { results }, "Resolve each reported lint violation, then rerun mstar lint <target>.") : ok11(id, { results });
|
|
@@ -65039,7 +65071,7 @@ async function execute9(verb, input2, context2) {
|
|
|
65039
65071
|
if (unnamedRepository !== undefined)
|
|
65040
65072
|
return unnamedRepository;
|
|
65041
65073
|
const root = resolvePath(context2.cwd, input2.path ?? ".");
|
|
65042
|
-
if (!existsSync52(root) || !
|
|
65074
|
+
if (!existsSync52(root) || !statSync32(root).isDirectory())
|
|
65043
65075
|
throw new SddScriptError(`not a directory: ${root}`, 2);
|
|
65044
65076
|
if (verb === "secret-scan") {
|
|
65045
65077
|
const process2 = context2.effects.spawn;
|
|
@@ -65732,7 +65764,7 @@ async function setupReviewWorktree(input2, invocation) {
|
|
|
65732
65764
|
const existing = new Set((await git(invocation, ["for-each-ref", "--format=%(refname:short)", "refs/heads"], repoRoot)).split(/\r?\n/).filter(Boolean));
|
|
65733
65765
|
const seed = mode === "pr" ? prNumber : Math.abs([...headSpec].reduce((hash3, char) => (hash3 * 31 + char.charCodeAt(0)) % 1000003, 7)) || 1;
|
|
65734
65766
|
const reviewBranch = pickReviewBranchName(existing, seed, new Date().toISOString().slice(0, 10).replace(/-/g, ""));
|
|
65735
|
-
const repoReal =
|
|
65767
|
+
const repoReal = realpathSync42(repoRoot);
|
|
65736
65768
|
const defaultRoot = path25.join(path25.dirname(repoReal), `${path25.basename(repoReal)}.worktrees`);
|
|
65737
65769
|
const worktreePath = path25.resolve(input2.targetPath ?? path25.join(defaultRoot, `review-${reviewBranch}${mode === "pr" ? "" : `-${headSpec.slice(0, 8)}`}`));
|
|
65738
65770
|
if (input2.targetPath === undefined)
|