@mstar-harness/engine 3.2.5 → 3.3.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/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { SEVERITY_ORDER, applyEnforcement, readHarnessVersion, readJson, resolve
25
25
  export type { HarnessKind, ResolveHarnessDirOptions, ResolveSpecsDirOptions } from "./path.js";
26
26
  export type { MstarcConfig } from "./mstarc.js";
27
27
  export { MSTARC_FILE, MSTARC_HARNESS_DIR_KEY, MSTARC_PROJECT_DIR_KEY, MSTARC_SECTION, MSTARC_WORKFLOW_DIR_KEY, findMstarc, parseMstarc, } from "./mstarc.js";
28
- export { assertPlanWritingPath, emitGitignoreSnippet, resolveHarnessDir, resolveIterationDir, resolveKnowledgeDir, resolvePlanDir, resolveProjectDir, resolveSddDir, resolveSpecsDir, resolveWorkflowDir, scaffoldHarness, validateGitignore, } from "./path.js";
28
+ export { assertPlanWritingPath, detectHarnessKind, emitGitignoreSnippet, resolveHarnessDir, resolveIterationDir, resolveKnowledgeDir, resolvePlanDir, resolveProjectDir, resolveScaffoldDirs, resolveSddDir, resolveSpecsDir, resolveWorkflowDir, scaffoldHarness, validateGitignore, } from "./path.js";
29
29
  export type { PlanRow, ResidualEntry, StatusDoc, StatusV2Doc, WorkflowEntry, } from "./status.js";
30
30
  export { normalizeSeverity, registerWorkflow, resolveCompassEnforcement, resolveMstarcEnforcement, resolveRepoEnforcement, unregisterWorkflow, validatePlanRow, validateResidual, validateStatus, validateStatusV2, validateWorkflowEntry, } from "./status.js";
31
31
  export type { ClaimLeaseFields, ExecutionLease, ExecutionLeaseLocations, IntegrationMergeLease, LeaseTransition, LeaseVerifyResult, } from "./lease.js";
package/dist/path.d.ts CHANGED
@@ -128,11 +128,35 @@ export declare function resolveWorkflowDir(startDir?: string, opts?: ResolveHarn
128
128
  */
129
129
  export declare function resolveProjectDir(startDir?: string, opts?: ResolveHarnessDirOptions): string;
130
130
  /**
131
- * Initialize the harness directory under `root`: create `.mstar/` with
132
- * `plans/`, `iterations/`, `knowledge/`, `specs/`, `sdd/` and write
133
- * `status.json` from the empty template (plan-conventions § 初始化 Plan 目录).
134
- * Idempotent: an existing non-empty `status.json` is never clobbered.
135
- * Returns the absolute harness dir.
131
+ * Resolve the scaffold target dirs for `root` the harness dir and the
132
+ * project dir from the same config source the runtime resolvers use
133
+ * (plan-conventions § {HARNESS_DIR} 解析顺序): explicit `MSTAR_HARNESS_DIR`
134
+ * env wins, then `.mstarc` `[config] harness_dir` (found per find-first-stop
135
+ * within the workspace-root boundary, resolved against the config file's
136
+ * directory), else the default `.mstar/`. The project dir defaults to
137
+ * `{HARNESS_DIR}/projects/` with the `.mstarc` `[config] project_dir`
138
+ * override honored independently (same `mstarcDirOverride` semantics as
139
+ * `resolveProjectDir`). Unlike `resolveHarnessDir`, the probe rung is
140
+ * skipped: scaffold initializes the default `.mstar/` even when a legacy
141
+ * `.agents/` exists (default behavior unchanged without a `.mstarc`).
142
+ */
143
+ export declare function resolveScaffoldDirs(root: string): {
144
+ harnessDir: string;
145
+ projectDir: string;
146
+ };
147
+ /**
148
+ * Initialize the harness directory under `root`: create the resolved
149
+ * harness dir (default `.mstar/`, or the `.mstarc`-declared `harness_dir`
150
+ * / `MSTAR_HARNESS_DIR` override — see `resolveScaffoldDirs`) with `plans/`,
151
+ * `iterations/`, `knowledge/`, `specs/`, `sdd/`, write `status.json` from
152
+ * the empty template, and prebuild the v3 project layer `_default/` under
153
+ * the resolved project dir (default `{HARNESS_DIR}/projects/`, or the
154
+ * `.mstarc`-declared `project_dir`) with a valid `roadmap.md` + empty
155
+ * `residuals.json` (plan-conventions § 初始化 Plan 目录;
156
+ * mstar-project-governance § `_default` 回退). Idempotent: an existing
157
+ * non-empty `status.json`, `roadmap.md`, or `residuals.json` is never
158
+ * clobbered; re-running on an initialized tree only creates missing
159
+ * pieces. Returns the absolute resolved harness dir.
136
160
  */
137
161
  export declare function scaffoldHarness(root: string): string;
138
162
  /**
@@ -166,6 +190,8 @@ export declare function emitGitignoreSnippet(kind?: HarnessKind): string;
166
190
  * `ValidationResult` (v1 enforcement depth, roadmap §8.5).
167
191
  */
168
192
  export declare function validateGitignore(root: string): ValidationResult;
193
+ /** Detect the gitignore fence kind from a resolved harness dir (basename). */
194
+ export declare function detectHarnessKind(harnessDir: string | null): HarnessKind | null;
169
195
  /**
170
196
  * Plan-writing path gate (plan-conventions § Plan-Writing Path Gate +
171
197
  * harness-core 护栏): plans must live under `{PLAN_DIR}`; external default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/engine",
3
- "version": "3.2.5",
3
+ "version": "3.3.0",
4
4
  "description": "Morning Star Harness Workflow Engine — deterministic workflow enforcement library (path, status, lease, dispatch, sdd, iteration, lint gates).",
5
5
  "license": "MIT",
6
6
  "repository": {