@exaudeus/workrail 3.19.0 → 3.19.1
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/manifest.json +14 -6
- package/dist/mcp/handlers/shared/request-workflow-reader.d.ts +2 -0
- package/dist/mcp/handlers/shared/request-workflow-reader.js +20 -1
- package/dist/mcp/handlers/shared/workflow-source-visibility.js +2 -4
- package/dist/mcp/handlers/shared/workspace-path-utils.d.ts +2 -0
- package/dist/mcp/handlers/shared/workspace-path-utils.js +29 -0
- package/package.json +1 -1
- package/workflows/workflow-for-workflows.json +5 -33
package/dist/manifest.json
CHANGED
|
@@ -734,12 +734,12 @@
|
|
|
734
734
|
"bytes": 2785
|
|
735
735
|
},
|
|
736
736
|
"mcp/handlers/shared/request-workflow-reader.d.ts": {
|
|
737
|
-
"sha256": "
|
|
738
|
-
"bytes":
|
|
737
|
+
"sha256": "94eae7516f1ca0aef0c9995d0fd41fc206abb001970cebcac35b912624341d0a",
|
|
738
|
+
"bytes": 2103
|
|
739
739
|
},
|
|
740
740
|
"mcp/handlers/shared/request-workflow-reader.js": {
|
|
741
|
-
"sha256": "
|
|
742
|
-
"bytes":
|
|
741
|
+
"sha256": "cfd2946ec9deb52c21611b21fc07859f35edaaf2c85d15743833380352dedf6f",
|
|
742
|
+
"bytes": 11702
|
|
743
743
|
},
|
|
744
744
|
"mcp/handlers/shared/with-timeout.d.ts": {
|
|
745
745
|
"sha256": "31ca3db008cb5cd439e0d1132bc4b29be0900c403c452931e3a24a50e45beb54",
|
|
@@ -754,8 +754,16 @@
|
|
|
754
754
|
"bytes": 1772
|
|
755
755
|
},
|
|
756
756
|
"mcp/handlers/shared/workflow-source-visibility.js": {
|
|
757
|
-
"sha256": "
|
|
758
|
-
"bytes":
|
|
757
|
+
"sha256": "59f5b6f50a46a708c19649ab6dc0c90f21d9d4f151b52f454dc38a2dad344717",
|
|
758
|
+
"bytes": 4526
|
|
759
|
+
},
|
|
760
|
+
"mcp/handlers/shared/workspace-path-utils.d.ts": {
|
|
761
|
+
"sha256": "c660cf0605f3d23c2826d69c5ba47aea4866ab929a94cb5cdde882cedde047ab",
|
|
762
|
+
"bytes": 169
|
|
763
|
+
},
|
|
764
|
+
"mcp/handlers/shared/workspace-path-utils.js": {
|
|
765
|
+
"sha256": "c375c508fb830dc87b930eaeb99a1443b075c2d3f4f323875c3fb56107f82a05",
|
|
766
|
+
"bytes": 1261
|
|
759
767
|
},
|
|
760
768
|
"mcp/handlers/v2-advance-core.d.ts": {
|
|
761
769
|
"sha256": "0a07ea15caf7b0a3123d3b0b44c2b85392d090dd140bf82370fd0e84d1aa5b0e",
|
|
@@ -31,6 +31,8 @@ export interface WorkflowReaderForRequestResult {
|
|
|
31
31
|
readonly stalePaths: readonly string[];
|
|
32
32
|
readonly managedSourceRecords: readonly ManagedSourceRecordV2[];
|
|
33
33
|
readonly staleManagedRecords: readonly ManagedSourceRecordV2[];
|
|
34
|
+
readonly excludedByScope: readonly string[];
|
|
34
35
|
readonly managedStoreError?: string;
|
|
35
36
|
}
|
|
37
|
+
export declare function filterRememberedRootsForWorkspace(allRoots: readonly string[], workspace: string): Promise<readonly string[]>;
|
|
36
38
|
export declare function createWorkflowReaderForRequest(options: RequestWorkflowReaderOptions): Promise<WorkflowReaderForRequestResult>;
|
|
@@ -8,6 +8,7 @@ exports.hasRequestWorkspaceSignal = hasRequestWorkspaceSignal;
|
|
|
8
8
|
exports.resolveRequestWorkspaceDirectory = resolveRequestWorkspaceDirectory;
|
|
9
9
|
exports.toProjectWorkflowDirectory = toProjectWorkflowDirectory;
|
|
10
10
|
exports.discoverRootedWorkflowDirectories = discoverRootedWorkflowDirectories;
|
|
11
|
+
exports.filterRememberedRootsForWorkspace = filterRememberedRootsForWorkspace;
|
|
11
12
|
exports.createWorkflowReaderForRequest = createWorkflowReaderForRequest;
|
|
12
13
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
13
14
|
const path_1 = __importDefault(require("path"));
|
|
@@ -15,6 +16,7 @@ const url_1 = require("url");
|
|
|
15
16
|
const enhanced_multi_source_workflow_storage_js_1 = require("../../../infrastructure/storage/enhanced-multi-source-workflow-storage.js");
|
|
16
17
|
const schema_validating_workflow_storage_js_1 = require("../../../infrastructure/storage/schema-validating-workflow-storage.js");
|
|
17
18
|
const with_timeout_js_1 = require("./with-timeout.js");
|
|
19
|
+
const workspace_path_utils_js_1 = require("./workspace-path-utils.js");
|
|
18
20
|
const SKIP_DIRS = new Set([
|
|
19
21
|
'.git', 'node_modules',
|
|
20
22
|
'build', 'dist', 'out', 'target',
|
|
@@ -99,10 +101,26 @@ async function _doWalk(cacheKey, roots, now) {
|
|
|
99
101
|
walkCache.set(cacheKey, { result, expiresAt: now + WALK_CACHE_TTL_MS });
|
|
100
102
|
return result;
|
|
101
103
|
}
|
|
104
|
+
async function filterRememberedRootsForWorkspace(allRoots, workspace) {
|
|
105
|
+
const ancestorRoots = allRoots.filter((r) => (0, workspace_path_utils_js_1.isWorkspaceAncestor)(r, workspace));
|
|
106
|
+
const nonAncestorRoots = allRoots.filter((r) => !(0, workspace_path_utils_js_1.isWorkspaceAncestor)(r, workspace));
|
|
107
|
+
let siblingRoots = [];
|
|
108
|
+
if (nonAncestorRoots.length > 0) {
|
|
109
|
+
const workspaceCommonDir = await (0, workspace_path_utils_js_1.getGitCommonDir)(workspace);
|
|
110
|
+
if (workspaceCommonDir !== null) {
|
|
111
|
+
const commonDirResults = await Promise.all(nonAncestorRoots.map((r) => (0, workspace_path_utils_js_1.getGitCommonDir)(r)));
|
|
112
|
+
siblingRoots = nonAncestorRoots.filter((_, i) => commonDirResults[i] === workspaceCommonDir);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return [...ancestorRoots, ...siblingRoots];
|
|
116
|
+
}
|
|
102
117
|
async function createWorkflowReaderForRequest(options) {
|
|
103
118
|
const workspaceDirectory = resolveRequestWorkspaceDirectory(options);
|
|
104
119
|
const projectWorkflowDirectory = toProjectWorkflowDirectory(workspaceDirectory);
|
|
105
|
-
const
|
|
120
|
+
const allRememberedRoots = await listRememberedRoots(options.rememberedRootsStore);
|
|
121
|
+
const resolvedWorkspace = path_1.default.resolve(workspaceDirectory);
|
|
122
|
+
const rememberedRoots = await filterRememberedRootsForWorkspace(allRememberedRoots, resolvedWorkspace);
|
|
123
|
+
const excludedByScope = allRememberedRoots.filter((root) => !rememberedRoots.includes(root));
|
|
106
124
|
let discoveryResult;
|
|
107
125
|
try {
|
|
108
126
|
discoveryResult = await (0, with_timeout_js_1.withTimeout)(discoverRootedWorkflowDirectories(rememberedRoots), DISCOVERY_TIMEOUT_MS, 'workflow_root_discovery');
|
|
@@ -159,6 +177,7 @@ async function createWorkflowReaderForRequest(options) {
|
|
|
159
177
|
stalePaths: allStalePaths,
|
|
160
178
|
managedSourceRecords: activeManagedRecords,
|
|
161
179
|
staleManagedRecords,
|
|
180
|
+
excludedByScope,
|
|
162
181
|
...(managedStoreError !== undefined ? { managedStoreError } : {}),
|
|
163
182
|
};
|
|
164
183
|
}
|
|
@@ -8,6 +8,7 @@ exports.detectWorkflowMigrationGuidance = detectWorkflowMigrationGuidance;
|
|
|
8
8
|
exports.isCompositeWorkflowReader = isCompositeWorkflowReader;
|
|
9
9
|
exports.deriveGroupLabel = deriveGroupLabel;
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const workspace_path_utils_js_1 = require("./workspace-path-utils.js");
|
|
11
12
|
function toWorkflowVisibility(workflow, rememberedRoots, options = {}) {
|
|
12
13
|
const source = {
|
|
13
14
|
kind: workflow.source.kind,
|
|
@@ -70,10 +71,7 @@ function deriveRootedSharingContext(workflow, rememberedRoots) {
|
|
|
70
71
|
const sourcePath = path_1.default.resolve(workflow.source.directoryPath);
|
|
71
72
|
for (const record of rememberedRoots) {
|
|
72
73
|
const rootPath = path_1.default.resolve(record.path);
|
|
73
|
-
|
|
74
|
-
const isUnderRoot = relative.length === 0 ||
|
|
75
|
-
(!relative.startsWith('..') && !path_1.default.isAbsolute(relative));
|
|
76
|
-
if (!isUnderRoot)
|
|
74
|
+
if (!(0, workspace_path_utils_js_1.isWorkspaceAncestor)(rootPath, sourcePath))
|
|
77
75
|
continue;
|
|
78
76
|
return {
|
|
79
77
|
kind: 'remembered_root',
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isWorkspaceAncestor = isWorkspaceAncestor;
|
|
7
|
+
exports.getGitCommonDir = getGitCommonDir;
|
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const child_process_1 = require("child_process");
|
|
11
|
+
const util_1 = require("util");
|
|
12
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
13
|
+
function isWorkspaceAncestor(root, workspace) {
|
|
14
|
+
const rel = path_1.default.relative(path_1.default.resolve(root), path_1.default.resolve(workspace));
|
|
15
|
+
return rel.length === 0 || (!rel.startsWith('..') && !path_1.default.isAbsolute(rel));
|
|
16
|
+
}
|
|
17
|
+
async function getGitCommonDir(dirPath) {
|
|
18
|
+
try {
|
|
19
|
+
const { stdout } = await execFileAsync('git', ['-C', dirPath, 'rev-parse', '--git-common-dir'], { encoding: 'utf-8', timeout: 500 });
|
|
20
|
+
const raw = stdout.trim();
|
|
21
|
+
if (!raw)
|
|
22
|
+
return null;
|
|
23
|
+
const resolved = path_1.default.resolve(dirPath, raw);
|
|
24
|
+
return await promises_1.default.realpath(resolved);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -170,12 +170,11 @@
|
|
|
170
170
|
"State what result the authored workflow should reliably produce for its user.",
|
|
171
171
|
"List the criteria that would make the workflow feel genuinely satisfying in practice.",
|
|
172
172
|
"Name the biggest likely failure mode and the most dangerous false-confidence mode.",
|
|
173
|
-
"State what would make the workflow technically correct but still disappointing."
|
|
174
|
-
"Build a success-criteria-to-mechanism map: for each item in userSatisfactionCriteria, name the specific step(s) that enforce it and the enforcement mechanism (gate, self-audit, second pass, example contrast, rubric). Any criterion with no named mechanism is a gap -- either add a mechanism to the planned architecture or flag it as a known weakness to address in Phase 3."
|
|
173
|
+
"State what would make the workflow technically correct but still disappointing."
|
|
175
174
|
],
|
|
176
175
|
"outputRequired": {
|
|
177
|
-
"notesMarkdown": "Effectiveness target, satisfaction criteria, failure modes, false-confidence risks
|
|
178
|
-
"context": "Capture effectivenessTarget, userSatisfactionCriteria, primaryFailureMode, dangerousFalseConfidenceModes, likelyWeakOutcomeModes,
|
|
176
|
+
"notesMarkdown": "Effectiveness target, satisfaction criteria, failure modes, and false-confidence risks.",
|
|
177
|
+
"context": "Capture effectivenessTarget, userSatisfactionCriteria, primaryFailureMode, dangerousFalseConfidenceModes, likelyWeakOutcomeModes, and trustRisk."
|
|
179
178
|
},
|
|
180
179
|
"verify": [
|
|
181
180
|
"The authored workflow now has a clear outcome bar, not just an authoring bar."
|
|
@@ -493,12 +492,11 @@
|
|
|
493
492
|
"Reviewer-family or validator output is evidence, not authority."
|
|
494
493
|
],
|
|
495
494
|
"procedure": [
|
|
496
|
-
"Score these dimensions 0-2 with one sentence of evidence each: `voiceClarity`, `ceremonyLevel`, `loopSoundness`, `delegationBoundedness`, `artifactClarity`, `taskEffectiveness`, `falseConfidenceResistance`, `stateMinimality`, `coverageSharpness`, `domainFit`, `handoffUtility`, `rigorAdaptability` (0 = adapts to complexity/rigor levels, 2 = single-weight), `enforcementStrength` (0 = behavioral rules have structural teeth; 2 = important rules are prose-only with no enforcement mechanism),
|
|
497
|
-
"For each generative step (any step whose output is judged on content quality rather than structural correctness), run an adversarial trace: what does a lazy or average agent do here, and does the prompt prevent it? A step where the lazy path produces a plausible-looking but shallow result scores poorly on `outputQualityMechanisms`. Check each such step against the successCriteriaToMechanismMap from Phase 1 -- any criterion whose mechanism lives in this step must actually be enforced here.",
|
|
495
|
+
"Score these dimensions 0-2 with one sentence of evidence each: `voiceClarity`, `ceremonyLevel`, `loopSoundness`, `delegationBoundedness`, `artifactClarity`, `taskEffectiveness`, `falseConfidenceResistance`, `stateMinimality`, `coverageSharpness`, `domainFit`, `handoffUtility`, `rigorAdaptability` (0 = adapts to complexity/rigor levels, 2 = single-weight), `enforcementStrength` (0 = behavioral rules have structural teeth; 2 = important rules are prose-only with no enforcement mechanism), and `modernizationDiscipline` (0 = every valueInventory item preserved, equivalently replaced with justification, or dropped with justification; 2 = items missing or replaced with weaker versions without justification -- score 0 for create mode).",
|
|
498
496
|
"If delegation is available and rigor is THOROUGH, run an adversarial review bundle with these lenses: `engine_native_reviewer`, `task_effectiveness_reviewer`, `state_economy_reviewer`, `false_confidence_reviewer`, `domain_fit_reviewer`, and `maintainer_reviewer`.",
|
|
499
497
|
"Synthesize what the review confirmed, what it challenged, and what changed your mind.",
|
|
500
498
|
"When scoring `falseConfidenceResistance`, explicitly check: do the workflow's quality gates protect edge cases and degraded paths, or only the happy path? A workflow that passes its own checks on ideal input but fails silently on minimal or unexpected input scores 2.",
|
|
501
|
-
"Set hard-gate failures whenever any of these are materially weak: `taskEffectiveness`, `falseConfidenceResistance`, `stateMinimality`, `coverageSharpness`, `domainFit`,
|
|
499
|
+
"Set hard-gate failures whenever any of these are materially weak: `taskEffectiveness`, `falseConfidenceResistance`, `stateMinimality`, `coverageSharpness`, `domainFit`, or `handoffUtility`.",
|
|
502
500
|
"Set `authoringIntegrityPassed = true` only if structural and authoring-quality dimensions are all acceptable. Set `outcomeEffectivenessPassed = true` only if the workflow is likely to achieve satisfying results for the user."
|
|
503
501
|
],
|
|
504
502
|
"outputRequired": {
|
|
@@ -550,7 +548,6 @@
|
|
|
550
548
|
{ "type": "contains", "value": "handoffUtility", "message": "Review must score handoffUtility" },
|
|
551
549
|
{ "type": "contains", "value": "rigorAdaptability", "message": "Review must score rigorAdaptability" },
|
|
552
550
|
{ "type": "contains", "value": "enforcementStrength", "message": "Review must score enforcementStrength" },
|
|
553
|
-
{ "type": "contains", "value": "outputQualityMechanisms", "message": "Review must score outputQualityMechanisms" },
|
|
554
551
|
{
|
|
555
552
|
"type": "contains",
|
|
556
553
|
"value": "modernizationDiscipline",
|
|
@@ -668,31 +665,6 @@
|
|
|
668
665
|
},
|
|
669
666
|
"notesOptional": true,
|
|
670
667
|
"requireConfirmation": false
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
"id": "phase-8-process-retrospective",
|
|
674
|
-
"title": "Phase 8: Process Retrospective",
|
|
675
|
-
"promptBlocks": {
|
|
676
|
-
"goal": "While this run is still fresh, identify gaps in the workflow-for-workflows process itself -- not in the authored workflow.",
|
|
677
|
-
"constraints": [
|
|
678
|
-
"This step is about the authoring process, not the authored workflow. Do not summarize the workflow again.",
|
|
679
|
-
"Be honest. If the process caught everything, say so. If it missed something, say specifically where and why."
|
|
680
|
-
],
|
|
681
|
-
"procedure": [
|
|
682
|
-
"Look back at the full run. Were any weaknesses in the authored workflow only identified post-hoc -- after the quality gate loop, by the user, or by a later reviewer?",
|
|
683
|
-
"For each weakness identified late: name the Phase where it should have been caught, explain why the current step failed to surface it, and propose a specific change to that step's procedure or scoring rubric that would catch it on the next run.",
|
|
684
|
-
"Check the successCriteriaToMechanismMap from Phase 1 against the final workflow: did every criterion end up with a concrete enforcement mechanism? Any criterion that is still prose-only in the final file is a gap in the Phase 1 or Phase 3 process.",
|
|
685
|
-
"If nothing was missed and the process caught all meaningful issues in-band, say so explicitly and explain what worked."
|
|
686
|
-
],
|
|
687
|
-
"outputRequired": {
|
|
688
|
-
"notesMarkdown": "Process gaps found (or confirmed absent), where they should have been caught, and concrete proposed changes to workflow-for-workflows. This output is raw material for improving this workflow.",
|
|
689
|
-
"context": "Capture processGaps and suggestedProcessImprovements."
|
|
690
|
-
},
|
|
691
|
-
"verify": [
|
|
692
|
-
"The retrospective identifies specific step-level changes, not vague general improvements."
|
|
693
|
-
]
|
|
694
|
-
},
|
|
695
|
-
"requireConfirmation": false
|
|
696
668
|
}
|
|
697
669
|
],
|
|
698
670
|
"validatedAgainstSpecVersion": 3
|