@cleocode/contracts 2026.4.70 → 2026.4.73
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/__tests__/evidence-record.test.d.ts +14 -0
- package/dist/__tests__/evidence-record.test.d.ts.map +1 -0
- package/dist/__tests__/evidence-record.test.js +362 -0
- package/dist/__tests__/evidence-record.test.js.map +1 -0
- package/dist/__tests__/invariants.test.d.ts +19 -0
- package/dist/__tests__/invariants.test.d.ts.map +1 -0
- package/dist/__tests__/invariants.test.js +351 -0
- package/dist/__tests__/invariants.test.js.map +1 -0
- package/dist/acceptance-gate-schema.d.ts +81 -4
- package/dist/acceptance-gate-schema.d.ts.map +1 -1
- package/dist/acceptance-gate-schema.js +60 -1
- package/dist/acceptance-gate-schema.js.map +1 -1
- package/dist/acceptance-gate.d.ts +99 -2
- package/dist/acceptance-gate.d.ts.map +1 -1
- package/dist/evidence-record-schema.d.ts +202 -0
- package/dist/evidence-record-schema.d.ts.map +1 -0
- package/dist/evidence-record-schema.js +130 -0
- package/dist/evidence-record-schema.js.map +1 -0
- package/dist/evidence-record.d.ts +167 -0
- package/dist/evidence-record.d.ts.map +1 -0
- package/dist/evidence-record.js +21 -0
- package/dist/evidence-record.js.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/task-evidence.d.ts +251 -0
- package/dist/task-evidence.d.ts.map +1 -0
- package/dist/task-evidence.js +89 -0
- package/dist/task-evidence.js.map +1 -0
- package/package.json +8 -2
- package/schemas/acceptance-gate.schema.json +9 -0
- package/schemas/attachment.schema.json +9 -0
- package/schemas/gate-result-details.schema.json +9 -0
- package/schemas/gate-result.schema.json +9 -0
- package/schemas/manifest-v1.json +176 -0
- package/schemas/task-evidence.schema.json +9 -0
- package/schemas/task.schema.json +9 -0
- package/src/__tests__/evidence-record.test.ts +412 -0
- package/src/__tests__/invariants.test.ts +445 -0
- package/src/acceptance-gate-schema.ts +65 -1
- package/src/acceptance-gate.ts +108 -2
- package/src/evidence-record-schema.ts +158 -0
- package/src/evidence-record.ts +182 -0
- package/src/index.ts +65 -1
- package/src/task-evidence.ts +239 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EvidenceRecord discriminated union — typed proof artifacts produced by IVTR agents.
|
|
3
|
+
*
|
|
4
|
+
* Each variant represents a specific kind of evidence that an IVTR-phase agent
|
|
5
|
+
* (implement, validate, test) can emit. All variants share a common set of
|
|
6
|
+
* provenance fields (`agentIdentity`, `attachmentSha256`, `ranAt`, `durationMs`)
|
|
7
|
+
* so that evidence rows can be queried, correlated, and archived uniformly.
|
|
8
|
+
*
|
|
9
|
+
* Five kinds are defined:
|
|
10
|
+
* - `impl-diff` — a code change produced by an implement-phase agent
|
|
11
|
+
* - `validate-spec-check` — a spec-requirements check by a validate-phase agent
|
|
12
|
+
* - `test-output` — the output of a test command run by a test-phase agent
|
|
13
|
+
* - `lint-report` — a static-analysis run (biome, tsc, etc.)
|
|
14
|
+
* - `command-output` — a generic CLI command invocation with exit code
|
|
15
|
+
*
|
|
16
|
+
* @epic T810
|
|
17
|
+
* @task T816
|
|
18
|
+
* @see {@link EvidenceRecordKind} for all discriminant values
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=evidence-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-record.js","sourceRoot":"","sources":["../src/evidence-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
* All domain types (Task, Session, DataAccessor, etc.) are defined here.
|
|
6
6
|
* Implementation packages (@cleocode/core, @cleocode/cleo) import from here.
|
|
7
7
|
*/
|
|
8
|
-
export type { AcceptanceGate, AcceptanceGateKind, AcceptanceGateResult, CommandGate, FileAssertion, FileGate, GateBase, HttpGate, LintGate, ManualGate, TestGate, } from './acceptance-gate.js';
|
|
9
|
-
export type { AcceptanceArrayInput, AcceptanceGateResultInput, AcceptanceGateSchemaInput, AcceptanceItemInput, FileAssertionInput, } from './acceptance-gate-schema.js';
|
|
10
|
-
export { acceptanceArraySchema, acceptanceGateResultSchema, acceptanceGateSchema, acceptanceItemSchema, commandGateSchema, fileAssertionSchema, fileGateSchema, gateBaseSchema, httpGateSchema, lintGateSchema, manualGateSchema, testGateSchema, } from './acceptance-gate-schema.js';
|
|
8
|
+
export type { AcceptanceGate, AcceptanceGateKind, AcceptanceGateResult, CommandGate, FileAssertion, FileGate, GateBase, GateResultDetails, HttpGate, LintGate, ManualGate, TestGate, } from './acceptance-gate.js';
|
|
9
|
+
export type { AcceptanceArrayInput, AcceptanceGateResultInput, AcceptanceGateSchemaInput, AcceptanceItemInput, FileAssertionInput, GateResultDetailsInput, } from './acceptance-gate-schema.js';
|
|
10
|
+
export { acceptanceArraySchema, acceptanceGateResultSchema, acceptanceGateSchema, acceptanceItemSchema, commandGateSchema, fileAssertionSchema, fileGateSchema, gateBaseSchema, gateResultDetailsSchema, httpGateSchema, lintGateSchema, manualGateSchema, testGateSchema, } from './acceptance-gate-schema.js';
|
|
11
11
|
export type { AdapterHealthStatus, CLEOProviderAdapter } from './adapter.js';
|
|
12
12
|
export type { AgentCredential, AgentListFilter, AgentRegistryAPI, AgentWithProjectOverride, ProjectAgentRef, TransportConfig, } from './agent-registry.js';
|
|
13
13
|
export type { ArchiveCycleTimesReport, ArchiveDailyTrend, ArchivedTask, ArchiveLabelEntry, ArchiveMetadata, ArchiveMonthlyTrend, ArchivePhaseEntry, ArchivePriorityEntry, ArchiveReportType, ArchiveStatsEnvelope, ArchiveSummaryReport, ArchiveTrendsReport, CycleTimeDistribution, CycleTimePercentiles, } from './archive.js';
|
|
14
14
|
export type { Attachment, AttachmentKind, AttachmentMetadata, AttachmentRef, BlobAttachment, LlmsTxtAttachment, LlmtxtDocAttachment, LocalFileAttachment, UrlAttachment, } from './attachment.js';
|
|
15
|
+
export type { AttachmentMetadataSchemaInput, AttachmentRefSchemaInput, AttachmentSchemaInput, } from './attachment-schema.js';
|
|
16
|
+
export { attachmentMetadataSchema, attachmentRefSchema, attachmentSchema, blobAttachmentSchema, llmsTxtAttachmentSchema, llmtxtDocAttachmentSchema, localFileAttachmentSchema, urlAttachmentSchema, } from './attachment-schema.js';
|
|
15
17
|
export type { BackupDatabaseEntry, BackupGlobalFileEntry, BackupIntegrity, BackupJsonEntry, BackupManifest, BackupMetadata, BackupScope, } from './backup-manifest.js';
|
|
16
18
|
export type { BrainCognitiveType, BrainEntryRef, BrainEntrySummary, BrainMemoryTier, BrainSourceConfidence, ContradictionDetail, SupersededEntry, } from './brain.js';
|
|
17
19
|
export type { AdapterCapabilities } from './capabilities.js';
|
|
@@ -23,6 +25,9 @@ export type { ArchiveFields, ArchiveFile, DataAccessor, DataAccessorAgentInstanc
|
|
|
23
25
|
export type { DependencyCategory, DependencyCheckResult, DependencyReport, DependencySpec, } from './dependency.js';
|
|
24
26
|
export type { AdapterManifest, DetectionPattern } from './discovery.js';
|
|
25
27
|
export { createErrorResult, createSuccessResult, formatError, getErrorMessage, isErrorResult, isErrorType, normalizeError, } from './errors.js';
|
|
28
|
+
export type { CommandOutputRecord, EvidenceRecord, EvidenceRecordKind, ImplDiffRecord, LintReportRecord, TestOutputRecord, ValidateSpecCheckRecord, } from './evidence-record.js';
|
|
29
|
+
export type { CommandOutputRecordInput, EvidenceRecordInput, ImplDiffRecordInput, LintReportRecordInput, TestOutputRecordInput, ValidateSpecCheckRecordInput, } from './evidence-record-schema.js';
|
|
30
|
+
export { commandOutputRecordSchema, evidenceRecordSchema, implDiffRecordSchema, lintReportRecordSchema, testOutputRecordSchema, validateSpecCheckRecordSchema, } from './evidence-record-schema.js';
|
|
26
31
|
export { ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
|
|
27
32
|
export type { AdminAPI, AgentCapacity, AgentHealthStatus, AgentInstanceRow, AgentInstanceStatus, AgentsAPI, AgentType, BlastRadius, BlastRadiusSeverity, BrainObservationType, CleoInitOptions, DuplicateStrategy, HybridSearchOptions, ImpactedTask, ImpactReport, ImportParams, IntelligenceAPI, LifecycleAPI, MemoryAPI, NexusAPI, OrchestrationAPI, RegisterAgentOptions, ReleaseAPI, SessionsAPI, StickyAPI, SyncAPI, TaskStartResult, TasksAPI, } from './facade.js';
|
|
28
33
|
export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
|
|
@@ -43,6 +48,8 @@ export type { AdapterSpawnProvider, SpawnContext, SpawnResult } from './spawn.js
|
|
|
43
48
|
export type { CAAMPSpawnOptions, CAAMPSpawnResult, CLEOSpawnAdapter, CLEOSpawnContext, CLEOSpawnResult, Provider, SpawnStatus, TokenResolution, } from './spawn-types.js';
|
|
44
49
|
export { ADR_STATUSES, type AdrStatus, type EntityType, GATE_STATUSES, type GateStatus, isValidStatus, LIFECYCLE_PIPELINE_STATUSES, LIFECYCLE_STAGE_STATUSES, MANIFEST_STATUSES, type ManifestStatus, PIPELINE_STATUS_ICONS, type PipelineStatus, SESSION_STATUSES, type SessionStatus, STAGE_STATUS_ICONS, STATUS_REGISTRY, type StageStatus, TASK_STATUS_SYMBOLS_ASCII, TASK_STATUS_SYMBOLS_UNICODE, TASK_STATUSES, type TaskStatus, TERMINAL_PIPELINE_STATUSES, TERMINAL_STAGE_STATUSES, TERMINAL_TASK_STATUSES, } from './status-registry.js';
|
|
45
50
|
export type { AcceptanceItem, CancelledTask, CompletedTask, EpicLifecycle, FileMeta, Phase, PhaseStatus, PhaseTransition, ProjectMeta, Release, ReleaseStatus, SessionNote, Task, TaskCreate, TaskOrigin, TaskPriority, TaskProvenance, TaskRelation, TaskSize, TaskType, TaskVerification, TaskWorkState, VerificationAgent, VerificationFailure, VerificationGate, } from './task.js';
|
|
51
|
+
export type { CommandOutputEvidence, FileEvidence, LogEvidence, ScreenshotEvidence, TaskEvidence, TaskEvidenceInput, TaskEvidenceKind, TestOutputEvidence, } from './task-evidence.js';
|
|
52
|
+
export { commandOutputEvidenceSchema, fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, taskEvidenceSchema, testOutputEvidenceSchema, } from './task-evidence.js';
|
|
46
53
|
export type { MinimalTaskRecord, TaskRecord, TaskRecordRelation, ValidationHistoryEntry, } from './task-record.js';
|
|
47
54
|
export type { ConflictPolicy, ExternalLinkType, ExternalTask, ExternalTaskLink, ExternalTaskProvider, ExternalTaskStatus, ReconcileAction, ReconcileActionType, ReconcileOptions, ReconcileResult, SyncDirection, } from './task-sync.js';
|
|
48
55
|
export type { TesseraInstantiationInput, TesseraTemplate, TesseraVariable, } from './tessera.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,yBAAy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Y,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,wBAAwB,EACxB,SAAS,EACT,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* Implementation packages (@cleocode/core, @cleocode/cleo) import from here.
|
|
7
7
|
*/
|
|
8
8
|
// === Acceptance Gate Zod Schemas (runtime validation) ===
|
|
9
|
-
export { acceptanceArraySchema, acceptanceGateResultSchema, acceptanceGateSchema, acceptanceItemSchema, commandGateSchema, fileAssertionSchema, fileGateSchema, gateBaseSchema, httpGateSchema, lintGateSchema, manualGateSchema, testGateSchema, } from './acceptance-gate-schema.js';
|
|
9
|
+
export { acceptanceArraySchema, acceptanceGateResultSchema, acceptanceGateSchema, acceptanceItemSchema, commandGateSchema, fileAssertionSchema, fileGateSchema, gateBaseSchema, gateResultDetailsSchema, httpGateSchema, lintGateSchema, manualGateSchema, testGateSchema, } from './acceptance-gate-schema.js';
|
|
10
|
+
export { attachmentMetadataSchema, attachmentRefSchema, attachmentSchema, blobAttachmentSchema, llmsTxtAttachmentSchema, llmtxtDocAttachmentSchema, localFileAttachmentSchema, urlAttachmentSchema, } from './attachment-schema.js';
|
|
10
11
|
// === Error Utilities ===
|
|
11
12
|
export { createErrorResult, createSuccessResult, formatError, getErrorMessage, isErrorResult, isErrorType, normalizeError, } from './errors.js';
|
|
13
|
+
// === Evidence Record Zod Schemas (runtime validation) ===
|
|
14
|
+
export { commandOutputRecordSchema, evidenceRecordSchema, implDiffRecordSchema, lintReportRecordSchema, testOutputRecordSchema, validateSpecCheckRecordSchema, } from './evidence-record-schema.js';
|
|
12
15
|
// === Exit Codes ===
|
|
13
16
|
export { ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
|
|
14
17
|
// === Facade API Interfaces ===
|
|
@@ -29,5 +32,6 @@ PIPELINE_STATUS_ICONS, SESSION_STATUSES, STAGE_STATUS_ICONS, STATUS_REGISTRY, TA
|
|
|
29
32
|
TASK_STATUSES, TERMINAL_PIPELINE_STATUSES, TERMINAL_STAGE_STATUSES,
|
|
30
33
|
// Terminal state sets
|
|
31
34
|
TERMINAL_TASK_STATUSES, } from './status-registry.js';
|
|
35
|
+
export { commandOutputEvidenceSchema, fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, taskEvidenceSchema, testOutputEvidenceSchema, } from './task-evidence.js';
|
|
32
36
|
// === WASM SDK (Rust crate bindings) ===
|
|
33
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,2DAA2D;AAC3D,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,6BAA6B,CAAC;AA+CrC,OAAO,EACL,wBAAwB,EACxB,mBAAmB,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2B,EAC3B,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAiD5B,yCAAyC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TaskEvidence discriminated union — typed evidence references for verification records.
|
|
3
|
+
*
|
|
4
|
+
* Replaces free-text evidence fields in verification records with structured,
|
|
5
|
+
* kind-specific evidence artifacts. Each variant carries a SHA-256 attachment
|
|
6
|
+
* reference, a timestamp, and optional description.
|
|
7
|
+
*
|
|
8
|
+
* Five evidence kinds are supported:
|
|
9
|
+
* - `file` — a file artifact (source file, output artifact, config)
|
|
10
|
+
* - `log` — a log stream captured from a process
|
|
11
|
+
* - `screenshot` — a visual capture (PNG/JPEG/WEBP)
|
|
12
|
+
* - `test-output` — structured test-runner output
|
|
13
|
+
* - `command-output` — raw stdout/stderr from a shell command
|
|
14
|
+
*
|
|
15
|
+
* @epic T760
|
|
16
|
+
* @task T801
|
|
17
|
+
* @see {@link AcceptanceGateResult} — `evidence` field
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
/**
|
|
21
|
+
* Evidence for a file artifact produced or inspected during verification.
|
|
22
|
+
*
|
|
23
|
+
* The `sha256` is the content hash of the file at capture time, used to
|
|
24
|
+
* look up the blob in the attachment store.
|
|
25
|
+
*/
|
|
26
|
+
export interface FileEvidence {
|
|
27
|
+
kind: 'file';
|
|
28
|
+
/** SHA-256 hex digest of the file at capture time (attachment ref). */
|
|
29
|
+
sha256: string;
|
|
30
|
+
/** ISO 8601 timestamp when evidence was captured. */
|
|
31
|
+
timestamp: string;
|
|
32
|
+
/** Path to the file, relative to the project root. */
|
|
33
|
+
path: string;
|
|
34
|
+
/** IANA MIME type of the file (e.g. `"text/typescript"`, `"application/pdf"`). */
|
|
35
|
+
mime?: string;
|
|
36
|
+
/** Optional human-readable note about this evidence artifact. */
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Evidence for a log stream captured from a running process.
|
|
41
|
+
*
|
|
42
|
+
* The `sha256` is the content hash of the captured log text.
|
|
43
|
+
*/
|
|
44
|
+
export interface LogEvidence {
|
|
45
|
+
kind: 'log';
|
|
46
|
+
/** SHA-256 hex digest of the captured log content. */
|
|
47
|
+
sha256: string;
|
|
48
|
+
/** ISO 8601 timestamp when evidence was captured. */
|
|
49
|
+
timestamp: string;
|
|
50
|
+
/**
|
|
51
|
+
* Source process name or description (e.g. `"pnpm test"`, `"node server.js"`).
|
|
52
|
+
*/
|
|
53
|
+
source: string;
|
|
54
|
+
/** Optional human-readable note about this log artifact. */
|
|
55
|
+
description?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Evidence for a screenshot or visual capture taken during verification.
|
|
59
|
+
*
|
|
60
|
+
* Used for manual gates and UI smoke tests. The `sha256` references the
|
|
61
|
+
* image blob in the attachment store.
|
|
62
|
+
*/
|
|
63
|
+
export interface ScreenshotEvidence {
|
|
64
|
+
kind: 'screenshot';
|
|
65
|
+
/** SHA-256 hex digest of the image file. */
|
|
66
|
+
sha256: string;
|
|
67
|
+
/** ISO 8601 timestamp when evidence was captured. */
|
|
68
|
+
timestamp: string;
|
|
69
|
+
/**
|
|
70
|
+
* MIME type of the image.
|
|
71
|
+
*
|
|
72
|
+
* @defaultValue "image/png"
|
|
73
|
+
*/
|
|
74
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp';
|
|
75
|
+
/** Optional human-readable note (e.g. `"dark mode toggle on macOS Chrome"`). */
|
|
76
|
+
description?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Evidence for structured test-runner output.
|
|
80
|
+
*
|
|
81
|
+
* Carries the summary metrics from the test run alongside the SHA-256
|
|
82
|
+
* reference to the full output blob.
|
|
83
|
+
*/
|
|
84
|
+
export interface TestOutputEvidence {
|
|
85
|
+
kind: 'test-output';
|
|
86
|
+
/** SHA-256 hex digest of the full test-runner output. */
|
|
87
|
+
sha256: string;
|
|
88
|
+
/** ISO 8601 timestamp when evidence was captured. */
|
|
89
|
+
timestamp: string;
|
|
90
|
+
/** Number of tests that passed. */
|
|
91
|
+
passed: number;
|
|
92
|
+
/** Number of tests that failed. */
|
|
93
|
+
failed: number;
|
|
94
|
+
/** Number of tests skipped or pending. */
|
|
95
|
+
skipped: number;
|
|
96
|
+
/** Exit code of the test process. */
|
|
97
|
+
exitCode: number;
|
|
98
|
+
/** Optional human-readable note about the test run. */
|
|
99
|
+
description?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Evidence for raw stdout/stderr output from a shell command.
|
|
103
|
+
*
|
|
104
|
+
* The `sha256` references the full output blob in the attachment store.
|
|
105
|
+
*/
|
|
106
|
+
export interface CommandOutputEvidence {
|
|
107
|
+
kind: 'command-output';
|
|
108
|
+
/** SHA-256 hex digest of the full command output. */
|
|
109
|
+
sha256: string;
|
|
110
|
+
/** ISO 8601 timestamp when evidence was captured. */
|
|
111
|
+
timestamp: string;
|
|
112
|
+
/** The command that was run (e.g. `"pnpm run build"`). */
|
|
113
|
+
cmd: string;
|
|
114
|
+
/** Exit code of the command process. */
|
|
115
|
+
exitCode: number;
|
|
116
|
+
/** Optional human-readable note about the command run. */
|
|
117
|
+
description?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A typed evidence artifact attached to a verification record.
|
|
121
|
+
*
|
|
122
|
+
* Replaces the bare `evidence?: string` field on {@link AcceptanceGateResult}
|
|
123
|
+
* with structured, kind-specific references backed by the attachment store.
|
|
124
|
+
*
|
|
125
|
+
* The `kind` field is the discriminant. All variants carry `sha256` (the
|
|
126
|
+
* attachment store ref), `timestamp`, and optional `description`.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* const ev: TaskEvidence = {
|
|
131
|
+
* kind: 'test-output',
|
|
132
|
+
* sha256: 'a1b2c3...ff',
|
|
133
|
+
* timestamp: '2026-04-15T10:00:00.000Z',
|
|
134
|
+
* passed: 42,
|
|
135
|
+
* failed: 0,
|
|
136
|
+
* skipped: 2,
|
|
137
|
+
* exitCode: 0,
|
|
138
|
+
* };
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export type TaskEvidence = FileEvidence | LogEvidence | ScreenshotEvidence | TestOutputEvidence | CommandOutputEvidence;
|
|
142
|
+
/** All valid `kind` discriminants for `TaskEvidence`. */
|
|
143
|
+
export type TaskEvidenceKind = TaskEvidence['kind'];
|
|
144
|
+
/** Zod schema for {@link FileEvidence}. */
|
|
145
|
+
export declare const fileEvidenceSchema: z.ZodObject<{
|
|
146
|
+
kind: z.ZodLiteral<"file">;
|
|
147
|
+
sha256: z.ZodString;
|
|
148
|
+
timestamp: z.ZodString;
|
|
149
|
+
path: z.ZodString;
|
|
150
|
+
mime: z.ZodOptional<z.ZodString>;
|
|
151
|
+
description: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
/** Zod schema for {@link LogEvidence}. */
|
|
154
|
+
export declare const logEvidenceSchema: z.ZodObject<{
|
|
155
|
+
kind: z.ZodLiteral<"log">;
|
|
156
|
+
sha256: z.ZodString;
|
|
157
|
+
timestamp: z.ZodString;
|
|
158
|
+
source: z.ZodString;
|
|
159
|
+
description: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
/** Zod schema for {@link ScreenshotEvidence}. */
|
|
162
|
+
export declare const screenshotEvidenceSchema: z.ZodObject<{
|
|
163
|
+
kind: z.ZodLiteral<"screenshot">;
|
|
164
|
+
sha256: z.ZodString;
|
|
165
|
+
timestamp: z.ZodString;
|
|
166
|
+
mime: z.ZodOptional<z.ZodEnum<{
|
|
167
|
+
"image/png": "image/png";
|
|
168
|
+
"image/jpeg": "image/jpeg";
|
|
169
|
+
"image/webp": "image/webp";
|
|
170
|
+
}>>;
|
|
171
|
+
description: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
/** Zod schema for {@link TestOutputEvidence}. */
|
|
174
|
+
export declare const testOutputEvidenceSchema: z.ZodObject<{
|
|
175
|
+
kind: z.ZodLiteral<"test-output">;
|
|
176
|
+
sha256: z.ZodString;
|
|
177
|
+
timestamp: z.ZodString;
|
|
178
|
+
passed: z.ZodNumber;
|
|
179
|
+
failed: z.ZodNumber;
|
|
180
|
+
skipped: z.ZodNumber;
|
|
181
|
+
exitCode: z.ZodNumber;
|
|
182
|
+
description: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
/** Zod schema for {@link CommandOutputEvidence}. */
|
|
185
|
+
export declare const commandOutputEvidenceSchema: z.ZodObject<{
|
|
186
|
+
kind: z.ZodLiteral<"command-output">;
|
|
187
|
+
sha256: z.ZodString;
|
|
188
|
+
timestamp: z.ZodString;
|
|
189
|
+
cmd: z.ZodString;
|
|
190
|
+
exitCode: z.ZodNumber;
|
|
191
|
+
description: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
/**
|
|
194
|
+
* Zod discriminated-union schema for {@link TaskEvidence}.
|
|
195
|
+
*
|
|
196
|
+
* Uses `z.discriminatedUnion('kind', [...])` for O(1) variant lookup.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* const ev = taskEvidenceSchema.parse({
|
|
201
|
+
* kind: 'command-output',
|
|
202
|
+
* sha256: 'a'.repeat(64),
|
|
203
|
+
* timestamp: '2026-04-15T10:00:00.000Z',
|
|
204
|
+
* cmd: 'pnpm run build',
|
|
205
|
+
* exitCode: 0,
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
export declare const taskEvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
210
|
+
kind: z.ZodLiteral<"file">;
|
|
211
|
+
sha256: z.ZodString;
|
|
212
|
+
timestamp: z.ZodString;
|
|
213
|
+
path: z.ZodString;
|
|
214
|
+
mime: z.ZodOptional<z.ZodString>;
|
|
215
|
+
description: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
217
|
+
kind: z.ZodLiteral<"log">;
|
|
218
|
+
sha256: z.ZodString;
|
|
219
|
+
timestamp: z.ZodString;
|
|
220
|
+
source: z.ZodString;
|
|
221
|
+
description: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
223
|
+
kind: z.ZodLiteral<"screenshot">;
|
|
224
|
+
sha256: z.ZodString;
|
|
225
|
+
timestamp: z.ZodString;
|
|
226
|
+
mime: z.ZodOptional<z.ZodEnum<{
|
|
227
|
+
"image/png": "image/png";
|
|
228
|
+
"image/jpeg": "image/jpeg";
|
|
229
|
+
"image/webp": "image/webp";
|
|
230
|
+
}>>;
|
|
231
|
+
description: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
kind: z.ZodLiteral<"test-output">;
|
|
234
|
+
sha256: z.ZodString;
|
|
235
|
+
timestamp: z.ZodString;
|
|
236
|
+
passed: z.ZodNumber;
|
|
237
|
+
failed: z.ZodNumber;
|
|
238
|
+
skipped: z.ZodNumber;
|
|
239
|
+
exitCode: z.ZodNumber;
|
|
240
|
+
description: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
242
|
+
kind: z.ZodLiteral<"command-output">;
|
|
243
|
+
sha256: z.ZodString;
|
|
244
|
+
timestamp: z.ZodString;
|
|
245
|
+
cmd: z.ZodString;
|
|
246
|
+
exitCode: z.ZodNumber;
|
|
247
|
+
description: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, z.core.$strip>], "kind">;
|
|
249
|
+
/** Inferred TypeScript type from {@link taskEvidenceSchema}. */
|
|
250
|
+
export type TaskEvidenceInput = z.input<typeof taskEvidenceSchema>;
|
|
251
|
+
//# sourceMappingURL=task-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-evidence.d.ts","sourceRoot":"","sources":["../src/task-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,KAAK,CAAC;IACZ,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;IACjD,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,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MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TaskEvidence discriminated union — typed evidence references for verification records.
|
|
3
|
+
*
|
|
4
|
+
* Replaces free-text evidence fields in verification records with structured,
|
|
5
|
+
* kind-specific evidence artifacts. Each variant carries a SHA-256 attachment
|
|
6
|
+
* reference, a timestamp, and optional description.
|
|
7
|
+
*
|
|
8
|
+
* Five evidence kinds are supported:
|
|
9
|
+
* - `file` — a file artifact (source file, output artifact, config)
|
|
10
|
+
* - `log` — a log stream captured from a process
|
|
11
|
+
* - `screenshot` — a visual capture (PNG/JPEG/WEBP)
|
|
12
|
+
* - `test-output` — structured test-runner output
|
|
13
|
+
* - `command-output` — raw stdout/stderr from a shell command
|
|
14
|
+
*
|
|
15
|
+
* @epic T760
|
|
16
|
+
* @task T801
|
|
17
|
+
* @see {@link AcceptanceGateResult} — `evidence` field
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
// ─── Zod schemas ─────────────────────────────────────────────────────────────
|
|
21
|
+
/** Zod schema for {@link FileEvidence}. */
|
|
22
|
+
export const fileEvidenceSchema = z.object({
|
|
23
|
+
kind: z.literal('file'),
|
|
24
|
+
sha256: z.string().length(64),
|
|
25
|
+
timestamp: z.string().datetime(),
|
|
26
|
+
path: z.string().min(1),
|
|
27
|
+
mime: z.string().optional(),
|
|
28
|
+
description: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
/** Zod schema for {@link LogEvidence}. */
|
|
31
|
+
export const logEvidenceSchema = z.object({
|
|
32
|
+
kind: z.literal('log'),
|
|
33
|
+
sha256: z.string().length(64),
|
|
34
|
+
timestamp: z.string().datetime(),
|
|
35
|
+
source: z.string().min(1),
|
|
36
|
+
description: z.string().optional(),
|
|
37
|
+
});
|
|
38
|
+
/** Zod schema for {@link ScreenshotEvidence}. */
|
|
39
|
+
export const screenshotEvidenceSchema = z.object({
|
|
40
|
+
kind: z.literal('screenshot'),
|
|
41
|
+
sha256: z.string().length(64),
|
|
42
|
+
timestamp: z.string().datetime(),
|
|
43
|
+
mime: z.enum(['image/png', 'image/jpeg', 'image/webp']).optional(),
|
|
44
|
+
description: z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
/** Zod schema for {@link TestOutputEvidence}. */
|
|
47
|
+
export const testOutputEvidenceSchema = z.object({
|
|
48
|
+
kind: z.literal('test-output'),
|
|
49
|
+
sha256: z.string().length(64),
|
|
50
|
+
timestamp: z.string().datetime(),
|
|
51
|
+
passed: z.number().int().nonnegative(),
|
|
52
|
+
failed: z.number().int().nonnegative(),
|
|
53
|
+
skipped: z.number().int().nonnegative(),
|
|
54
|
+
exitCode: z.number().int(),
|
|
55
|
+
description: z.string().optional(),
|
|
56
|
+
});
|
|
57
|
+
/** Zod schema for {@link CommandOutputEvidence}. */
|
|
58
|
+
export const commandOutputEvidenceSchema = z.object({
|
|
59
|
+
kind: z.literal('command-output'),
|
|
60
|
+
sha256: z.string().length(64),
|
|
61
|
+
timestamp: z.string().datetime(),
|
|
62
|
+
cmd: z.string().min(1),
|
|
63
|
+
exitCode: z.number().int(),
|
|
64
|
+
description: z.string().optional(),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Zod discriminated-union schema for {@link TaskEvidence}.
|
|
68
|
+
*
|
|
69
|
+
* Uses `z.discriminatedUnion('kind', [...])` for O(1) variant lookup.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const ev = taskEvidenceSchema.parse({
|
|
74
|
+
* kind: 'command-output',
|
|
75
|
+
* sha256: 'a'.repeat(64),
|
|
76
|
+
* timestamp: '2026-04-15T10:00:00.000Z',
|
|
77
|
+
* cmd: 'pnpm run build',
|
|
78
|
+
* exitCode: 0,
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export const taskEvidenceSchema = z.discriminatedUnion('kind', [
|
|
83
|
+
fileEvidenceSchema,
|
|
84
|
+
logEvidenceSchema,
|
|
85
|
+
screenshotEvidenceSchema,
|
|
86
|
+
testOutputEvidenceSchema,
|
|
87
|
+
commandOutputEvidenceSchema,
|
|
88
|
+
]);
|
|
89
|
+
//# sourceMappingURL=task-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-evidence.js","sourceRoot":"","sources":["../src/task-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8IxB,gFAAgF;AAEhF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,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2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,kBAAkB;IAClB,iBAAiB;IACjB,wBAAwB;IACxB,wBAAwB;IACxB,2BAA2B;CAC5B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/contracts",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.73",
|
|
4
4
|
"description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
+
"schemas",
|
|
23
24
|
"src"
|
|
24
25
|
],
|
|
25
26
|
"devDependencies": {
|
|
@@ -30,8 +31,13 @@
|
|
|
30
31
|
"url": "https://github.com/kryptobaseddev/cleo",
|
|
31
32
|
"directory": "packages/contracts"
|
|
32
33
|
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"zod-to-json-schema": "^3.25.2"
|
|
36
|
+
},
|
|
33
37
|
"scripts": {
|
|
34
|
-
"build": "tsc -b --force",
|
|
38
|
+
"build": "tsc -b --force && node scripts/emit-schemas.mjs",
|
|
39
|
+
"build:ts": "tsc -b --force",
|
|
40
|
+
"build:schemas": "node scripts/emit-schemas.mjs",
|
|
35
41
|
"typecheck": "tsc --noEmit",
|
|
36
42
|
"test": "vitest run"
|
|
37
43
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Attachment",
|
|
4
|
+
"description": "Content artifact (file, URL, blob, llms-txt, or llmtxt-doc) attachable to a CLEO owner",
|
|
5
|
+
"$ref": "#/definitions/Attachment",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"Attachment": {}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "GateResultDetails",
|
|
4
|
+
"description": "Kind-specific detail payload for a GateResult — discriminated by kind",
|
|
5
|
+
"$ref": "#/definitions/GateResultDetails",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"GateResultDetails": {}
|
|
8
|
+
}
|
|
9
|
+
}
|