@mstar-harness/cli 3.1.0 → 3.1.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.
@@ -4071,27 +4071,27 @@ var {
4071
4071
  import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
4072
4072
  import { readFileSync as readFileSync2, statSync } from "node:fs";
4073
4073
  import { dirname as dirname2, isAbsolute, join as join2, relative, resolve as resolve2 } from "node:path";
4074
- import { mkdirSync as mkdirSync2, readdirSync, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
4074
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2, readdirSync, readFileSync as readFileSync3, realpathSync, statSync as statSync2 } from "node:fs";
4075
4075
  import { execFileSync } from "node:child_process";
4076
4076
  import { basename as basename2, dirname as dirname3, isAbsolute as isAbsolute2, join as join3, relative as relative2, resolve as resolve3 } from "node:path";
4077
- import { existsSync as existsSync2, readFileSync as readFileSync4, readdirSync as readdirSync2, realpathSync } from "node:fs";
4077
+ import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync as readdirSync2, realpathSync as realpathSync2 } from "node:fs";
4078
4078
  import { dirname as dirname5, join as join6, resolve as resolve5, sep } from "node:path";
4079
4079
  import { dirname as dirname4, isAbsolute as isAbsolute3, join as join4, resolve as resolve4 } from "node:path";
4080
4080
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
4081
4081
  import { execFileSync as execFileSync2 } from "node:child_process";
4082
- import { existsSync as existsSync3 } from "node:fs";
4082
+ import { existsSync as existsSync4 } from "node:fs";
4083
4083
  import { isAbsolute as isAbsolute4, resolve as resolve6 } from "node:path";
4084
4084
  import { execFileSync as execFileSync3 } from "node:child_process";
4085
- import { mkdirSync as mkdirSync5, readdirSync as readdirSync3, readFileSync as readFileSync5, realpathSync as realpathSync2, statSync as statSync4, writeFileSync as writeFileSync3 } from "node:fs";
4085
+ import { mkdirSync as mkdirSync5, readdirSync as readdirSync3, readFileSync as readFileSync5, realpathSync as realpathSync3, statSync as statSync4, writeFileSync as writeFileSync3 } from "node:fs";
4086
4086
  import { basename as basename3, dirname as dirname6, isAbsolute as isAbsolute5, join as join7, resolve as resolve7 } from "node:path";
4087
- import { existsSync as existsSync4, readdirSync as readdirSync4, readFileSync as readFileSync6 } from "node:fs";
4088
- import { existsSync as existsSync5, readFileSync as readFileSync7, readdirSync as readdirSync5 } from "node:fs";
4087
+ import { existsSync as existsSync5, readdirSync as readdirSync4, readFileSync as readFileSync6 } from "node:fs";
4088
+ import { existsSync as existsSync6, readFileSync as readFileSync7, readdirSync as readdirSync5 } from "node:fs";
4089
4089
  import { join as join9 } from "node:path";
