@organon-methodology/tools 0.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/LICENSE +21 -0
- package/README.md +152 -0
- package/dist/cli/commands/coverage.d.ts +12 -0
- package/dist/cli/commands/coverage.d.ts.map +1 -0
- package/dist/cli/commands/coverage.js +80 -0
- package/dist/cli/commands/coverage.js.map +1 -0
- package/dist/cli/commands/find.d.ts +15 -0
- package/dist/cli/commands/find.d.ts.map +1 -0
- package/dist/cli/commands/find.js +81 -0
- package/dist/cli/commands/find.js.map +1 -0
- package/dist/cli/commands/generate-tests.d.ts +14 -0
- package/dist/cli/commands/generate-tests.d.ts.map +1 -0
- package/dist/cli/commands/generate-tests.js +87 -0
- package/dist/cli/commands/generate-tests.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +15 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +77 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/health.d.ts +13 -0
- package/dist/cli/commands/health.d.ts.map +1 -0
- package/dist/cli/commands/health.js +79 -0
- package/dist/cli/commands/health.js.map +1 -0
- package/dist/cli/commands/init.d.ts +14 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +132 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +11 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +26 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/query.d.ts +19 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +103 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/upgrade.d.ts +13 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +162 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +13 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +89 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +12 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +67 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/index.d.ts +19 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +59 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/add-protocols-array.d.ts +17 -0
- package/dist/core/add-protocols-array.d.ts.map +1 -0
- package/dist/core/add-protocols-array.js +95 -0
- package/dist/core/add-protocols-array.js.map +1 -0
- package/dist/core/add-protocols-array.test.d.ts +2 -0
- package/dist/core/add-protocols-array.test.d.ts.map +1 -0
- package/dist/core/add-protocols-array.test.js +86 -0
- package/dist/core/add-protocols-array.test.js.map +1 -0
- package/dist/core/config.d.ts +44 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +130 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/config.test.d.ts +2 -0
- package/dist/core/config.test.d.ts.map +1 -0
- package/dist/core/config.test.js +88 -0
- package/dist/core/config.test.js.map +1 -0
- package/dist/core/find.d.ts +29 -0
- package/dist/core/find.d.ts.map +1 -0
- package/dist/core/find.js +191 -0
- package/dist/core/find.js.map +1 -0
- package/dist/core/find.test.d.ts +2 -0
- package/dist/core/find.test.d.ts.map +1 -0
- package/dist/core/find.test.js +91 -0
- package/dist/core/find.test.js.map +1 -0
- package/dist/core/frontmatter-parser.d.ts +45 -0
- package/dist/core/frontmatter-parser.d.ts.map +1 -0
- package/dist/core/frontmatter-parser.js +122 -0
- package/dist/core/frontmatter-parser.js.map +1 -0
- package/dist/core/frontmatter-parser.test.d.ts +2 -0
- package/dist/core/frontmatter-parser.test.d.ts.map +1 -0
- package/dist/core/frontmatter-parser.test.js +200 -0
- package/dist/core/frontmatter-parser.test.js.map +1 -0
- package/dist/core/generate-frontmatter.d.ts +27 -0
- package/dist/core/generate-frontmatter.d.ts.map +1 -0
- package/dist/core/generate-frontmatter.js +219 -0
- package/dist/core/generate-frontmatter.js.map +1 -0
- package/dist/core/generate-frontmatter.test.d.ts +2 -0
- package/dist/core/generate-frontmatter.test.d.ts.map +1 -0
- package/dist/core/generate-frontmatter.test.js +161 -0
- package/dist/core/generate-frontmatter.test.js.map +1 -0
- package/dist/core/generate-tests.d.ts +41 -0
- package/dist/core/generate-tests.d.ts.map +1 -0
- package/dist/core/generate-tests.js +191 -0
- package/dist/core/generate-tests.js.map +1 -0
- package/dist/core/generate-tests.test.d.ts +2 -0
- package/dist/core/generate-tests.test.d.ts.map +1 -0
- package/dist/core/generate-tests.test.js +205 -0
- package/dist/core/generate-tests.test.js.map +1 -0
- package/dist/core/health.d.ts +16 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +156 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/health.test.d.ts +2 -0
- package/dist/core/health.test.d.ts.map +1 -0
- package/dist/core/health.test.js +97 -0
- package/dist/core/health.test.js.map +1 -0
- package/dist/core/init.d.ts +25 -0
- package/dist/core/init.d.ts.map +1 -0
- package/dist/core/init.js +100 -0
- package/dist/core/init.js.map +1 -0
- package/dist/core/init.test.d.ts +8 -0
- package/dist/core/init.test.d.ts.map +1 -0
- package/dist/core/init.test.js +203 -0
- package/dist/core/init.test.js.map +1 -0
- package/dist/core/invariant-coverage.d.ts +41 -0
- package/dist/core/invariant-coverage.d.ts.map +1 -0
- package/dist/core/invariant-coverage.js +181 -0
- package/dist/core/invariant-coverage.js.map +1 -0
- package/dist/core/invariant-coverage.test.d.ts +2 -0
- package/dist/core/invariant-coverage.test.d.ts.map +1 -0
- package/dist/core/invariant-coverage.test.js +188 -0
- package/dist/core/invariant-coverage.test.js.map +1 -0
- package/dist/core/meta-invariants.test.d.ts +17 -0
- package/dist/core/meta-invariants.test.d.ts.map +1 -0
- package/dist/core/meta-invariants.test.js +191 -0
- package/dist/core/meta-invariants.test.js.map +1 -0
- package/dist/core/node-fs.d.ts +22 -0
- package/dist/core/node-fs.d.ts.map +1 -0
- package/dist/core/node-fs.js +47 -0
- package/dist/core/node-fs.js.map +1 -0
- package/dist/core/organon-invariants.test.d.ts +15 -0
- package/dist/core/organon-invariants.test.d.ts.map +1 -0
- package/dist/core/organon-invariants.test.js +149 -0
- package/dist/core/organon-invariants.test.js.map +1 -0
- package/dist/core/query.d.ts +35 -0
- package/dist/core/query.d.ts.map +1 -0
- package/dist/core/query.js +139 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/query.test.d.ts +2 -0
- package/dist/core/query.test.d.ts.map +1 -0
- package/dist/core/query.test.js +97 -0
- package/dist/core/query.test.js.map +1 -0
- package/dist/core/suggest-tools.d.ts +15 -0
- package/dist/core/suggest-tools.d.ts.map +1 -0
- package/dist/core/suggest-tools.js +139 -0
- package/dist/core/suggest-tools.js.map +1 -0
- package/dist/core/suggest-tools.test.d.ts +2 -0
- package/dist/core/suggest-tools.test.d.ts.map +1 -0
- package/dist/core/suggest-tools.test.js +122 -0
- package/dist/core/suggest-tools.test.js.map +1 -0
- package/dist/core/test-helpers.d.ts +63 -0
- package/dist/core/test-helpers.d.ts.map +1 -0
- package/dist/core/test-helpers.js +265 -0
- package/dist/core/test-helpers.js.map +1 -0
- package/dist/core/types.d.ts +277 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/upgrade.d.ts +46 -0
- package/dist/core/upgrade.d.ts.map +1 -0
- package/dist/core/upgrade.js +227 -0
- package/dist/core/upgrade.js.map +1 -0
- package/dist/core/upgrade.test.d.ts +8 -0
- package/dist/core/upgrade.test.d.ts.map +1 -0
- package/dist/core/upgrade.test.js +370 -0
- package/dist/core/upgrade.test.js.map +1 -0
- package/dist/core/validate-frontmatter.d.ts +20 -0
- package/dist/core/validate-frontmatter.d.ts.map +1 -0
- package/dist/core/validate-frontmatter.js +529 -0
- package/dist/core/validate-frontmatter.js.map +1 -0
- package/dist/core/validate-frontmatter.test.d.ts +2 -0
- package/dist/core/validate-frontmatter.test.d.ts.map +1 -0
- package/dist/core/validate-frontmatter.test.js +366 -0
- package/dist/core/validate-frontmatter.test.js.map +1 -0
- package/dist/core/validate-workflow.d.ts +17 -0
- package/dist/core/validate-workflow.d.ts.map +1 -0
- package/dist/core/validate-workflow.js +233 -0
- package/dist/core/validate-workflow.js.map +1 -0
- package/dist/core/validate-workflow.test.d.ts +2 -0
- package/dist/core/validate-workflow.test.d.ts.map +1 -0
- package/dist/core/validate-workflow.test.js +205 -0
- package/dist/core/validate-workflow.test.js.map +1 -0
- package/dist/core/verify-tier4-tests.d.ts +34 -0
- package/dist/core/verify-tier4-tests.d.ts.map +1 -0
- package/dist/core/verify-tier4-tests.js +106 -0
- package/dist/core/verify-tier4-tests.js.map +1 -0
- package/dist/core/verify-tier4-tests.test.d.ts +2 -0
- package/dist/core/verify-tier4-tests.test.d.ts.map +1 -0
- package/dist/core/verify-tier4-tests.test.js +140 -0
- package/dist/core/verify-tier4-tests.test.js.map +1 -0
- package/dist/core/verify-triplets.d.ts +17 -0
- package/dist/core/verify-triplets.d.ts.map +1 -0
- package/dist/core/verify-triplets.js +217 -0
- package/dist/core/verify-triplets.js.map +1 -0
- package/dist/core/verify-triplets.test.d.ts +2 -0
- package/dist/core/verify-triplets.test.d.ts.map +1 -0
- package/dist/core/verify-triplets.test.js +147 -0
- package/dist/core/verify-triplets.test.js.map +1 -0
- package/dist/core/verify.d.ts +19 -0
- package/dist/core/verify.d.ts.map +1 -0
- package/dist/core/verify.js +162 -0
- package/dist/core/verify.js.map +1 -0
- package/dist/core/verify.test.d.ts +2 -0
- package/dist/core/verify.test.d.ts.map +1 -0
- package/dist/core/verify.test.js +147 -0
- package/dist/core/verify.test.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +265 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +7 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +111 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +31 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +7 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +130 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/templates/config.d.ts +6 -0
- package/dist/templates/config.d.ts.map +1 -0
- package/dist/templates/config.js +30 -0
- package/dist/templates/config.js.map +1 -0
- package/dist/templates/index.d.ts +7 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +7 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/organon/claude-md.d.ts +7 -0
- package/dist/templates/organon/claude-md.d.ts.map +1 -0
- package/dist/templates/organon/claude-md.js +32 -0
- package/dist/templates/organon/claude-md.js.map +1 -0
- package/dist/templates/organon/ethos.d.ts +5 -0
- package/dist/templates/organon/ethos.d.ts.map +1 -0
- package/dist/templates/organon/ethos.js +69 -0
- package/dist/templates/organon/ethos.js.map +1 -0
- package/dist/templates/organon/index.d.ts +10 -0
- package/dist/templates/organon/index.d.ts.map +1 -0
- package/dist/templates/organon/index.js +10 -0
- package/dist/templates/organon/index.js.map +1 -0
- package/dist/templates/organon/observations-readme.d.ts +5 -0
- package/dist/templates/organon/observations-readme.d.ts.map +1 -0
- package/dist/templates/organon/observations-readme.js +25 -0
- package/dist/templates/organon/observations-readme.js.map +1 -0
- package/dist/templates/organon/philosophy.d.ts +5 -0
- package/dist/templates/organon/philosophy.d.ts.map +1 -0
- package/dist/templates/organon/philosophy.js +75 -0
- package/dist/templates/organon/philosophy.js.map +1 -0
- package/dist/templates/organon/protocols.d.ts +7 -0
- package/dist/templates/organon/protocols.d.ts.map +1 -0
- package/dist/templates/organon/protocols.js +197 -0
- package/dist/templates/organon/protocols.js.map +1 -0
- package/dist/templates/organon/readme.d.ts +5 -0
- package/dist/templates/organon/readme.d.ts.map +1 -0
- package/dist/templates/organon/readme.js +40 -0
- package/dist/templates/organon/readme.js.map +1 -0
- package/dist/templates/skills/domain-feature-design.d.ts +9 -0
- package/dist/templates/skills/domain-feature-design.d.ts.map +1 -0
- package/dist/templates/skills/domain-feature-design.js +123 -0
- package/dist/templates/skills/domain-feature-design.js.map +1 -0
- package/dist/templates/skills/index.d.ts +15 -0
- package/dist/templates/skills/index.d.ts.map +1 -0
- package/dist/templates/skills/index.js +35 -0
- package/dist/templates/skills/index.js.map +1 -0
- package/dist/templates/skills/organon-file-creation.d.ts +9 -0
- package/dist/templates/skills/organon-file-creation.d.ts.map +1 -0
- package/dist/templates/skills/organon-file-creation.js +138 -0
- package/dist/templates/skills/organon-file-creation.js.map +1 -0
- package/dist/templates/skills/quality-review.d.ts +9 -0
- package/dist/templates/skills/quality-review.d.ts.map +1 -0
- package/dist/templates/skills/quality-review.js +127 -0
- package/dist/templates/skills/quality-review.js.map +1 -0
- package/dist/templates/skills/session-compounding.d.ts +9 -0
- package/dist/templates/skills/session-compounding.d.ts.map +1 -0
- package/dist/templates/skills/session-compounding.js +118 -0
- package/dist/templates/skills/session-compounding.js.map +1 -0
- package/dist/templates/skills/verify-and-health.d.ts +9 -0
- package/dist/templates/skills/verify-and-health.d.ts.map +1 -0
- package/dist/templates/skills/verify-and-health.js +99 -0
- package/dist/templates/skills/verify-and-health.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol ↔ Workflow ↔ Tool binding verification.
|
|
3
|
+
*
|
|
4
|
+
* Checks that the three-layer architecture is properly connected:
|
|
5
|
+
* - Every automated protocol has a workflow binding
|
|
6
|
+
* - Every workflow references back to its protocol
|
|
7
|
+
* - No orphaned workflows (workflow without a protocol)
|
|
8
|
+
* - No phantom automation (protocol claims automated but workflow is missing)
|
|
9
|
+
*/
|
|
10
|
+
import { parseFrontmatter } from './frontmatter-parser.js';
|
|
11
|
+
import { joinPath } from './config.js';
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Main
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
export async function verifyTriplets(options) {
|
|
16
|
+
const { projectRoot, config, fs } = options;
|
|
17
|
+
const errors = [];
|
|
18
|
+
const warnings = [];
|
|
19
|
+
// Discover protocol files (type: procedures)
|
|
20
|
+
const organonFiles = await discoverOrganonFiles(projectRoot, config, fs);
|
|
21
|
+
const protocolFiles = [];
|
|
22
|
+
const allFrontmatter = new Map();
|
|
23
|
+
for (const file of organonFiles) {
|
|
24
|
+
const absPath = joinPath(projectRoot, file);
|
|
25
|
+
try {
|
|
26
|
+
const content = await fs.readFile(absPath);
|
|
27
|
+
const { frontmatter, body } = parseFrontmatter(content);
|
|
28
|
+
allFrontmatter.set(file, frontmatter);
|
|
29
|
+
if (frontmatter?.type === 'procedures') {
|
|
30
|
+
protocolFiles.push({ path: file, frontmatter, rawFrontmatter: '', body, content });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
errors.push({
|
|
35
|
+
severity: 'error',
|
|
36
|
+
code: 'FILE_READ_ERROR',
|
|
37
|
+
message: `Cannot read file: ${file}`,
|
|
38
|
+
file,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Discover workflow files
|
|
43
|
+
const workflowFiles = await discoverWorkflowFiles(projectRoot, config, fs);
|
|
44
|
+
const workflowFrontmatter = new Map();
|
|
45
|
+
for (const wf of workflowFiles) {
|
|
46
|
+
const absPath = joinPath(projectRoot, wf);
|
|
47
|
+
try {
|
|
48
|
+
const content = await fs.readFile(absPath);
|
|
49
|
+
const { frontmatter } = parseFrontmatter(content);
|
|
50
|
+
if (frontmatter) {
|
|
51
|
+
workflowFrontmatter.set(wf, {
|
|
52
|
+
protocolId: frontmatter['protocol_id'],
|
|
53
|
+
protocolFile: frontmatter['protocol_file'],
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Try to extract protocol_id from body (some workflows use inline metadata)
|
|
58
|
+
const protoMatch = content.match(/protocol[_\s]?id\s*:\s*(\S+)/i);
|
|
59
|
+
const protoFileMatch = content.match(/protocol[_\s]?file\s*:\s*(\S+)/i);
|
|
60
|
+
workflowFrontmatter.set(wf, {
|
|
61
|
+
protocolId: protoMatch ? protoMatch[1] : undefined,
|
|
62
|
+
protocolFile: protoFileMatch ? protoFileMatch[1] : undefined,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Workflow file unreadable — will surface as orphan check issue
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Build bindings from protocol entries
|
|
71
|
+
const bindings = [];
|
|
72
|
+
const referencedWorkflows = new Set();
|
|
73
|
+
for (const pf of protocolFiles) {
|
|
74
|
+
if (!pf.frontmatter?.protocols)
|
|
75
|
+
continue;
|
|
76
|
+
for (const proto of pf.frontmatter.protocols) {
|
|
77
|
+
const bindingIssues = [];
|
|
78
|
+
let valid = true;
|
|
79
|
+
if (proto.automation_tier === 'automated') {
|
|
80
|
+
if (!proto.workflow) {
|
|
81
|
+
valid = false;
|
|
82
|
+
bindingIssues.push({
|
|
83
|
+
severity: 'error',
|
|
84
|
+
code: 'TRIPLET_MISSING_WORKFLOW_NAME',
|
|
85
|
+
message: `Protocol ${proto.id} is automated but has no workflow field`,
|
|
86
|
+
file: pf.path,
|
|
87
|
+
suggestion: `Add 'workflow: <name>' to protocol ${proto.id}`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
referencedWorkflows.add(proto.workflow);
|
|
92
|
+
// Find the workflow file
|
|
93
|
+
const wfFile = findWorkflowFile(proto.workflow, workflowFiles);
|
|
94
|
+
if (!wfFile) {
|
|
95
|
+
valid = false;
|
|
96
|
+
bindingIssues.push({
|
|
97
|
+
severity: 'error',
|
|
98
|
+
code: 'TRIPLET_WORKFLOW_NOT_FOUND',
|
|
99
|
+
message: `Protocol ${proto.id} references workflow '${proto.workflow}' but no matching file found`,
|
|
100
|
+
file: pf.path,
|
|
101
|
+
suggestion: `Create workflow file for '${proto.workflow}'`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// Check bidirectional reference
|
|
106
|
+
const wfData = workflowFrontmatter.get(wfFile);
|
|
107
|
+
if (wfData && wfData.protocolId !== proto.id) {
|
|
108
|
+
valid = false;
|
|
109
|
+
bindingIssues.push({
|
|
110
|
+
severity: 'error',
|
|
111
|
+
code: 'TRIPLET_BACK_REFERENCE_MISMATCH',
|
|
112
|
+
message: `Workflow '${wfFile}' has protocol_id '${wfData.protocolId ?? 'none'}' but expected '${proto.id}'`,
|
|
113
|
+
file: wfFile,
|
|
114
|
+
suggestion: `Update protocol_id in '${wfFile}' to '${proto.id}'`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
bindings.push({
|
|
121
|
+
protocolId: proto.id,
|
|
122
|
+
protocolFile: pf.path,
|
|
123
|
+
automationTier: proto.automation_tier,
|
|
124
|
+
workflowName: proto.workflow,
|
|
125
|
+
workflowFile: proto.workflow ? findWorkflowFile(proto.workflow, workflowFiles) ?? undefined : undefined,
|
|
126
|
+
tools: proto.tools,
|
|
127
|
+
valid,
|
|
128
|
+
issues: bindingIssues,
|
|
129
|
+
});
|
|
130
|
+
errors.push(...bindingIssues.filter((i) => i.severity === 'error'));
|
|
131
|
+
warnings.push(...bindingIssues.filter((i) => i.severity === 'warning'));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Find orphaned workflows (workflow files not referenced by any protocol)
|
|
135
|
+
const orphanedWorkflows = [];
|
|
136
|
+
for (const wf of workflowFiles) {
|
|
137
|
+
const wfData = workflowFrontmatter.get(wf);
|
|
138
|
+
if (wfData?.protocolId) {
|
|
139
|
+
// Check if any protocol actually has this ID
|
|
140
|
+
const referenced = bindings.some((b) => b.protocolId === wfData.protocolId);
|
|
141
|
+
if (!referenced) {
|
|
142
|
+
orphanedWorkflows.push(wf);
|
|
143
|
+
warnings.push({
|
|
144
|
+
severity: 'warning',
|
|
145
|
+
code: 'TRIPLET_ORPHANED_WORKFLOW',
|
|
146
|
+
message: `Workflow '${wf}' references protocol_id '${wfData.protocolId}' but no matching protocol found`,
|
|
147
|
+
file: wf,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Find phantom automation (protocol claims automated but no workflow exists anywhere)
|
|
153
|
+
const phantomAutomation = bindings
|
|
154
|
+
.filter((b) => b.automationTier === 'automated' && !b.valid)
|
|
155
|
+
.map((b) => b.protocolId);
|
|
156
|
+
return {
|
|
157
|
+
success: errors.length === 0,
|
|
158
|
+
bindings,
|
|
159
|
+
orphanedWorkflows,
|
|
160
|
+
phantomAutomation,
|
|
161
|
+
errors,
|
|
162
|
+
warnings,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
// Helpers
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
function findWorkflowFile(workflowName, workflowFiles) {
|
|
169
|
+
const normalized = workflowName.toLowerCase().replace(/[^a-z0-9]/g, '-');
|
|
170
|
+
for (const wf of workflowFiles) {
|
|
171
|
+
const wfNormalized = wf.replace(/\\/g, '/').toLowerCase();
|
|
172
|
+
if (wfNormalized.includes(normalized) ||
|
|
173
|
+
wfNormalized.includes(workflowName.toLowerCase())) {
|
|
174
|
+
return wf;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
async function discoverWorkflowFiles(projectRoot, config, fs) {
|
|
180
|
+
const files = new Set();
|
|
181
|
+
const paths = config.workflowPaths;
|
|
182
|
+
const searchPaths = [
|
|
183
|
+
paths.claudeCode,
|
|
184
|
+
paths.cursor,
|
|
185
|
+
paths.generic,
|
|
186
|
+
].filter((p) => p !== undefined);
|
|
187
|
+
for (const dir of searchPaths) {
|
|
188
|
+
const fullDir = joinPath(projectRoot, dir);
|
|
189
|
+
if (await fs.exists(fullDir)) {
|
|
190
|
+
const matches = await fs.glob('**/*.md', {
|
|
191
|
+
cwd: fullDir,
|
|
192
|
+
ignore: [],
|
|
193
|
+
});
|
|
194
|
+
for (const m of matches) {
|
|
195
|
+
files.add(joinPath(dir, m));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return [...files].sort();
|
|
200
|
+
}
|
|
201
|
+
async function discoverOrganonFiles(projectRoot, config, fs) {
|
|
202
|
+
const allFiles = new Set();
|
|
203
|
+
for (const organonPath of config.organonPaths) {
|
|
204
|
+
for (const pattern of config.organonGlobs) {
|
|
205
|
+
const fullPattern = organonPath === '.' ? pattern : `${organonPath}/${pattern}`;
|
|
206
|
+
const matches = await fs.glob(fullPattern, {
|
|
207
|
+
cwd: projectRoot,
|
|
208
|
+
ignore: config.ignorePatterns,
|
|
209
|
+
});
|
|
210
|
+
for (const m of matches) {
|
|
211
|
+
allFiles.add(m);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return [...allFiles].sort();
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=verify-triplets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-triplets.js","sourceRoot":"","sources":["../../src/core/verify-triplets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EA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CAAC;AAC3B,CAAC;AAED,KAAK,UAAU,oBAAoB,CACjC,WAAmB,EACnB,MAAqB,EACrB,EAAc;IAEd,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC9C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC1C,MAAM,WAAW,GAAG,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,OAAO,EAAE,CAAC;YAChF,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE;gBACzC,GAAG,EAAE,WAAW;gBAChB,MAAM,EAAE,MAAM,CAAC,cAAc;aAC9B,CAAC,CAAC;YACH,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-triplets.test.d.ts","sourceRoot":"","sources":["../../src/core/verify-triplets.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { verifyTriplets } from './verify-triplets.js';
|
|
3
|
+
import { MemoryFileSystem } from './test-helpers.js';
|
|
4
|
+
function makeConfig(projectRoot) {
|
|
5
|
+
return {
|
|
6
|
+
projectRoot,
|
|
7
|
+
organonPaths: ['.'],
|
|
8
|
+
organonGlobs: ['**/ETHOS.md', '**/PROTOCOL.md', '**/PROTOCOLS.md'],
|
|
9
|
+
ignorePatterns: [],
|
|
10
|
+
workflowPaths: { generic: 'workflows' },
|
|
11
|
+
freshnessThresholdHours: 24,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
describe('verifyTriplets', () => {
|
|
15
|
+
it('passes when automated protocols have valid workflow bindings', async () => {
|
|
16
|
+
const fs = new MemoryFileSystem({
|
|
17
|
+
'/project/PROTOCOLS.md': `---
|
|
18
|
+
type: procedures
|
|
19
|
+
scope: methodology
|
|
20
|
+
name: test-protocols
|
|
21
|
+
version: "1.0"
|
|
22
|
+
summary: Test
|
|
23
|
+
token_estimate: 300
|
|
24
|
+
protocols_count: 1
|
|
25
|
+
protocols:
|
|
26
|
+
- id: PROTO-TEST-1
|
|
27
|
+
name: Test Protocol
|
|
28
|
+
steps: 6
|
|
29
|
+
automation_tier: automated
|
|
30
|
+
workflow: test-workflow
|
|
31
|
+
complexity: high
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Steps
|
|
35
|
+
1. Do thing.`,
|
|
36
|
+
'/project/workflows/test-workflow.md': `---
|
|
37
|
+
protocol_id: PROTO-TEST-1
|
|
38
|
+
protocol_file: PROTOCOLS.md
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# Test Workflow`,
|
|
42
|
+
});
|
|
43
|
+
const config = makeConfig('/project');
|
|
44
|
+
const result = await verifyTriplets({ projectRoot: '/project', config, fs });
|
|
45
|
+
expect(result.bindings.length).toBe(1);
|
|
46
|
+
expect(result.bindings[0].valid).toBe(true);
|
|
47
|
+
expect(result.phantomAutomation).toHaveLength(0);
|
|
48
|
+
});
|
|
49
|
+
it('detects phantom automation (protocol automated but no workflow)', async () => {
|
|
50
|
+
const fs = new MemoryFileSystem({
|
|
51
|
+
'/project/PROTOCOLS.md': `---
|
|
52
|
+
type: procedures
|
|
53
|
+
scope: methodology
|
|
54
|
+
name: test-protocols
|
|
55
|
+
version: "1.0"
|
|
56
|
+
summary: Test
|
|
57
|
+
token_estimate: 300
|
|
58
|
+
protocols_count: 1
|
|
59
|
+
protocols:
|
|
60
|
+
- id: PROTO-TEST-1
|
|
61
|
+
name: Test Protocol
|
|
62
|
+
steps: 6
|
|
63
|
+
automation_tier: automated
|
|
64
|
+
workflow: nonexistent-workflow
|
|
65
|
+
complexity: high
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Steps
|
|
69
|
+
1. Do thing.`,
|
|
70
|
+
});
|
|
71
|
+
const config = makeConfig('/project');
|
|
72
|
+
const result = await verifyTriplets({ projectRoot: '/project', config, fs });
|
|
73
|
+
expect(result.success).toBe(false);
|
|
74
|
+
expect(result.phantomAutomation).toContain('PROTO-TEST-1');
|
|
75
|
+
});
|
|
76
|
+
it('detects missing workflow field for automated protocol', async () => {
|
|
77
|
+
const fs = new MemoryFileSystem({
|
|
78
|
+
'/project/PROTOCOLS.md': `---
|
|
79
|
+
type: procedures
|
|
80
|
+
scope: methodology
|
|
81
|
+
name: test-protocols
|
|
82
|
+
version: "1.0"
|
|
83
|
+
summary: Test
|
|
84
|
+
token_estimate: 300
|
|
85
|
+
protocols_count: 1
|
|
86
|
+
protocols:
|
|
87
|
+
- id: PROTO-TEST-1
|
|
88
|
+
name: Test Protocol
|
|
89
|
+
steps: 6
|
|
90
|
+
automation_tier: automated
|
|
91
|
+
complexity: high
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Steps
|
|
95
|
+
1. Do thing.`,
|
|
96
|
+
});
|
|
97
|
+
const config = makeConfig('/project');
|
|
98
|
+
const result = await verifyTriplets({ projectRoot: '/project', config, fs });
|
|
99
|
+
expect(result.success).toBe(false);
|
|
100
|
+
expect(result.errors).toContainEqual(expect.objectContaining({ code: 'TRIPLET_MISSING_WORKFLOW_NAME' }));
|
|
101
|
+
});
|
|
102
|
+
it('passes for manual protocols without workflows', async () => {
|
|
103
|
+
const fs = new MemoryFileSystem({
|
|
104
|
+
'/project/PROTOCOLS.md': `---
|
|
105
|
+
type: procedures
|
|
106
|
+
scope: methodology
|
|
107
|
+
name: test-protocols
|
|
108
|
+
version: "1.0"
|
|
109
|
+
summary: Test
|
|
110
|
+
token_estimate: 300
|
|
111
|
+
protocols_count: 1
|
|
112
|
+
protocols:
|
|
113
|
+
- id: PROTO-TEST-1
|
|
114
|
+
name: Manual Protocol
|
|
115
|
+
steps: 3
|
|
116
|
+
automation_tier: manual
|
|
117
|
+
complexity: low
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Steps
|
|
121
|
+
1. Do thing.`,
|
|
122
|
+
});
|
|
123
|
+
const config = makeConfig('/project');
|
|
124
|
+
const result = await verifyTriplets({ projectRoot: '/project', config, fs });
|
|
125
|
+
expect(result.success).toBe(true);
|
|
126
|
+
expect(result.bindings[0].valid).toBe(true);
|
|
127
|
+
});
|
|
128
|
+
it('succeeds when no protocol files exist', async () => {
|
|
129
|
+
const fs = new MemoryFileSystem({
|
|
130
|
+
'/project/ETHOS.md': `---
|
|
131
|
+
type: constraints
|
|
132
|
+
scope: product
|
|
133
|
+
name: test
|
|
134
|
+
version: "1.0"
|
|
135
|
+
summary: Test
|
|
136
|
+
token_estimate: 100
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
# Content`,
|
|
140
|
+
});
|
|
141
|
+
const config = makeConfig('/project');
|
|
142
|
+
const result = await verifyTriplets({ projectRoot: '/project', config, fs });
|
|
143
|
+
expect(result.success).toBe(true);
|
|
144
|
+
expect(result.bindings).toHaveLength(0);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=verify-triplets.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-triplets.test.js","sourceRoot":"","sources":["../../src/core/verify-triplets.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,SAAS,UAAU,CAAC,WAAmB;IACrC,OAAO;QACL,WAAW;QACX,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AC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,IAAI,gBAAgB,CAAC;YAC9B,mBAAmB,EAAE;;;;;;;;;UASjB;SACL,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC7E,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verification orchestrator with extensible gate registry.
|
|
3
|
+
*
|
|
4
|
+
* Built-in gates: frontmatter, triplets, freshness.
|
|
5
|
+
* Projects can register custom gates via registerGate().
|
|
6
|
+
* The orchestrator runs all registered gates (or a named subset).
|
|
7
|
+
*/
|
|
8
|
+
import type { FileSystem, OrganonConfig, VerifyGateFn, VerifyResult } from './types.js';
|
|
9
|
+
export interface VerifyOptions {
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
config: OrganonConfig;
|
|
12
|
+
fs: FileSystem;
|
|
13
|
+
/** Run only these gates. If empty/undefined, runs all registered gates. */
|
|
14
|
+
gates?: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function registerGate(name: string, fn: VerifyGateFn): void;
|
|
17
|
+
export declare function getRegisteredGates(): string[];
|
|
18
|
+
export declare function verify(options: VerifyOptions): Promise<VerifyResult>;
|
|
19
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/core/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACb,YAAY,EAEZ,YAAY,EACb,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,EAAE,EAAE,UAAU,CAAC;IACf,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAQD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,GAAG,IAAI,CAEjE;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAkGD,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAwD1E"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verification orchestrator with extensible gate registry.
|
|
3
|
+
*
|
|
4
|
+
* Built-in gates: frontmatter, triplets, freshness.
|
|
5
|
+
* Projects can register custom gates via registerGate().
|
|
6
|
+
* The orchestrator runs all registered gates (or a named subset).
|
|
7
|
+
*/
|
|
8
|
+
import { validateFrontmatter } from './validate-frontmatter.js';
|
|
9
|
+
import { verifyTriplets } from './verify-triplets.js';
|
|
10
|
+
import { health as runHealth } from './health.js';
|
|
11
|
+
import { computeInvariantCoverage } from './invariant-coverage.js';
|
|
12
|
+
import { validateWorkflow } from './validate-workflow.js';
|
|
13
|
+
import { verifyTier4Tests } from './verify-tier4-tests.js';
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Gate registry
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
const gateRegistry = new Map();
|
|
18
|
+
export function registerGate(name, fn) {
|
|
19
|
+
gateRegistry.set(name, fn);
|
|
20
|
+
}
|
|
21
|
+
export function getRegisteredGates() {
|
|
22
|
+
return [...gateRegistry.keys()];
|
|
23
|
+
}
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Built-in gates
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
const frontmatterGate = async ({ projectRoot, config, fs }) => {
|
|
28
|
+
const result = await validateFrontmatter({ projectRoot, config, fs });
|
|
29
|
+
return {
|
|
30
|
+
gate: 'frontmatter',
|
|
31
|
+
passed: result.success,
|
|
32
|
+
errors: result.errors,
|
|
33
|
+
warnings: result.warnings,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const tripletsGate = async ({ projectRoot, config, fs }) => {
|
|
37
|
+
const result = await verifyTriplets({ projectRoot, config, fs });
|
|
38
|
+
return {
|
|
39
|
+
gate: 'triplets',
|
|
40
|
+
passed: result.success,
|
|
41
|
+
errors: result.errors,
|
|
42
|
+
warnings: result.warnings,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const freshnessGate = async ({ projectRoot, config, fs }) => {
|
|
46
|
+
const result = await runHealth({ projectRoot, config, fs });
|
|
47
|
+
const errors = [];
|
|
48
|
+
const warnings = [];
|
|
49
|
+
if (result.freshness.stale > 0) {
|
|
50
|
+
warnings.push({
|
|
51
|
+
severity: 'warning',
|
|
52
|
+
code: 'FRESHNESS_STALE_FILES',
|
|
53
|
+
message: `${result.freshness.stale} organon file(s) exceed the freshness threshold of ${config.freshnessThresholdHours}h`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (result.freshness.stalestFile) {
|
|
57
|
+
warnings.push({
|
|
58
|
+
severity: 'warning',
|
|
59
|
+
code: 'FRESHNESS_STALEST',
|
|
60
|
+
message: `Stalest file: ${result.freshness.stalestFile.file} (last modified: ${result.freshness.stalestFile.lastModified.toISOString()})`,
|
|
61
|
+
file: result.freshness.stalestFile.file,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
gate: 'freshness',
|
|
66
|
+
passed: true, // Freshness is advisory, not blocking
|
|
67
|
+
errors,
|
|
68
|
+
warnings,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const invariantCoverageGate = async ({ projectRoot, config, fs }) => {
|
|
72
|
+
const result = await computeInvariantCoverage({ projectRoot, config, fs });
|
|
73
|
+
return {
|
|
74
|
+
gate: 'invariant-coverage',
|
|
75
|
+
passed: result.success,
|
|
76
|
+
errors: result.errors,
|
|
77
|
+
warnings: result.warnings,
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const workflowQualityGate = async ({ projectRoot, config, fs }) => {
|
|
81
|
+
const result = await validateWorkflow({ projectRoot, config, fs });
|
|
82
|
+
return {
|
|
83
|
+
gate: 'workflow-quality',
|
|
84
|
+
passed: result.success,
|
|
85
|
+
errors: result.errors,
|
|
86
|
+
warnings: result.warnings,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const tier4TestsGate = async ({ projectRoot, config, fs }) => {
|
|
90
|
+
const result = await verifyTier4Tests({ projectRoot, config, fs });
|
|
91
|
+
return {
|
|
92
|
+
gate: 'tier4-tests',
|
|
93
|
+
passed: result.success,
|
|
94
|
+
errors: result.errors,
|
|
95
|
+
warnings: result.warnings,
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
// Register built-in gates
|
|
99
|
+
registerGate('frontmatter', frontmatterGate);
|
|
100
|
+
registerGate('triplets', tripletsGate);
|
|
101
|
+
registerGate('freshness', freshnessGate);
|
|
102
|
+
registerGate('invariant-coverage', invariantCoverageGate);
|
|
103
|
+
registerGate('workflow-quality', workflowQualityGate);
|
|
104
|
+
registerGate('tier4-tests', tier4TestsGate);
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Main
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
export async function verify(options) {
|
|
109
|
+
const { gates: requestedGates } = options;
|
|
110
|
+
const allErrors = [];
|
|
111
|
+
const allWarnings = [];
|
|
112
|
+
const gateResults = [];
|
|
113
|
+
const gatesToRun = requestedGates && requestedGates.length > 0
|
|
114
|
+
? requestedGates
|
|
115
|
+
: [...gateRegistry.keys()];
|
|
116
|
+
for (const gateName of gatesToRun) {
|
|
117
|
+
const gateFn = gateRegistry.get(gateName);
|
|
118
|
+
if (!gateFn) {
|
|
119
|
+
allErrors.push({
|
|
120
|
+
severity: 'error',
|
|
121
|
+
code: 'UNKNOWN_GATE',
|
|
122
|
+
message: `Unknown verification gate: '${gateName}'. Available: ${[...gateRegistry.keys()].join(', ')}`,
|
|
123
|
+
});
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
const result = await gateFn({
|
|
128
|
+
projectRoot: options.projectRoot,
|
|
129
|
+
config: options.config,
|
|
130
|
+
fs: options.fs,
|
|
131
|
+
});
|
|
132
|
+
gateResults.push(result);
|
|
133
|
+
allErrors.push(...result.errors);
|
|
134
|
+
allWarnings.push(...result.warnings);
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
138
|
+
gateResults.push({
|
|
139
|
+
gate: gateName,
|
|
140
|
+
passed: false,
|
|
141
|
+
errors: [{
|
|
142
|
+
severity: 'error',
|
|
143
|
+
code: 'GATE_EXECUTION_ERROR',
|
|
144
|
+
message: `Gate '${gateName}' failed: ${message}`,
|
|
145
|
+
}],
|
|
146
|
+
warnings: [],
|
|
147
|
+
});
|
|
148
|
+
allErrors.push({
|
|
149
|
+
severity: 'error',
|
|
150
|
+
code: 'GATE_EXECUTION_ERROR',
|
|
151
|
+
message: `Gate '${gateName}' failed: ${message}`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
success: gateResults.every((g) => g.passed),
|
|
157
|
+
gates: gateResults,
|
|
158
|
+
errors: allErrors,
|
|
159
|
+
warnings: allWarnings,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
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