@mstar-harness/engine 3.1.1 → 3.1.3

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/status.d.ts CHANGED
@@ -136,6 +136,26 @@ export declare function validateStatusV2(docOrPath: StatusV2Doc | string, opts?:
136
136
  * closed on v1 input with the `mstar migrate` hint.
137
137
  */
138
138
  export declare const validateStatus: typeof validateStatusV2;
139
+ /**
140
+ * Root-file workflow upsert, to be called ONLY while the caller holds the
141
+ * root `withStatusWriteLock(statusPath)` (see `registerWorkflow` and the
142
+ * audit promote path, which call this from inside their lock — the root
143
+ * lock is the serialization point for read-check-replace-verify).
144
+ *
145
+ * Idempotent upsert by entry `id`, bumping root `updated_at`. A
146
+ * missing/empty root file is initialized from the v2 template (never a v1
147
+ * tree); a v1 root is refused with the `mstar migrate` hint (no silent
148
+ * mutation of an un-migrated tree). The final document is validated with
149
+ * `validateStatusV2` (including the removal-at-terminal snapshot invariant
150
+ * against `dirname(statusPath)`) before the write — an entry whose
151
+ * snapshot is missing or terminal is refused and nothing is written.
152
+ *
153
+ * The caller must validate the entry (`validateWorkflowEntry`) before
154
+ * acquiring the lock; this helper asserts it as a safety net (cheap —
155
+ * an invalid entry would fail `validateStatusV2` anyway, but the explicit
156
+ * gate keeps the pre-lock fail-fast contract of `registerWorkflow`).
157
+ */
158
+ export declare function registerWorkflowEntryLocked(statusPath: string, entry: WorkflowEntry): StatusV2Doc;
139
159
  /**
140
160
  * Register one active workflow entry in the v2 root file (plan Task 3).
141
161
  * Idempotent upsert by entry `id` under the root-file `withStatusWriteLock`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/engine",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
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": {
@@ -16,13 +16,17 @@
16
16
  "types": "./dist/index.d.ts",
17
17
  "default": "./dist/engine.js"
18
18
  },
19
- "./package.json": "./package.json"
19
+ "./package.json": "./package.json",
20
+ "./src/audit": {
21
+ "types": "./dist/audit.d.ts",
22
+ "default": "./dist/audit.js"
23
+ }
20
24
  },
21
25
  "files": [
22
26
  "dist"
23
27
  ],
24
28
  "scripts": {
25
- "build": "rm -rf dist && bun build src/index.ts --target node --outfile dist/engine.js && bunx tsc",
29
+ "build": "rm -rf dist && bun build src/index.ts --target node --outfile dist/engine.js && bun build src/audit.ts --target node --outfile dist/audit.js && bunx tsc",
26
30
  "test": "bun test",
27
31
  "prepublishOnly": "bun run build"
28
32
  },