4090
4090
  import { mkdirSync as mkdirSync7, readdirSync as readdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "node:fs";
4091
4091
  import { join as join11, resolve as resolve9 } from "node:path";
4092
- import { existsSync as existsSync6, readdirSync as readdirSync8, readFileSync as readFileSync10 } from "node:fs";
4092
+ import { existsSync as existsSync7, readdirSync as readdirSync8, readFileSync as readFileSync10 } from "node:fs";
4093
4093
  import { basename as basename4, isAbsolute as isAbsolute7, join as join12, relative as relative4, resolve as resolve10, sep as sep3 } from "node:path";
4094
- import { existsSync as existsSync7 } from "node:fs";
4094
+ import { existsSync as existsSync8 } from "node:fs";
4095
4095
  import { join as join13 } from "node:path";
4096
4096
  var SEVERITY_ORDER = ["critical", "high", "medium", "low", "nit"];
4097
4097
  function readJson(filePath) {
@@ -4848,7 +4848,7 @@ function validateStatusV2(docOrPath, opts = {}) {
4848
4848
  if (harnessDir !== undefined && Array.isArray(doc.workflows)) {
4849
4849
  let realHarnessDir = null;
4850
4850
  try {
4851
- realHarnessDir = realpathSync(harnessDir);
4851
+ realHarnessDir = realpathSync2(harnessDir);
4852
4852
  } catch {}
4853
4853
  for (const entry of doc.workflows) {
4854
4854
  if (!isPlainObject3(entry) || typeof entry.dir !== "string")
@@ -4858,7 +4858,7 @@ function validateStatusV2(docOrPath, opts = {}) {
4858
4858
  const label = typeof entry.id === "string" ? entry.id : relSnapshot;
4859
4859
  let physical;
4860
4860
  try {
4861
- physical = realpathSync(snapshotPath);
4861
+ physical = realpathSync2(snapshotPath);
4862
4862
  } catch {
4863
4863
  violations.push(violation4("high", "status.workflow.snapshot-missing", `workflows[] lists ${JSON.stringify(label)} but its snapshot does not exist at ${JSON.stringify(relSnapshot)} \u2014 the root holds active lifecycles only; unregister the id when its snapshot is removed`));
4864
4864
  continue;
@@ -4941,7 +4941,7 @@ function l1PreDispatchCheck(input, opts = {}) {
4941
4941
  if (controlWorktreePath !== "" && leaseWorktreePath !== "" && resolve6(controlWorktreePath) === resolve6(leaseWorktreePath)) {
4942
4942
  violations.push(violation5("critical", "worktree.l1.lease-equals-control", `execution_lease.worktree_path "${leaseWorktreePath}" equals metadata.control_worktree_path \u2014 the feature worktree MUST differ from the control worktree (L1 isolation; product edits never land in the control checkout)`, "use a distinct feature worktree for the plan (git worktree add <path> <branch>) and update the lease"));
4943
4943
  }
4944
- if (leaseWorktreePath !== "" && !existsSync3(leaseWorktreePath)) {
4944
+ if (leaseWorktreePath !== "" && !existsSync4(leaseWorktreePath)) {
4945
4945
  violations.push(violation5("high", "worktree.l1.feature-missing", `feature worktree directory "${leaseWorktreePath}" does not exist for plan "${planId}"`, `create it before dispatch: git worktree add ${leaseWorktreePath} <working-branch>`));
4946
4946
  } else if (leaseWorktreePath !== "" && leaseWorkingBranch !== "") {
4947
4947
  const probe = probeBranch(leaseWorktreePath, opts);
@@ -4975,7 +4975,7 @@ function l2PreDispatchCheck(input, opts = {}) {
4975
4975
  return;
4976
4976
  }
4977
4977
  seenPaths.add(normalized);
4978
- if (!existsSync3(track.worktreePath)) {
4978
+ if (!existsSync4(track.worktreePath)) {
4979
4979
  violations.push(violation5("high", "worktree.l2.track-missing", `track worktree directory "${track.worktreePath}" does not exist`, `create it before dispatch: git worktree add ${track.worktreePath} ${track.workingBranch}`));
4980
4980
  return;
4981
4981
  }
@@ -5079,8 +5079,8 @@ function isLinkedWorktree(root) {
5079
5079
  if (gitDir.includes("/.git/worktrees/") || gitDir.includes("/worktrees/"))
5080
5080
  return true;
5081
5081
  try {
5082
- const gdParent = realpathSync2(dirname6(gitDir));
5083
- const cmAbs = realpathSync2(common2);
5082
+ const gdParent = realpathSync3(dirname6(gitDir));
5083
+ const cmAbs = realpathSync3(common2);
5084
5084
  return join7(gdParent, basename3(gitDir)) !== cmAbs && gitDir !== cmAbs;
5085
5085
  } catch {
5086
5086
  return false;
@@ -5098,10 +5098,10 @@ function sddWorkspace(planId, opts = {}) {
5098
5098
  if (!isDirectory2(controlRoot)) {
5099
5099
  throw new SddScriptError(`mstar sdd workspace: CONTROL_ROOT / MSTAR_CONTROL_ROOT is not a directory: ${controlRoot}`, 1);
5100
5100
  }
5101
- root = realpathSync2(controlRoot);
5101
+ root = realpathSync3(controlRoot);
5102
5102
  } else {
5103
5103
  const topLevel = gitOut(cwd, ["rev-parse", "--show-toplevel"]);
5104
- root = realpathSync2(topLevel ?? cwd);
5104
+ root = realpathSync3(topLevel ?? cwd);
5105
5105
  }
5106
5106
  if (!controlRoot && isLinkedWorktree(root)) {
5107
5107
  throw new SddScriptError(`mstar sdd workspace: linked worktree at ${root} has no {HARNESS_DIR}/status.json (default gitignore).
@@ -5135,7 +5135,7 @@ function sddWorkspace(planId, opts = {}) {
5135
5135
  mkdirSync5(sddDir, { recursive: true });
5136
5136
  writeFileSync3(join7(sddDir, ".gitignore"), `*
5137
5137
  `);
5138
- return realpathSync2(sddDir);
5138
+ return realpathSync3(sddDir);
5139
5139
  }
5140
5140
  function taskBrief(planFile, taskN, outFile, opts = {}) {
5141
5141
  if (!planFile || !Number.isInteger(taskN) || taskN < 1) {
@@ -5583,7 +5583,7 @@ function techDebtRollup(projectDir) {
5583
5583
  if (!project.isDirectory())
5584
5584
  continue;
5585
5585
  const registerPath = join9(projectDir, project.name, PROJECT_REGISTER_FILE);
5586
- if (!existsSync5(registerPath))
5586
+ if (!existsSync6(registerPath))
5587
5587
  continue;
5588
5588
  let register;
5589
5589
  try {
@@ -6461,7 +6461,7 @@ function normalizeIndexRef(cell) {
6461
6461
  function assertIndexRows(knowledgeDir) {
6462
6462
  const violations = [];
6463
6463
  const readmePath = join12(knowledgeDir, "README.md");
6464
- if (!existsSync6(readmePath)) {
6464
+ if (!existsSync7(readmePath)) {
6465
6465
  violations.push(violation10("medium", "compound.index.missing-readme", `missing ${readmePath} \u2014 the knowledge index is required (mstar-compound Phase 6: every doc gets a README.md row)`, "create knowledge/README.md with a Document / Source Plan / Description / Status table"));
6466
6466
  return { ok: false, violations };
6467
6467
  }
@@ -6791,7 +6791,7 @@ function validateRoleMapping(rolesDir, options = {}) {
6791
6791
  const violations = [];
6792
6792
  const referenceById = new Map(mapping.map((m) => [m.agentId, m.reference]));
6793
6793
  for (const { agentId, reference } of mapping) {
6794
- if (!existsSync7(join13(rolesDir, reference))) {
6794
+ if (!existsSync8(join13(rolesDir, reference))) {
6795
6795
  violations.push(violation12("medium", "roles.mapping.reference.missing", `role "${agentId}" maps to ${reference} which does not exist under ${rolesDir} (mstar-roles \u00a7 Role Reference Mapping)`, `create ${join13(rolesDir, reference)} or fix the mapping row`));
6796
6796
  }
6797
6797
  }
@@ -6993,16 +6993,16 @@ function lintFiveQuestion(bodyText, mode = "authoring") {
6993
6993
  }
6994
6994
 
6995
6995
  // ../engine/dist/engine.js
6996
- import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync8, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
6996
+ import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync8, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
6997
6997
  import { randomUUID } from "node:crypto";
6998
6998
  import { basename, dirname, join, resolve } from "node:path";
6999
6999
  import { fileURLToPath } from "node:url";
7000
7000
  import { readFileSync as readFileSync22, statSync as statSync3 } from "node:fs";
7001
7001
  import { dirname as dirname22, isAbsolute as isAbsolute6, join as join22, relative as relative3, resolve as resolve22 } from "node:path";
7002
- import { mkdirSync as mkdirSync22, readdirSync as readdirSync6, readFileSync as readFileSync32, statSync as statSync22 } from "node:fs";
7002
+ import { existsSync as existsSync22, mkdirSync as mkdirSync22, readdirSync as readdirSync6, readFileSync as readFileSync32, realpathSync as realpathSync4, statSync as statSync22 } from "node:fs";
7003
7003
  import { execFileSync as execFileSync4 } from "node:child_process";
7004
7004
  import { basename as basename22, dirname as dirname32, isAbsolute as isAbsolute22, join as join32, relative as relative22, resolve as resolve32 } from "node:path";
7005
- import { existsSync as existsSync22, readFileSync as readFileSync42, readdirSync as readdirSync22, realpathSync as realpathSync3 } from "node:fs";
7005
+ import { existsSync as existsSync32, readFileSync as readFileSync42, readdirSync as readdirSync22, realpathSync as realpathSync22 } from "node:fs";
7006
7006
  import { dirname as dirname52, join as join62, resolve as resolve52, sep as sep2 } from "node:path";
7007
7007
  import { mkdirSync as mkdirSync32, rmdirSync, statSync as statSync32, unlinkSync as unlinkSync22, writeFileSync as writeFileSync22 } from "node:fs";
7008
7008
  import { dirname as dirname42, isAbsolute as isAbsolute32, join as join42, resolve as resolve42 } from "node:path";
@@ -7014,7 +7014,7 @@ import { copyFileSync, mkdirSync as mkdirSync6, readFileSync as readFileSync82,
7014
7014
  import { dirname as dirname7, isAbsolute as isAbsolute62, join as join10, relative as relative32, resolve as resolve8, sep as sep22 } from "node:path";
7015
7015
  var SEVERITY_ORDER2 = ["critical", "high", "medium", "low", "nit"];
7016
7016
  function readJson2(filePath) {
7017
- if (!existsSync8(filePath))
7017
+ if (!existsSync9(filePath))
7018
7018
  return {};
7019
7019
  const content = readFileSync8(filePath, "utf8").trim();
7020
7020
  if (!content)
@@ -7044,7 +7044,7 @@ function resolveProjectRoot(startDir = process.cwd()) {
7044
7044
  const start = resolve(startDir);
7045
7045
  let dir = start;
7046
7046
  for (;; ) {
7047
- if (existsSync8(join(dir, "package.json")) || existsSync8(join(dir, "bun.lock")))
7047
+ if (existsSync9(join(dir, "package.json")) || existsSync9(join(dir, "bun.lock")))
7048
7048
  return dir;
7049
7049
  const parent = dirname(dir);
7050
7050
  if (parent === dir)
@@ -7755,7 +7755,7 @@ function validateStatusV22(docOrPath, opts = {}) {
7755
7755
  if (harnessDir !== undefined && Array.isArray(doc.workflows)) {
7756
7756
  let realHarnessDir = null;
7757
7757
  try {
7758
- realHarnessDir = realpathSync3(harnessDir);
7758
+ realHarnessDir = realpathSync22(harnessDir);
7759
7759
  } catch {}
7760
7760
  for (const entry of doc.workflows) {
7761
7761
  if (!isPlainObject32(entry) || typeof entry.dir !== "string")
@@ -7765,7 +7765,7 @@ function validateStatusV22(docOrPath, opts = {}) {
7765
7765
  const label = typeof entry.id === "string" ? entry.id : relSnapshot;
7766
7766
  let physical;
7767
7767
  try {
7768
- physical = realpathSync3(snapshotPath);
7768
+ physical = realpathSync22(snapshotPath);
7769
7769
  } catch {
7770
7770
  violations.push(violation42("high", "status.workflow.snapshot-missing", `workflows[] lists ${JSON.stringify(label)} but its snapshot does not exist at ${JSON.stringify(relSnapshot)} \u2014 the root holds active lifecycles only; unregister the id when its snapshot is removed`));
7771
7771
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/cli",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Morning Star harness CLI — installer bootstrap + mstar workflow verbs (path/status/lease/sdd/iteration/dispatch/worktree/lint/design-md/audit/compound/host/skill).",
5
5
  "license": "MIT",
6
6
  "repository": {