@cleocode/core 2026.4.5 → 2026.4.6
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/discovery.d.ts +69 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1643 -2349
- package/dist/index.js.map +4 -4
- package/dist/init.d.ts +51 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/internal.d.ts +9 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/lifecycle/default-chain.d.ts +8 -2
- package/dist/lifecycle/default-chain.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/stage-guidance.d.ts +140 -0
- package/dist/lifecycle/stage-guidance.d.ts.map +1 -0
- package/dist/orchestration/protocol-validators.d.ts +122 -3
- package/dist/orchestration/protocol-validators.d.ts.map +1 -1
- package/dist/paths.d.ts +91 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/scaffold.d.ts +31 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/skills/dispatch.d.ts +1 -1
- package/dist/skills/skill-paths.d.ts +9 -6
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/validation/protocols/_shared.d.ts +40 -0
- package/dist/validation/protocols/_shared.d.ts.map +1 -0
- package/dist/validation/protocols/architecture-decision.d.ts +23 -0
- package/dist/validation/protocols/architecture-decision.d.ts.map +1 -0
- package/dist/validation/protocols/artifact-publish.d.ts +22 -0
- package/dist/validation/protocols/artifact-publish.d.ts.map +1 -0
- package/dist/validation/protocols/consensus.d.ts +11 -17
- package/dist/validation/protocols/consensus.d.ts.map +1 -1
- package/dist/validation/protocols/contribution.d.ts +12 -17
- package/dist/validation/protocols/contribution.d.ts.map +1 -1
- package/dist/validation/protocols/decomposition.d.ts +18 -21
- package/dist/validation/protocols/decomposition.d.ts.map +1 -1
- package/dist/validation/protocols/implementation.d.ts +9 -17
- package/dist/validation/protocols/implementation.d.ts.map +1 -1
- package/dist/validation/protocols/provenance.d.ts +23 -0
- package/dist/validation/protocols/provenance.d.ts.map +1 -0
- package/dist/validation/protocols/release.d.ts +25 -0
- package/dist/validation/protocols/release.d.ts.map +1 -0
- package/dist/validation/protocols/research.d.ts +9 -17
- package/dist/validation/protocols/research.d.ts.map +1 -1
- package/dist/validation/protocols/specification.d.ts +7 -17
- package/dist/validation/protocols/specification.d.ts.map +1 -1
- package/dist/validation/protocols/testing.d.ts +22 -0
- package/dist/validation/protocols/testing.d.ts.map +1 -0
- package/dist/validation/protocols/validation.d.ts +22 -0
- package/dist/validation/protocols/validation.d.ts.map +1 -0
- package/package.json +7 -7
- package/src/__tests__/injection-mvi-tiers.test.js +54 -90
- package/src/__tests__/injection-mvi-tiers.test.js.map +1 -1
- package/src/discovery.ts +235 -0
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +3 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +1 -1
- package/src/index.ts +16 -0
- package/src/init.ts +196 -0
- package/src/internal.ts +31 -1
- package/src/lifecycle/default-chain.ts +11 -2
- package/src/lifecycle/index.ts +10 -0
- package/src/lifecycle/stage-guidance.ts +282 -0
- package/src/metrics/__tests__/provider-detection.test.js +19 -7
- package/src/metrics/__tests__/provider-detection.test.js.map +1 -1
- package/src/orchestration/__tests__/protocol-validators.test.js +228 -8
- package/src/orchestration/__tests__/protocol-validators.test.js.map +1 -1
- package/src/orchestration/__tests__/protocol-validators.test.ts +259 -7
- package/src/orchestration/protocol-validators.ts +419 -4
- package/src/paths.ts +110 -0
- package/src/scaffold.ts +240 -4
- package/src/skills/dispatch.ts +6 -6
- package/src/skills/skill-paths.ts +27 -23
- package/src/validation/protocols/_shared.ts +88 -0
- package/src/validation/protocols/architecture-decision.ts +52 -0
- package/src/validation/protocols/artifact-publish.ts +49 -0
- package/src/validation/protocols/consensus.ts +44 -74
- package/src/validation/protocols/contribution.ts +28 -65
- package/src/validation/protocols/decomposition.ts +37 -64
- package/src/validation/protocols/implementation.ts +25 -65
- package/src/validation/protocols/protocols-markdown/architecture-decision.md +303 -0
- package/src/validation/protocols/protocols-markdown/artifact-publish.md +600 -0
- package/src/validation/protocols/protocols-markdown/consensus.md +322 -0
- package/src/validation/protocols/protocols-markdown/contribution.md +388 -0
- package/src/validation/protocols/protocols-markdown/decomposition.md +421 -0
- package/src/validation/protocols/protocols-markdown/implementation.md +357 -0
- package/src/validation/protocols/protocols-markdown/provenance.md +613 -0
- package/src/validation/protocols/protocols-markdown/release.md +783 -0
- package/src/validation/protocols/protocols-markdown/research.md +261 -0
- package/src/validation/protocols/protocols-markdown/specification.md +300 -0
- package/src/validation/protocols/protocols-markdown/testing.md +287 -0
- package/src/validation/protocols/protocols-markdown/validation.md +242 -0
- package/src/validation/protocols/provenance.ts +50 -0
- package/src/validation/protocols/release.ts +44 -0
- package/src/validation/protocols/research.ts +25 -87
- package/src/validation/protocols/specification.ts +27 -89
- package/src/validation/protocols/testing.ts +46 -0
- package/src/validation/protocols/validation.ts +46 -0
- package/dist/validation/protocols/release-protocol.d.ts +0 -27
- package/dist/validation/protocols/release-protocol.d.ts.map +0 -1
- package/dist/validation/protocols/testing-protocol.d.ts +0 -27
- package/dist/validation/protocols/testing-protocol.d.ts.map +0 -1
- package/dist/validation/protocols/validation-protocol.d.ts +0 -27
- package/dist/validation/protocols/validation-protocol.d.ts.map +0 -1
- package/schemas/agent-configs.schema.json +0 -120
- package/schemas/agent-registry.schema.json +0 -132
- package/schemas/archive.schema.json +0 -450
- package/schemas/brain-decision.schema.json +0 -69
- package/schemas/brain-learning.schema.json +0 -57
- package/schemas/brain-pattern.schema.json +0 -72
- package/schemas/critical-path.schema.json +0 -246
- package/schemas/deps-cache.schema.json +0 -97
- package/schemas/doctor-output.schema.json +0 -283
- package/schemas/error.schema.json +0 -161
- package/schemas/global-config.schema.json +0 -219
- package/schemas/grade.schema.json +0 -49
- package/schemas/log.schema.json +0 -250
- package/schemas/metrics.schema.json +0 -328
- package/schemas/migrations.schema.json +0 -150
- package/schemas/nexus-registry.schema.json +0 -90
- package/schemas/operation-constitution.schema.json +0 -438
- package/schemas/output.schema.json +0 -164
- package/schemas/projects-registry.schema.json +0 -107
- package/schemas/protocol-frontmatter.schema.json +0 -72
- package/schemas/rcasd-consensus-report.schema.json +0 -10
- package/schemas/rcasd-evidence.schema.json +0 -42
- package/schemas/rcasd-gate-result.schema.json +0 -46
- package/schemas/rcasd-hitl-resolution.schema.json +0 -10
- package/schemas/rcasd-index.schema.json +0 -10
- package/schemas/rcasd-manifest.schema.json +0 -10
- package/schemas/rcasd-research-output.schema.json +0 -10
- package/schemas/rcasd-spec-frontmatter.schema.json +0 -10
- package/schemas/rcasd-stage-transition.schema.json +0 -38
- package/schemas/releases.schema.json +0 -267
- package/schemas/skills-manifest.schema.json +0 -91
- package/schemas/spec-index.schema.json +0 -196
- package/schemas/system-flow-atlas.schema.json +0 -125
- package/src/conduit/__tests__/dual-api-e2e.test.d.ts.map +0 -1
- package/src/conduit/__tests__/dual-api-e2e.test.js +0 -178
- package/src/conduit/__tests__/dual-api-e2e.test.js.map +0 -1
- package/src/conduit/__tests__/dual-api-e2e.test.ts +0 -212
- package/src/validation/protocols/release-protocol.ts +0 -80
- package/src/validation/protocols/testing-protocol.ts +0 -93
- package/src/validation/protocols/validation-protocol.ts +0 -93
|
@@ -1,101 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Research protocol
|
|
2
|
+
* Research protocol — thin wrapper delegating to the canonical pure validator.
|
|
3
|
+
*
|
|
3
4
|
* @task T4804
|
|
4
|
-
* @
|
|
5
|
+
* @task T260
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
protocol: string;
|
|
17
|
-
taskId: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function findManifestEntry(taskId: string, manifestPath: string): string | null {
|
|
21
|
-
if (!existsSync(manifestPath)) return null;
|
|
22
|
-
const lines = readFileSync(manifestPath, 'utf-8').trim().split('\n');
|
|
23
|
-
for (let i = lines.length - 1; i >= 0; i--) {
|
|
24
|
-
if (lines[i]!.includes(`"${taskId}"`)) return lines[i]!;
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
8
|
+
import {
|
|
9
|
+
type ProtocolValidationResult,
|
|
10
|
+
validateResearchProtocol,
|
|
11
|
+
} from '../../orchestration/protocol-validators.js';
|
|
12
|
+
import {
|
|
13
|
+
loadManifestEntryByTaskId,
|
|
14
|
+
loadManifestEntryFromFile,
|
|
15
|
+
throwIfStrictFailed,
|
|
16
|
+
} from './_shared.js';
|
|
28
17
|
|
|
29
18
|
/** Validate research protocol for a task. */
|
|
30
19
|
export async function validateResearchTask(
|
|
31
20
|
taskId: string,
|
|
32
|
-
opts: { strict?: boolean },
|
|
33
|
-
): Promise<
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
throw new CleoError(ExitCode.NOT_FOUND, `No manifest entry found for task ${taskId}`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const manifest = JSON.parse(entry);
|
|
41
|
-
const violations: ValidationResult['violations'] = [];
|
|
42
|
-
|
|
43
|
-
// RSCH-001: agent_type check
|
|
44
|
-
if (manifest.agent_type !== 'research') {
|
|
45
|
-
violations.push({
|
|
46
|
-
code: 'RSCH-001',
|
|
47
|
-
severity: 'high',
|
|
48
|
-
message: `Expected agent_type "research", got "${manifest.agent_type}"`,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// RSCH-002: key_findings must be present and non-empty
|
|
53
|
-
if (
|
|
54
|
-
!manifest.key_findings ||
|
|
55
|
-
!Array.isArray(manifest.key_findings) ||
|
|
56
|
-
manifest.key_findings.length === 0
|
|
57
|
-
) {
|
|
58
|
-
violations.push({
|
|
59
|
-
code: 'RSCH-002',
|
|
60
|
-
severity: 'high',
|
|
61
|
-
message: 'Research output must include non-empty key_findings array',
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// RSCH-003: output file must exist
|
|
66
|
-
if (manifest.file && !existsSync(manifest.file)) {
|
|
67
|
-
violations.push({
|
|
68
|
-
code: 'RSCH-003',
|
|
69
|
-
severity: 'medium',
|
|
70
|
-
message: `Output file "${manifest.file}" not found on disk`,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const score = violations.length === 0 ? 100 : Math.max(0, 100 - violations.length * 25);
|
|
75
|
-
const result: ValidationResult = {
|
|
76
|
-
valid: violations.length === 0,
|
|
77
|
-
violations,
|
|
78
|
-
score,
|
|
79
|
-
protocol: 'research',
|
|
80
|
-
taskId,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
if (opts.strict && violations.length > 0) {
|
|
84
|
-
throw new CleoError(60 as ExitCode, `Research protocol violations for ${taskId}`);
|
|
85
|
-
}
|
|
86
|
-
|
|
21
|
+
opts: { strict?: boolean; hasCodeChanges?: boolean },
|
|
22
|
+
): Promise<ProtocolValidationResult> {
|
|
23
|
+
const entry = loadManifestEntryByTaskId(taskId);
|
|
24
|
+
const result = validateResearchProtocol(entry, opts);
|
|
25
|
+
throwIfStrictFailed(result, opts, 'research', taskId);
|
|
87
26
|
return result;
|
|
88
27
|
}
|
|
89
28
|
|
|
90
|
-
/** Validate research protocol from manifest file. */
|
|
29
|
+
/** Validate research protocol from a manifest file. */
|
|
91
30
|
export async function checkResearchManifest(
|
|
92
31
|
manifestFile: string,
|
|
93
|
-
opts: { strict?: boolean },
|
|
94
|
-
): Promise<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return validateResearchTask(taskId, opts);
|
|
32
|
+
opts: { strict?: boolean; hasCodeChanges?: boolean },
|
|
33
|
+
): Promise<ProtocolValidationResult> {
|
|
34
|
+
const entry = loadManifestEntryFromFile(manifestFile);
|
|
35
|
+
const taskId = entry.linked_tasks?.[0] ?? 'UNKNOWN';
|
|
36
|
+
const result = validateResearchProtocol(entry, opts);
|
|
37
|
+
throwIfStrictFailed(result, opts, 'research', taskId);
|
|
38
|
+
return result;
|
|
101
39
|
}
|
|
@@ -1,106 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Specification protocol
|
|
2
|
+
* Specification protocol — thin wrapper delegating to the canonical pure validator.
|
|
3
|
+
*
|
|
3
4
|
* @task T4537
|
|
4
|
-
* @
|
|
5
|
+
* @task T260
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import { existsSync, readFileSync } from 'node:fs';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
taskId: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function findManifestEntry(taskId: string, manifestPath: string): string | null {
|
|
21
|
-
if (!existsSync(manifestPath)) return null;
|
|
22
|
-
const lines = readFileSync(manifestPath, 'utf-8').trim().split('\n');
|
|
23
|
-
for (let i = lines.length - 1; i >= 0; i--) {
|
|
24
|
-
if (lines[i]!.includes(`"${taskId}"`)) return lines[i]!;
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
9
|
+
import {
|
|
10
|
+
type ProtocolValidationResult,
|
|
11
|
+
validateSpecificationProtocol,
|
|
12
|
+
} from '../../orchestration/protocol-validators.js';
|
|
13
|
+
import {
|
|
14
|
+
loadManifestEntryByTaskId,
|
|
15
|
+
loadManifestEntryFromFile,
|
|
16
|
+
throwIfStrictFailed,
|
|
17
|
+
} from './_shared.js';
|
|
28
18
|
|
|
29
19
|
/** Validate specification protocol for a task. */
|
|
30
20
|
export async function validateSpecificationTask(
|
|
31
21
|
taskId: string,
|
|
32
22
|
opts: { strict?: boolean; specFile?: string },
|
|
33
|
-
): Promise<
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const manifest = JSON.parse(entry);
|
|
41
|
-
const violations: ValidationResult['violations'] = [];
|
|
42
|
-
|
|
43
|
-
// SPEC-007: agent_type check
|
|
44
|
-
if (manifest.agent_type !== 'specification') {
|
|
45
|
-
violations.push({
|
|
46
|
-
code: 'SPEC-007',
|
|
47
|
-
severity: 'high',
|
|
48
|
-
message: `Expected agent_type "specification", got "${manifest.agent_type}"`,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// SPEC-001: RFC 2119 keywords check
|
|
53
|
-
if (opts.specFile && existsSync(opts.specFile)) {
|
|
54
|
-
const specContent = readFileSync(opts.specFile, 'utf-8');
|
|
55
|
-
const rfc2119Keywords = ['MUST', 'SHOULD', 'MAY', 'MUST NOT', 'SHOULD NOT'];
|
|
56
|
-
const hasKeywords = rfc2119Keywords.some((kw) => specContent.includes(kw));
|
|
57
|
-
if (!hasKeywords) {
|
|
58
|
-
violations.push({
|
|
59
|
-
code: 'SPEC-001',
|
|
60
|
-
severity: 'medium',
|
|
61
|
-
message: 'Specification should contain RFC 2119 keywords (MUST/SHOULD/MAY)',
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// SPEC-002: version check
|
|
67
|
-
if (!manifest.version && opts.specFile) {
|
|
68
|
-
const specContent = existsSync(opts.specFile) ? readFileSync(opts.specFile, 'utf-8') : '';
|
|
69
|
-
const hasVersion = /version[:\s]+\d/i.test(specContent) || /^#+.*v\d/im.test(specContent);
|
|
70
|
-
if (!hasVersion) {
|
|
71
|
-
violations.push({
|
|
72
|
-
code: 'SPEC-002',
|
|
73
|
-
severity: 'medium',
|
|
74
|
-
message: 'Specification should include version information',
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const score = violations.length === 0 ? 100 : Math.max(0, 100 - violations.length * 20);
|
|
80
|
-
const result: ValidationResult = {
|
|
81
|
-
valid: violations.length === 0,
|
|
82
|
-
violations,
|
|
83
|
-
score,
|
|
84
|
-
protocol: 'specification',
|
|
85
|
-
taskId,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
if (opts.strict && violations.length > 0) {
|
|
89
|
-
throw new CleoError(62 as ExitCode, `Specification protocol violations for ${taskId}`);
|
|
90
|
-
}
|
|
91
|
-
|
|
23
|
+
): Promise<ProtocolValidationResult> {
|
|
24
|
+
const entry = loadManifestEntryByTaskId(taskId);
|
|
25
|
+
const specContent =
|
|
26
|
+
opts.specFile && existsSync(opts.specFile) ? readFileSync(opts.specFile, 'utf-8') : undefined;
|
|
27
|
+
const result = validateSpecificationProtocol(entry, specContent);
|
|
28
|
+
throwIfStrictFailed(result, opts, 'specification', taskId);
|
|
92
29
|
return result;
|
|
93
30
|
}
|
|
94
31
|
|
|
95
|
-
/** Validate specification protocol from manifest file. */
|
|
32
|
+
/** Validate specification protocol from a manifest file. */
|
|
96
33
|
export async function checkSpecificationManifest(
|
|
97
34
|
manifestFile: string,
|
|
98
35
|
opts: { strict?: boolean; specFile?: string },
|
|
99
|
-
): Promise<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
36
|
+
): Promise<ProtocolValidationResult> {
|
|
37
|
+
const entry = loadManifestEntryFromFile(manifestFile);
|
|
38
|
+
const taskId = entry.linked_tasks?.[0] ?? 'UNKNOWN';
|
|
39
|
+
const specContent =
|
|
40
|
+
opts.specFile && existsSync(opts.specFile) ? readFileSync(opts.specFile, 'utf-8') : undefined;
|
|
41
|
+
const result = validateSpecificationProtocol(entry, specContent);
|
|
42
|
+
throwIfStrictFailed(result, opts, 'specification', taskId);
|
|
43
|
+
return result;
|
|
106
44
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Testing protocol — thin wrapper delegating to the canonical pure validator.
|
|
3
|
+
*
|
|
4
|
+
* Renamed from testing-protocol.ts in T260. The testing protocol is the
|
|
5
|
+
* project-agnostic IVT loop closure stage: it checks that a detected test
|
|
6
|
+
* framework ran, achieved 100% pass rate, and the Implement→Validate→Test
|
|
7
|
+
* loop converged on the specification. Framework detection and loop logic
|
|
8
|
+
* live in the `ct-ivt-looper` skill; this validator only certifies results.
|
|
9
|
+
*
|
|
10
|
+
* @task T4804
|
|
11
|
+
* @task T260 — drop -protocol suffix, delegate, project-agnostic IVT
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
type ProtocolValidationResult,
|
|
16
|
+
type TestingOptions,
|
|
17
|
+
validateTestingProtocol,
|
|
18
|
+
} from '../../orchestration/protocol-validators.js';
|
|
19
|
+
import {
|
|
20
|
+
loadManifestEntryByTaskId,
|
|
21
|
+
loadManifestEntryFromFile,
|
|
22
|
+
throwIfStrictFailed,
|
|
23
|
+
} from './_shared.js';
|
|
24
|
+
|
|
25
|
+
/** Validate testing protocol for a task. */
|
|
26
|
+
export async function validateTestingTask(
|
|
27
|
+
taskId: string,
|
|
28
|
+
opts: { strict?: boolean } & TestingOptions,
|
|
29
|
+
): Promise<ProtocolValidationResult> {
|
|
30
|
+
const entry = loadManifestEntryByTaskId(taskId);
|
|
31
|
+
const result = validateTestingProtocol(entry, opts);
|
|
32
|
+
throwIfStrictFailed(result, opts, 'testing', taskId);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Validate testing protocol from a manifest file. */
|
|
37
|
+
export async function checkTestingManifest(
|
|
38
|
+
manifestFile: string,
|
|
39
|
+
opts: { strict?: boolean } & TestingOptions,
|
|
40
|
+
): Promise<ProtocolValidationResult> {
|
|
41
|
+
const entry = loadManifestEntryFromFile(manifestFile);
|
|
42
|
+
const taskId = entry.linked_tasks?.[0] ?? 'UNKNOWN';
|
|
43
|
+
const result = validateTestingProtocol(entry, opts);
|
|
44
|
+
throwIfStrictFailed(result, opts, 'testing', taskId);
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation protocol — thin wrapper delegating to the canonical pure validator.
|
|
3
|
+
*
|
|
4
|
+
* Renamed from validation-protocol.ts in T260. The validation stage runs
|
|
5
|
+
* static analysis, type checking, and pre-test quality gates. It is the
|
|
6
|
+
* first half of the IVT loop (Implement → Validate → Test); the validator
|
|
7
|
+
* here only verifies that a validation run produced a proper manifest
|
|
8
|
+
* entry — runtime gate enforcement is in the lifecycle state machine.
|
|
9
|
+
*
|
|
10
|
+
* @task T4804
|
|
11
|
+
* @task T260 — drop -protocol suffix, delegate to orchestration validator
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
type ProtocolValidationResult,
|
|
16
|
+
type ValidationStageOptions,
|
|
17
|
+
validateValidationProtocol,
|
|
18
|
+
} from '../../orchestration/protocol-validators.js';
|
|
19
|
+
import {
|
|
20
|
+
loadManifestEntryByTaskId,
|
|
21
|
+
loadManifestEntryFromFile,
|
|
22
|
+
throwIfStrictFailed,
|
|
23
|
+
} from './_shared.js';
|
|
24
|
+
|
|
25
|
+
/** Validate validation-stage protocol for a task. */
|
|
26
|
+
export async function validateValidationTask(
|
|
27
|
+
taskId: string,
|
|
28
|
+
opts: { strict?: boolean } & ValidationStageOptions,
|
|
29
|
+
): Promise<ProtocolValidationResult> {
|
|
30
|
+
const entry = loadManifestEntryByTaskId(taskId);
|
|
31
|
+
const result = validateValidationProtocol(entry, opts);
|
|
32
|
+
throwIfStrictFailed(result, opts, 'validation', taskId);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Validate validation-stage protocol from a manifest file. */
|
|
37
|
+
export async function checkValidationManifest(
|
|
38
|
+
manifestFile: string,
|
|
39
|
+
opts: { strict?: boolean } & ValidationStageOptions,
|
|
40
|
+
): Promise<ProtocolValidationResult> {
|
|
41
|
+
const entry = loadManifestEntryFromFile(manifestFile);
|
|
42
|
+
const taskId = entry.linked_tasks?.[0] ?? 'UNKNOWN';
|
|
43
|
+
const result = validateValidationProtocol(entry, opts);
|
|
44
|
+
throwIfStrictFailed(result, opts, 'validation', taskId);
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Release protocol validation.
|
|
3
|
-
* IVTR Stage: R (Release)
|
|
4
|
-
* @task T4804
|
|
5
|
-
* @epic T4798
|
|
6
|
-
*/
|
|
7
|
-
interface ValidationResult {
|
|
8
|
-
valid: boolean;
|
|
9
|
-
violations: Array<{
|
|
10
|
-
code: string;
|
|
11
|
-
severity: string;
|
|
12
|
-
message: string;
|
|
13
|
-
}>;
|
|
14
|
-
score: number;
|
|
15
|
-
protocol: string;
|
|
16
|
-
taskId: string;
|
|
17
|
-
}
|
|
18
|
-
/** Validate release protocol for a task. */
|
|
19
|
-
export declare function validateReleaseTask(taskId: string, opts: {
|
|
20
|
-
strict?: boolean;
|
|
21
|
-
}): Promise<ValidationResult>;
|
|
22
|
-
/** Validate release protocol from manifest file. */
|
|
23
|
-
export declare function checkReleaseManifest(manifestFile: string, opts: {
|
|
24
|
-
strict?: boolean;
|
|
25
|
-
}): Promise<ValidationResult>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=release-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"release-protocol.d.ts","sourceRoot":"","sources":["../../../src/validation/protocols/release-protocol.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD,4CAA4C;AAC5C,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAiC3B;AAED,oDAAoD;AACpD,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAO3B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Testing protocol validation.
|
|
3
|
-
* IVTR Stage: T (Testing)
|
|
4
|
-
* @task T4804
|
|
5
|
-
* @epic T4798
|
|
6
|
-
*/
|
|
7
|
-
interface ValidationResult {
|
|
8
|
-
valid: boolean;
|
|
9
|
-
violations: Array<{
|
|
10
|
-
code: string;
|
|
11
|
-
severity: string;
|
|
12
|
-
message: string;
|
|
13
|
-
}>;
|
|
14
|
-
score: number;
|
|
15
|
-
protocol: string;
|
|
16
|
-
taskId: string;
|
|
17
|
-
}
|
|
18
|
-
/** Validate testing protocol for a task. */
|
|
19
|
-
export declare function validateTestingTask(taskId: string, opts: {
|
|
20
|
-
strict?: boolean;
|
|
21
|
-
}): Promise<ValidationResult>;
|
|
22
|
-
/** Validate testing protocol from manifest file. */
|
|
23
|
-
export declare function checkTestingManifest(manifestFile: string, opts: {
|
|
24
|
-
strict?: boolean;
|
|
25
|
-
}): Promise<ValidationResult>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=testing-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing-protocol.d.ts","sourceRoot":"","sources":["../../../src/validation/protocols/testing-protocol.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD,4CAA4C;AAC5C,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CA8C3B;AAED,oDAAoD;AACpD,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAO3B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation (verify) protocol validation.
|
|
3
|
-
* IVTR Stage: V (Validation/Verify)
|
|
4
|
-
* @task T4804
|
|
5
|
-
* @epic T4798
|
|
6
|
-
*/
|
|
7
|
-
interface ValidationResult {
|
|
8
|
-
valid: boolean;
|
|
9
|
-
violations: Array<{
|
|
10
|
-
code: string;
|
|
11
|
-
severity: string;
|
|
12
|
-
message: string;
|
|
13
|
-
}>;
|
|
14
|
-
score: number;
|
|
15
|
-
protocol: string;
|
|
16
|
-
taskId: string;
|
|
17
|
-
}
|
|
18
|
-
/** Validate verification/validation protocol for a task. */
|
|
19
|
-
export declare function validateValidationTask(taskId: string, opts: {
|
|
20
|
-
strict?: boolean;
|
|
21
|
-
}): Promise<ValidationResult>;
|
|
22
|
-
/** Validate validation protocol from manifest file. */
|
|
23
|
-
export declare function checkValidationManifest(manifestFile: string, opts: {
|
|
24
|
-
strict?: boolean;
|
|
25
|
-
}): Promise<ValidationResult>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=validation-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-protocol.d.ts","sourceRoot":"","sources":["../../../src/validation/protocols/validation-protocol.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD,4DAA4D;AAC5D,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CA8C3B;AAED,uDAAuD;AACvD,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAO3B"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://cleo-dev.com/schemas/v1/agent-configs.schema.json",
|
|
4
|
-
"schemaVersion": "1.0.0",
|
|
5
|
-
"title": "CLEO Agent Configurations Registry Schema",
|
|
6
|
-
"description": "Global registry tracking agent configuration files (CLAUDE.md, AGENTS.md, GEMINI.md) at ~/.cleo/agent-configs.json. Monitors CLEO instruction injection versions and setup status across all supported LLM agent CLIs.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"required": ["schemaVersion", "lastUpdated", "configs"],
|
|
9
|
-
"additionalProperties": false,
|
|
10
|
-
|
|
11
|
-
"properties": {
|
|
12
|
-
"schemaVersion": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
15
|
-
"description": "Schema version for this registry file (semver). Initial version: 1.0.0."
|
|
16
|
-
},
|
|
17
|
-
"lastUpdated": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"format": "date-time",
|
|
20
|
-
"description": "ISO 8601 timestamp of last registry modification. Updated when any config entry changes."
|
|
21
|
-
},
|
|
22
|
-
"configs": {
|
|
23
|
-
"type": "object",
|
|
24
|
-
"description": "Agent configuration files keyed by absolute file path. Each entry tracks injection version and setup status for one agent config file.",
|
|
25
|
-
"additionalProperties": {
|
|
26
|
-
"$ref": "#/definitions/agentConfigEntry"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
"definitions": {
|
|
32
|
-
"agentConfigEntry": {
|
|
33
|
-
"type": "object",
|
|
34
|
-
"description": "Single agent configuration file tracking entry. Monitors CLEO instruction injection version and setup state.",
|
|
35
|
-
"required": ["version", "method", "setupDate", "status"],
|
|
36
|
-
"additionalProperties": false,
|
|
37
|
-
"properties": {
|
|
38
|
-
"version": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
41
|
-
"description": "CLEO version of injected instructions. Extracted from <!-- CLEO:START vX.X.X --> marker."
|
|
42
|
-
},
|
|
43
|
-
"method": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"enum": ["@", "inline", "embed"],
|
|
46
|
-
"description": "Injection method used: @=@ reference to ~/.cleo/docs/, inline=marker-based injection, embed=full content embedded."
|
|
47
|
-
},
|
|
48
|
-
"setupDate": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"format": "date-time",
|
|
51
|
-
"description": "ISO 8601 timestamp when this config file was first created/configured by CLEO."
|
|
52
|
-
},
|
|
53
|
-
"lastChecked": {
|
|
54
|
-
"type": ["string", "null"],
|
|
55
|
-
"format": "date-time",
|
|
56
|
-
"description": "ISO 8601 timestamp of most recent validation check. Null if never validated since setup."
|
|
57
|
-
},
|
|
58
|
-
"status": {
|
|
59
|
-
"type": "string",
|
|
60
|
-
"enum": ["current", "outdated", "missing", "invalid"],
|
|
61
|
-
"description": "Config file health status: current=version matches CLI, outdated=old version detected, missing=file not found, invalid=corrupt or unparseable."
|
|
62
|
-
},
|
|
63
|
-
"cliVersion": {
|
|
64
|
-
"type": ["string", "null"],
|
|
65
|
-
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
66
|
-
"description": "CLEO CLI version when last checked. Used to detect version drift between agent config and installed CLI."
|
|
67
|
-
},
|
|
68
|
-
"agentType": {
|
|
69
|
-
"type": ["string", "null"],
|
|
70
|
-
"enum": ["claude", "gemini", "codex", "kimi", null],
|
|
71
|
-
"description": "Agent type inferred from config file name/path. Null if cannot determine."
|
|
72
|
-
},
|
|
73
|
-
"notes": {
|
|
74
|
-
"type": ["string", "null"],
|
|
75
|
-
"maxLength": 500,
|
|
76
|
-
"description": "Optional notes about this config (e.g., manual edits detected, custom setup, migration status)."
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
"examples": [
|
|
83
|
-
{
|
|
84
|
-
"schemaVersion": "1.0.0",
|
|
85
|
-
"lastUpdated": "2026-01-05T14:23:45Z",
|
|
86
|
-
"configs": {
|
|
87
|
-
"/home/user/.claude/CLAUDE.md": {
|
|
88
|
-
"version": "0.50.2",
|
|
89
|
-
"method": "@",
|
|
90
|
-
"setupDate": "2026-01-01T10:00:00Z",
|
|
91
|
-
"lastChecked": "2026-01-05T14:23:45Z",
|
|
92
|
-
"status": "current",
|
|
93
|
-
"cliVersion": "0.50.2",
|
|
94
|
-
"agentType": "claude",
|
|
95
|
-
"notes": null
|
|
96
|
-
},
|
|
97
|
-
"/home/user/.claude/AGENTS.md": {
|
|
98
|
-
"version": "0.50.2",
|
|
99
|
-
"method": "@",
|
|
100
|
-
"setupDate": "2026-01-01T10:00:00Z",
|
|
101
|
-
"lastChecked": "2026-01-05T14:23:45Z",
|
|
102
|
-
"status": "current",
|
|
103
|
-
"cliVersion": "0.50.2",
|
|
104
|
-
"agentType": null,
|
|
105
|
-
"notes": null
|
|
106
|
-
},
|
|
107
|
-
"/home/user/.gemini/GEMINI.md": {
|
|
108
|
-
"version": "0.50.1",
|
|
109
|
-
"method": "@",
|
|
110
|
-
"setupDate": "2026-01-01T10:00:00Z",
|
|
111
|
-
"lastChecked": "2026-01-05T14:23:45Z",
|
|
112
|
-
"status": "outdated",
|
|
113
|
-
"cliVersion": "0.50.2",
|
|
114
|
-
"agentType": "gemini",
|
|
115
|
-
"notes": "Needs update to v0.50.2"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|