@mstar-harness/engine 3.9.2 → 3.9.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/engine.js +46 -0
- package/dist/index.d.ts +4 -3
- package/dist/iteration.d.ts +1 -2
- package/dist/lint.d.ts +50 -2
- package/dist/path.d.ts +2 -2
- package/dist/project.d.ts +2 -2
- package/package.json +1 -1
package/dist/engine.js
CHANGED
|
@@ -7221,6 +7221,51 @@ function findEphemeralCitations(skillText) {
|
|
|
7221
7221
|
}
|
|
7222
7222
|
return citations;
|
|
7223
7223
|
}
|
|
7224
|
+
var DATED_SLUG_TOKEN_SOURCE = "\\b20\\d{6}-[a-z0-9][a-z0-9-]*\\b(?!\\.\\d)";
|
|
7225
|
+
var DATED_SLUG_TOKEN_RE = new RegExp(DATED_SLUG_TOKEN_SOURCE, "g");
|
|
7226
|
+
var HARNESS_PATH_RE = /\.(?:mstar|agents)\/[^\s<>{}\[\]"'\*\?]+/g;
|
|
7227
|
+
var SDD_DEEPLINK_PREFIX_RE = /^\.(?:mstar|agents)\/sdd(?:\/|$)/;
|
|
7228
|
+
var TRAILING_SENTENCE_PUNCT_RE = /[.,;:!?]+$/;
|
|
7229
|
+
function isExampleSlug(token) {
|
|
7230
|
+
return token.split("-").includes("example");
|
|
7231
|
+
}
|
|
7232
|
+
function qualifyingDatedToken(text) {
|
|
7233
|
+
for (const m of text.matchAll(DATED_SLUG_TOKEN_RE)) {
|
|
7234
|
+
if (!isExampleSlug(m[0]))
|
|
7235
|
+
return m[0];
|
|
7236
|
+
}
|
|
7237
|
+
return null;
|
|
7238
|
+
}
|
|
7239
|
+
function findProvenanceCitations(text) {
|
|
7240
|
+
const citations = [];
|
|
7241
|
+
const lines = text.split(/\r?\n/);
|
|
7242
|
+
for (let i = 0;i < lines.length; i++) {
|
|
7243
|
+
const found = [];
|
|
7244
|
+
const pathRanges = [];
|
|
7245
|
+
for (const m of lines[i].matchAll(HARNESS_PATH_RE)) {
|
|
7246
|
+
const start = m.index;
|
|
7247
|
+
pathRanges.push([start, start + m[0].length]);
|
|
7248
|
+
if (SDD_DEEPLINK_PREFIX_RE.test(m[0]))
|
|
7249
|
+
continue;
|
|
7250
|
+
if (qualifyingDatedToken(m[0]) !== null) {
|
|
7251
|
+
found.push({ index: start, match: m[0], kind: "harness-path" });
|
|
7252
|
+
}
|
|
7253
|
+
}
|
|
7254
|
+
const inPath = (index) => pathRanges.some(([from, to]) => index >= from && index < to);
|
|
7255
|
+
for (const m of lines[i].matchAll(DATED_SLUG_TOKEN_RE)) {
|
|
7256
|
+
if (inPath(m.index))
|
|
7257
|
+
continue;
|
|
7258
|
+
if (isExampleSlug(m[0]))
|
|
7259
|
+
continue;
|
|
7260
|
+
found.push({ index: m.index, match: m[0], kind: "plan-id" });
|
|
7261
|
+
}
|
|
7262
|
+
found.sort((a, b) => a.index - b.index);
|
|
7263
|
+
for (const f of found) {
|
|
7264
|
+
citations.push({ line: i + 1, match: f.match.replace(TRAILING_SENTENCE_PUNCT_RE, ""), kind: f.kind });
|
|
7265
|
+
}
|
|
7266
|
+
}
|
|
7267
|
+
return citations;
|
|
7268
|
+
}
|
|
7224
7269
|
var TEST_FILE_PATH_RE = /[\w./-]+\.(?:test|spec)\.[a-z0-9]+/i;
|
|
7225
7270
|
var TEST_FILE_PHRASE_RE = /\btest file(?:s|\(s\))?\s*:[ \t]*(.+)/i;
|
|
7226
7271
|
var COMMAND_PROMPT_RE = /^\s*[$>]\s*\S/;
|
|
@@ -8773,6 +8818,7 @@ export {
|
|
|
8773
8818
|
executionModeToN,
|
|
8774
8819
|
findEphemeralCitations,
|
|
8775
8820
|
findMstarc,
|
|
8821
|
+
findProvenanceCitations,
|
|
8776
8822
|
findSimplifyMarkers,
|
|
8777
8823
|
findTemporaryMarkers,
|
|
8778
8824
|
findingsCleanupGate,
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* the execution/merge lease state machines + same-host status write lock,
|
|
10
10
|
* `dispatch` implements the Assignment field contract, default-branch
|
|
11
11
|
* gate, QC seat mapping and tri-identity/anti-recursion prechecks, `lint`
|
|
12
|
-
* implements marker/TDD-triple/plan-quality/frontmatter/STRATEGY checks
|
|
12
|
+
* implements marker/TDD-triple/plan-quality/frontmatter/STRATEGY checks and
|
|
13
|
+
* ephemeral/provenance citation discovery,
|
|
13
14
|
* `design-md` validates DESIGN.md token frontmatter + light/dark parity +
|
|
14
15
|
* completeness levels, `audit` validates audit Status blocks, redacts
|
|
15
16
|
* secrets and scaffolds audit-<date>/ plan dirs, and `compound` validates
|
|
@@ -70,8 +71,8 @@ export type { AuditCategory, AuditConfidence, AuditEffort, AuditFinding, AuditPr
|
|
|
70
71
|
export { AUDIT_CATEGORIES, AUDIT_CONFIDENCES, AUDIT_EFFORTS, AUDIT_PRIORITIES, AUDIT_RISKS, promoteAuditPlans, scaffoldAuditPlan, scanSecrets, supplyChainChecks, validateAuditStatusBlocks, } from "./audit.js";
|
|
71
72
|
export { KNOWLEDGE_BUG_PROBLEM_TYPES, KNOWLEDGE_CATEGORY_MAP, KNOWLEDGE_KNOWLEDGE_PROBLEM_TYPES, KNOWLEDGE_PROBLEM_TYPES, KNOWLEDGE_REQUIRED_FIELDS, KNOWLEDGE_RESOLUTION_TYPES, KNOWLEDGE_SEVERITIES, assertIndexRows, compoundRefreshScope, referenceExists, scopeGuard, validateSchemaYaml, } from "./compound.js";
|
|
72
73
|
export type { ReferenceCheckResult } from "./compound.js";
|
|
73
|
-
export type { EphemeralCitation, PlanQualityFinding, PlanQualityResult, SimplifyMarker, TemporaryMarker, TemporaryMarkerResult, } from "./lint.js";
|
|
74
|
-
export { assertSddTddTriple, findEphemeralCitations, findSimplifyMarkers, findTemporaryMarkers, lintSkillFrontmatter, lintStrategySections, planQualityBar, } from "./lint.js";
|
|
74
|
+
export type { EphemeralCitation, PlanQualityFinding, PlanQualityResult, ProvenanceCitation, SimplifyMarker, TemporaryMarker, TemporaryMarkerResult, } from "./lint.js";
|
|
75
|
+
export { assertSddTddTriple, findEphemeralCitations, findProvenanceCitations, findSimplifyMarkers, findTemporaryMarkers, lintSkillFrontmatter, lintStrategySections, planQualityBar, } from "./lint.js";
|
|
75
76
|
export type { DevTrackParam, QcReviewerParam, RoleFamily, RoleMappingEntry, RoleMappingOptions, } from "./roles.js";
|
|
76
77
|
export { DEV_TRACK_PARAMS, QC_REVIEWER_PARAMS, ROLE_MAPPING, SHARED_FAMILIES, lintLoadOrder, validateRoleMapping, } from "./roles.js";
|
|
77
78
|
export type { DetectResult, HostAdapter, HostId, SkillRootPaths, ToolSignal } from "./host.js";
|
package/dist/iteration.d.ts
CHANGED
|
@@ -157,7 +157,6 @@ export declare function parseCompassFrontmatter(filePath: string): Record<string
|
|
|
157
157
|
/**
|
|
158
158
|
* Parse flat-subset YAML frontmatter from raw file content — the single
|
|
159
159
|
* shared parser core behind `parseCompassFrontmatter` (path wrapper) and
|
|
160
|
-
* the roadmap validator (
|
|
161
|
-
* extract/reuse the same parsing, no fork).
|
|
160
|
+
* the roadmap validator (extract/reuse the same parsing, no fork).
|
|
162
161
|
*/
|
|
163
162
|
export declare function parseCompassFrontmatterText(content: string, filePath: string): Record<string, unknown>;
|
package/dist/lint.d.ts
CHANGED
|
@@ -126,8 +126,8 @@ export type EphemeralCitation = {
|
|
|
126
126
|
* concrete instance → reported (`task-2-report`, `task-1.diff`).
|
|
127
127
|
* Placeholders (`task-N-brief`, `task-N-report`, `<plan-id>`,
|
|
128
128
|
* `{SDD_DIR}/task-N-report.md`) never match.
|
|
129
|
-
* - `.mstar/sdd/<segment>` / `.agents/sdd/<segment>` with a concrete
|
|
130
|
-
* segment
|
|
129
|
+
* - `.mstar/sdd/<segment>` / `.agents/sdd/<segment>` with a concrete dated
|
|
130
|
+
* first segment → reported; `<plan-id>` / `{SDD_DIR}` segments
|
|
131
131
|
* are template forms → never match.
|
|
132
132
|
*
|
|
133
133
|
* Discovery only — a finder returning an array, same shape as
|
|
@@ -137,6 +137,54 @@ export type EphemeralCitation = {
|
|
|
137
137
|
* 1-based line order, source order within a line.
|
|
138
138
|
*/
|
|
139
139
|
export declare function findEphemeralCitations(skillText: string): EphemeralCitation[];
|
|
140
|
+
/**
|
|
141
|
+
* A provenance citation found in text: a dated plan/iteration id token, or a
|
|
142
|
+
* local-harness deeplink whose specificity comes from a dated instance
|
|
143
|
+
* segment. Both disclose local artifact provenance, which tracked code and
|
|
144
|
+
* docs must not carry (repo AGENTS.md "Git and local artifacts": tracked
|
|
145
|
+
* content must not disclose real plan/iteration ids or local deep paths;
|
|
146
|
+
* synthetic example forms and generic layout lines are exempt).
|
|
147
|
+
*/
|
|
148
|
+
export type ProvenanceCitation = {
|
|
149
|
+
/** 1-based line number of the citation. */
|
|
150
|
+
line: number;
|
|
151
|
+
/** The matched citation token (dated plan id or deeplink path). */
|
|
152
|
+
match: string;
|
|
153
|
+
/** `plan-id`: a dated-slug plan/iteration id token; `harness-path`: a
|
|
154
|
+
* local-harness deeplink containing a dated token. */
|
|
155
|
+
kind: "plan-id" | "harness-path";
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Find provenance citations in text (repo AGENTS.md "Git and local
|
|
159
|
+
* artifacts": tracked code and docs must not depend on local harness
|
|
160
|
+
* artifacts or disclose their provenance with real plan/iteration ids or
|
|
161
|
+
* local deep paths).
|
|
162
|
+
*
|
|
163
|
+
* Discrimination (HARD — zero false positives on the skills corpus):
|
|
164
|
+
* - `plan-id`: a dated-slug token (`20991231-<slug>`; the dated token
|
|
165
|
+
* inside `iter-20990101-<slug>` counts). Synthetic example
|
|
166
|
+
* slugs (`20991231-example-plan`, `20260717-example`) are never reported;
|
|
167
|
+
* a token followed by a `.digits` version segment (`20260908-v3.9.0`) is
|
|
168
|
+
* a version, not a plan id; placeholder shapes (`task-N-*`, `<plan-id>`,
|
|
169
|
+
* `{…}`) never match the digit-anchored form.
|
|
170
|
+
* - `harness-path`: a `.mstar/…` / `.agents/…` deeplink containing a
|
|
171
|
+
* qualifying dated token — the dated instance segment carries the
|
|
172
|
+
* specificity, so generic layout lines (`.mstar/plans/`,
|
|
173
|
+
* `.mstar/status.json`, `.mstar/knowledge/<category>/`) are never
|
|
174
|
+
* reported.
|
|
175
|
+
* - Attribution (single decision, shared with `findEphemeralCitations`):
|
|
176
|
+
* sdd deeplinks (first segment `sdd`, the SDD_DEEPLINK_RE face) belong to
|
|
177
|
+
* the ephemeral check exclusively; a dated token inside any harness path
|
|
178
|
+
* is reported at most once — as `harness-path` for non-sdd paths, never
|
|
179
|
+
* by this finder for sdd paths. Undated concrete path segments are out of
|
|
180
|
+
* scope (shape ambiguity — prose/review territory, like merge SHAs).
|
|
181
|
+
*
|
|
182
|
+
* Discovery only — a finder returning an array, same shape as
|
|
183
|
+
* `findEphemeralCitations`; callers wrap findings into `ViolationResult`s.
|
|
184
|
+
* Citations are reported line by line in 1-based line order, source order
|
|
185
|
+
* within a line.
|
|
186
|
+
*/
|
|
187
|
+
export declare function findProvenanceCitations(text: string): ProvenanceCitation[];
|
|
140
188
|
/**
|
|
141
189
|
* Validate task report evidence: an explicit scoped-check declaration for
|
|
142
190
|
* document/policy checks, otherwise the executable-change TDD triple.
|
package/dist/path.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export type ResolveHarnessDirOptions = {
|
|
|
11
11
|
*/
|
|
12
12
|
harnessDir?: string;
|
|
13
13
|
/**
|
|
14
|
-
* Workspace-root stop boundary (roadmap §7c
|
|
15
|
-
*
|
|
14
|
+
* Workspace-root stop boundary (roadmap §7c). The upward probe keeps
|
|
15
|
+
* walking only
|
|
16
16
|
* while `dir` is at or below this root — a harness dir above it is never
|
|
17
17
|
* returned (the `~/.mstar` global-collision defect is the special case).
|
|
18
18
|
* Resolved against `startDir` when relative. When omitted, the default
|
package/dist/project.d.ts
CHANGED
|
@@ -199,8 +199,8 @@ export declare function findingsCleanupGate(register: ProjectRegisterDoc, planId
|
|
|
199
199
|
*/
|
|
200
200
|
export declare function techDebtRollup(projectDir: string): TechDebtRollup;
|
|
201
201
|
/**
|
|
202
|
-
* List theme-scoped research files under `<projectDir>/references/`
|
|
203
|
-
*
|
|
202
|
+
* List theme-scoped research files under `<projectDir>/references/`
|
|
203
|
+
* (compass ruling 1): top-level
|
|
204
204
|
* files plus files exactly one subdirectory deep; deeper nesting ignored;
|
|
205
205
|
* directories never listed; regular files only (`Dirent.isFile()`). Returns
|
|
206
206
|
* paths relative to the references root with `/` separators, sorted by code
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mstar-harness/engine",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.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": {
|