@mstar-harness/engine 3.10.2 → 3.11.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/audit.d.ts +52 -1
- package/dist/audit.js +269 -13
- package/dist/coordination-write.d.ts +5 -3
- package/dist/coordination.d.ts +5 -0
- package/dist/engine.js +764 -37
- package/dist/index.d.ts +4 -4
- package/dist/workflow.d.ts +80 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,8 +45,8 @@ export type { PlanRow, ResidualEntry, StatusDoc, StatusV2Doc, WorkflowEntry, } f
|
|
|
45
45
|
export { normalizeSeverity, registerWorkflow, resolveCompassEnforcement, resolveMstarcEnforcement, resolveRepoEnforcement, unregisterWorkflow, validatePlanRow, validateResidual, validateStatus, validateStatusV2, validateWorkflowEntry, } from "./status.js";
|
|
46
46
|
export type { ClaimLeaseFields, ExecutionLease, ExecutionLeaseLocations, IntegrationMergeLease, LeaseTransition, LeaseVerifyResult, } from "./lease.js";
|
|
47
47
|
export { canSteal, claimLease, planExecutionLeaseLocations, releaseLease, sameHolderResume, validateExecutionLease, validateIntegrationMergeLease, verifyPlanExecutionLease, withStatusWriteLock, } from "./lease.js";
|
|
48
|
-
export type { CloseWorkflowOptions, DeclareWorkflowDeliveryKindOptions, DeliveryRegistrationEvidence, RecordWorkflowDeliveryOptions, RecordWorkflowDeliveryResult, RegisterPlanWorkflowOptions, RegisterPlanWorkflowResult, WorkflowBranchAnchors, WorkflowCompoundOutcome, WorkflowDeliveryEvidence, WorkflowDeliveryKind, WorkflowExecutionPolicy, WorkflowLifecycleStatus, WorkflowLifecycleType, WorkflowSnapshot, WorkflowSnapshotRead, } from "./workflow.js";
|
|
49
|
-
export { assertDeliveryRegistrationCoherence, closeWorkflow, consultDeliveryEvidence, declareWorkflowDeliveryKind, isTerminalSnapshot, LEGACY_WORKTREE_PATH_CODE, recordWorkflowDelivery, registerPlanWorkflow, WORKFLOW_COMPOUND_OUTCOMES, WORKFLOW_DELIVERY_KINDS, WORKFLOW_LIFECYCLE_STATUSES, WORKFLOW_LIFECYCLE_TYPES, WORKFLOW_SNAPSHOT_FILE, WORKFLOW_TERMINAL_STATUSES, readWorkflowSnapshot, validateWorkflowSnapshot, writeWorkflowSnapshot, } from "./workflow.js";
|
|
48
|
+
export type { CloseWorkflowOptions, DeclareWorkflowDeliveryKindOptions, DeliveryRegistrationEvidence, RecordWorkflowDeliveryOptions, RecordWorkflowDeliveryResult, RegisterIterationWorkflowOptions, RegisterIterationWorkflowResult, RegisterPlanWorkflowOptions, RegisterPlanWorkflowResult, WorkflowBranchAnchors, WorkflowCompoundOutcome, WorkflowDeliveryEvidence, WorkflowDeliveryKind, WorkflowExecutionPolicy, WorkflowLifecycleStatus, WorkflowLifecycleType, WorkflowSnapshot, WorkflowSnapshotRead, } from "./workflow.js";
|
|
49
|
+
export { assertDeliveryRegistrationCoherence, closeWorkflow, consultDeliveryEvidence, declareWorkflowDeliveryKind, isTerminalSnapshot, LEGACY_WORKTREE_PATH_CODE, recordWorkflowDelivery, registerIterationWorkflow, registerPlanWorkflow, WORKFLOW_COMPOUND_OUTCOMES, WORKFLOW_DELIVERY_KINDS, WORKFLOW_LIFECYCLE_STATUSES, WORKFLOW_LIFECYCLE_TYPES, WORKFLOW_SNAPSHOT_FILE, WORKFLOW_TERMINAL_STATUSES, readWorkflowSnapshot, validateWorkflowSnapshot, writeWorkflowSnapshot, } from "./workflow.js";
|
|
50
50
|
export type { CleanupDecision, CleanupFacts, CleanupTarget, CleanupTargetKind, } from "./cleanup.js";
|
|
51
51
|
export { planWorktreeCleanup } from "./cleanup.js";
|
|
52
52
|
export type { EvidenceArtifactFact, EvidenceAssessment, EvidenceCaptureRequest, EvidenceCoverage, EvidenceEnvironmentKey, EvidenceExpectation, EvidenceInputEntry, EvidenceInputSnapshot, EvidenceInputSpec, EvidenceLimits, EvidenceLog, EvidenceOutcome, EvidenceToolFingerprint, SddEvidenceRecord, } from "./evidence.js";
|
|
@@ -67,8 +67,8 @@ export type { MigrateNotesFile, MigrateOptions, MigratePlan, MigrateRegister, Mi
|
|
|
67
67
|
export { ARCHIVED_STATUS_V1_FILE, MIGRATE_STATUS_FILE, NOTES_LEDGER_FILE, applyMigratePlan, migrateHarnessTree, } from "./migrate.js";
|
|
68
68
|
export type { CompletenessItem, CompletenessLevel, CompletenessPlaceholder, CompletenessResult, DesignFrontmatter, } from "./design-md.js";
|
|
69
69
|
export { assertLightDarkParity, completenessLevel, parseDesignFrontmatter, validateDesignTokenFrontmatter, } from "./design-md.js";
|
|
70
|
-
export type { AuditCategory, AuditConfidence, AuditEffort, AuditFinding, AuditPriority, AuditRisk, PromoteAuditPlansOptions, RedactResult, ScaffoldAuditPlanOptions, ScaffoldAuditPlanResult, ScannedSecret, SecretFinding, SupplyChainFinding, SupplyChainFindingKind, SupplyChainResult, } from "./audit.js";
|
|
71
|
-
export { AUDIT_CATEGORIES, AUDIT_CONFIDENCES, AUDIT_EFFORTS, AUDIT_PRIORITIES, AUDIT_RISKS, promoteAuditPlans, scaffoldAuditPlan, scanSecrets, supplyChainChecks, validateAuditStatusBlocks, } from "./audit.js";
|
|
70
|
+
export type { AuditCategory, AuditConfidence, AuditEffort, AuditEvidence, AuditFinding, AuditPriority, AuditRisk, AuditSeverity, AuditSeverityRank, AuditTraceKind, AuditTraceStep, PromoteAuditPlansOptions, RedactResult, ScaffoldAuditPlanOptions, ScaffoldAuditPlanResult, ScannedSecret, SecretFinding, SupplyChainFinding, SupplyChainFindingKind, SupplyChainResult, } from "./audit.js";
|
|
71
|
+
export { AUDIT_CATEGORIES, AUDIT_CONFIDENCES, AUDIT_EFFORTS, AUDIT_PRIORITIES, AUDIT_RISKS, promoteAuditPlans, scaffoldAuditPlan, scanSecrets, supplyChainChecks, validateAuditFindingGates, validateAuditStatusBlocks, } from "./audit.js";
|
|
72
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";
|
|
73
73
|
export type { ReferenceCheckResult } from "./compound.js";
|
|
74
74
|
export type { EphemeralCitation, PlanQualityFinding, PlanQualityResult, ProvenanceCitation, SimplifyMarker, TemporaryMarker, TemporaryMarkerResult, } from "./lint.js";
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type GateResult, type ValidationResult } from "./core.js";
|
|
2
|
-
import { type SnapshotCoordination } from "./coordination-write.js";
|
|
2
|
+
import { type RowValidationRoute, type SnapshotCoordination } from "./coordination-write.js";
|
|
3
3
|
import { type IntegrationMergeLease } from "./lease.js";
|
|
4
4
|
import { type PlanRow } from "./status.js";
|
|
5
5
|
/** Snapshot file name inside `workflows/<id>/` ( — writer contract). */
|
|
@@ -159,6 +159,10 @@ export type WorkflowSnapshot = {
|
|
|
159
159
|
*/
|
|
160
160
|
delivery?: WorkflowDeliveryEvidence;
|
|
161
161
|
};
|
|
162
|
+
/** True exactly for a single-row standalone development plan workflow (spec A1). */
|
|
163
|
+
export declare function isStandaloneDevelopmentWorkflow(snapshot: WorkflowSnapshot): boolean;
|
|
164
|
+
/** Classify row coordination validation: standalone development vs integration delivery. */
|
|
165
|
+
export declare function rowValidationRoute(snapshot: WorkflowSnapshot, row: PlanRow): RowValidationRoute;
|
|
162
166
|
/** Stable JSON for change detection (sorted keys, recursive). */
|
|
163
167
|
export declare function stableJson(value: unknown): string;
|
|
164
168
|
/**
|
|
@@ -518,3 +522,78 @@ export type RegisterPlanWorkflowResult = {
|
|
|
518
522
|
* root could differ — the routed writers fail loud on a path mismatch.
|
|
519
523
|
*/
|
|
520
524
|
export declare function registerPlanWorkflow(workflowId: string, options: RegisterPlanWorkflowOptions): Promise<RegisterPlanWorkflowResult>;
|
|
525
|
+
/** Options for `registerIterationWorkflow`. `harnessDir` is required — the
|
|
526
|
+
* snapshot and `status.json` live under the harness root. */
|
|
527
|
+
export type RegisterIterationWorkflowOptions = {
|
|
528
|
+
/** Absolute harness dir that contains `status.json` + `workflows/`. Required. */
|
|
529
|
+
harnessDir: string;
|
|
530
|
+
/** Harness-relative compass ref recorded on the snapshot, e.g. `iterations/<id>/delivery-compass.md`. Required. */
|
|
531
|
+
compassRef: string;
|
|
532
|
+
/** The three iteration branch anchors. All three required. */
|
|
533
|
+
branch: {
|
|
534
|
+
base: string;
|
|
535
|
+
integration: string;
|
|
536
|
+
target: string;
|
|
537
|
+
};
|
|
538
|
+
/** Initial plan rows. At least one. Every row is written `status: "Todo"`. */
|
|
539
|
+
rows: Array<{
|
|
540
|
+
id: string;
|
|
541
|
+
title: string;
|
|
542
|
+
file: string;
|
|
543
|
+
}>;
|
|
544
|
+
/** Project register id recorded on the snapshot. */
|
|
545
|
+
project?: string;
|
|
546
|
+
/** Registration timestamp (YYYY-MM-DD or RFC3339). Default: now. */
|
|
547
|
+
startedAt?: string;
|
|
548
|
+
};
|
|
549
|
+
export type RegisterIterationWorkflowResult = {
|
|
550
|
+
workflowId: string;
|
|
551
|
+
snapshotPath: string;
|
|
552
|
+
/**
|
|
553
|
+
* True on orphan recovery: existing snapshot bytes/timestamps are preserved
|
|
554
|
+
* and only the missing root entry is written.
|
|
555
|
+
*/
|
|
556
|
+
recovered: boolean;
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* Register an iteration workflow (seam S1 sibling of `registerPlanWorkflow`).
|
|
560
|
+
* Builds the create-only `type: iteration` snapshot (workflow id, compass
|
|
561
|
+
* ref, the three branch anchors, Todo rows whose `metadata` —
|
|
562
|
+
* `iteration_refs`, `spec_integration_branch`, `merge_target` — is derived
|
|
563
|
+
* from the already-required compass/integration inputs; registration never
|
|
564
|
+
* authorizes implementation) and the root `workflows[]` entry, then writes
|
|
565
|
+
* BOTH under one atomic section of the root `withStatusWriteLock` — the same
|
|
566
|
+
* create-only `writeWorkflowSnapshot(..., { createOnly: true })` →
|
|
567
|
+
* `registerWorkflowEntryLocked` primitive sequence the plan producer uses —
|
|
568
|
+
* with rollback that removes ONLY the exact snapshot version this call
|
|
569
|
+
* created (plus the now-empty workflow dir; a non-empty directory is never
|
|
570
|
+
* force-removed).
|
|
571
|
+
*
|
|
572
|
+
* Refusals (fail-loud, before any write): non-empty `workflowId`
|
|
573
|
+
* (`assertSafePathComponent`), `harnessDir`, `compassRef`, all three branch
|
|
574
|
+
* anchors, `project` when given, and each row's `id`/`title`/`file`;
|
|
575
|
+
* non-empty row array; duplicate row ids; a SUPPLIED row `status` (a
|
|
576
|
+
* requested state transition is never treated as successful registration);
|
|
577
|
+
* `startedAt` must be a valid YYYY-MM-DD / RFC3339 timestamp. Rows are
|
|
578
|
+
* constructed from the declared fields — untrusted row objects are never
|
|
579
|
+
* spread.
|
|
580
|
+
*
|
|
581
|
+
* Already-registered refusals: inside the root lock, an existing entry for
|
|
582
|
+
* the requested id refuses BEFORE either branch — including a stale entry
|
|
583
|
+
* whose snapshot is missing. This producer is not the low-level upsert and
|
|
584
|
+
* does not repair/repoint an existing identity. Malformed/v1 roots refuse
|
|
585
|
+
* without replacing their bytes.
|
|
586
|
+
*
|
|
587
|
+
* Crash/retry recovery: a snapshot without its root entry (an orphan)
|
|
588
|
+
* re-registers only when `iterationWorkflowRegistrationIdentity` matches —
|
|
589
|
+
* the existing snapshot's bytes and timestamps are preserved verbatim and
|
|
590
|
+
* the root entry is written with the orphan's `started_at` (`recovered:
|
|
591
|
+
* true`). A differing identity (including a mismatched snapshot id or an
|
|
592
|
+
* existing coordinator binding) refuses; a failed recovery root write never
|
|
593
|
+
* deletes the orphan.
|
|
594
|
+
*
|
|
595
|
+
* The caller must pin the artifact store to the harness root first
|
|
596
|
+
* (`setArtifactStore(createFsStore(harnessDir))`) when the active store's
|
|
597
|
+
* root could differ — the routed writers fail loud on a path mismatch.
|
|
598
|
+
*/
|
|
599
|
+
export declare function registerIterationWorkflow(workflowId: string, options: RegisterIterationWorkflowOptions): Promise<RegisterIterationWorkflowResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mstar-harness/engine",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.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": {
|