@sentropic/harness 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/validate-verification-run.d.ts +28 -0
- package/dist/artifacts/validate-verification-run.d.ts.map +1 -0
- package/dist/artifacts/validate-verification-run.js +160 -0
- package/dist/artifacts/validate-verification-run.js.map +1 -0
- package/dist/artifacts/verification-run.d.ts +43 -2
- package/dist/artifacts/verification-run.d.ts.map +1 -1
- package/dist/artifacts/verification-run.js +3 -1
- package/dist/artifacts/verification-run.js.map +1 -1
- package/dist/cli/command-intent.d.ts +10 -0
- package/dist/cli/command-intent.d.ts.map +1 -0
- package/dist/cli/command-intent.js +8 -0
- package/dist/cli/command-intent.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/run/emit.d.ts +6 -0
- package/dist/run/emit.d.ts.map +1 -1
- package/dist/run/emit.js +1 -0
- package/dist/run/emit.js.map +1 -1
- package/package.json +3 -2
- package/schema/verification-run.schema.json +154 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { VerificationCategory, ViolationSeverity } from './verification-run.js';
|
|
2
|
+
export declare const VERIFICATION_CATEGORIES: readonly VerificationCategory[];
|
|
3
|
+
export declare const VIOLATION_SEVERITIES: readonly ViolationSeverity[];
|
|
4
|
+
export type ValidationMode = 'structural' | 'ingested';
|
|
5
|
+
export interface ValidateOptions {
|
|
6
|
+
/** `ingested` ⇒ also enforce per-check `target` presence (adapter fail-closed). */
|
|
7
|
+
mode?: ValidationMode;
|
|
8
|
+
}
|
|
9
|
+
export interface ValidationResult {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
/** Dot/bracket paths + messages, e.g. `checks[0].target: required for ingested check`. */
|
|
12
|
+
errors: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validate an unknown value against the frozen VerificationRun v0 contract. Pure, dependency-free,
|
|
16
|
+
* deterministic. Returns every error rather than throwing on the first.
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateVerificationRunV0(run: unknown, opts?: ValidateOptions): ValidationResult;
|
|
19
|
+
/**
|
|
20
|
+
* Derive the scope verdict from violations+severity (DEC-S3, the frozen cross-contract predicate):
|
|
21
|
+
* any `blocking` ⇒ `violation`; else any `advisory` ⇒ `conditional`; else `clean`. NEVER derived
|
|
22
|
+
* from `result`. The harness does NOT route on this (that is the track-side adapter); it is exposed
|
|
23
|
+
* so the predicate can be asserted against the frozen contract rather than trusted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deriveVerdict(violations: ReadonlyArray<{
|
|
26
|
+
severity: ViolationSeverity;
|
|
27
|
+
}>): 'clean' | 'violation' | 'conditional';
|
|
28
|
+
//# sourceMappingURL=validate-verification-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-verification-run.d.ts","sourceRoot":"","sources":["../../src/artifacts/validate-verification-run.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EASlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAA6B,CAAC;AAI3F,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,0FAA0F;IAC1F,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AA6ED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,eAAoB,GAAG,gBAAgB,CAoCpG;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC,GACzD,OAAO,GAAG,WAAW,GAAG,aAAa,CAIvC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Dependency-free runtime validator for the VerificationRun v0 seam.
|
|
2
|
+
//
|
|
3
|
+
// Hand-rolled (NO ajv / no JSON-Schema runtime): the `make test-harness` toolset is pinned to
|
|
4
|
+
// vitest/typescript/@types/node only, so the package stays dependency-free. This validator is
|
|
5
|
+
// the runtime counterpart of `schema/verification-run.schema.json` and of the
|
|
6
|
+
// `VerificationRun` types — keep all three in lock-step.
|
|
7
|
+
//
|
|
8
|
+
// Modes:
|
|
9
|
+
// - `structural` (default): asserts the artifact shape (a check MAY omit `target`).
|
|
10
|
+
// - `ingested`: additionally enforces the adapter fail-closed rule — every check MUST carry a
|
|
11
|
+
// `target` with ≥1 of `scope`|`acceptance` (DEC-S1). A track-ingested check with no target
|
|
12
|
+
// FAILS CLOSED; this surfaces it BEFORE emit instead of letting the adapter reject it.
|
|
13
|
+
export const VERIFICATION_CATEGORIES = [
|
|
14
|
+
'none',
|
|
15
|
+
'static',
|
|
16
|
+
'unit',
|
|
17
|
+
'integration',
|
|
18
|
+
'e2e',
|
|
19
|
+
'ci',
|
|
20
|
+
'uat',
|
|
21
|
+
'security',
|
|
22
|
+
];
|
|
23
|
+
export const VIOLATION_SEVERITIES = ['advisory', 'blocking'];
|
|
24
|
+
const ACCEPTANCE_KINDS = ['unit', 'integration', 'e2e', 'manual'];
|
|
25
|
+
function isRecord(v) {
|
|
26
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
27
|
+
}
|
|
28
|
+
function isStr(v) {
|
|
29
|
+
return typeof v === 'string';
|
|
30
|
+
}
|
|
31
|
+
function validateViolation(v, path, errors) {
|
|
32
|
+
if (!isRecord(v)) {
|
|
33
|
+
errors.push(`${path}: expected object`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!isStr(v.code))
|
|
37
|
+
errors.push(`${path}.code: expected string`);
|
|
38
|
+
if (!isStr(v.message))
|
|
39
|
+
errors.push(`${path}.message: expected string`);
|
|
40
|
+
if (!VIOLATION_SEVERITIES.includes(v.severity)) {
|
|
41
|
+
errors.push(`${path}.severity: expected one of ${VIOLATION_SEVERITIES.join('|')}`);
|
|
42
|
+
}
|
|
43
|
+
if (v.path !== undefined && !isStr(v.path))
|
|
44
|
+
errors.push(`${path}.path: expected string`);
|
|
45
|
+
}
|
|
46
|
+
function validateTarget(t, path, errors) {
|
|
47
|
+
if (!isRecord(t)) {
|
|
48
|
+
errors.push(`${path}: expected object`);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (t.scope === undefined && t.acceptance === undefined) {
|
|
52
|
+
errors.push(`${path}: requires at least one of scope|acceptance`);
|
|
53
|
+
}
|
|
54
|
+
if (t.scope !== undefined) {
|
|
55
|
+
if (!isRecord(t.scope) || !isStr(t.scope.wpRef)) {
|
|
56
|
+
errors.push(`${path}.scope.wpRef: expected string`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (t.acceptance !== undefined) {
|
|
60
|
+
const a = t.acceptance;
|
|
61
|
+
if (!isRecord(a)) {
|
|
62
|
+
errors.push(`${path}.acceptance: expected object`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (!isStr(a.evidenceId))
|
|
66
|
+
errors.push(`${path}.acceptance.evidenceId: expected string`);
|
|
67
|
+
if (!ACCEPTANCE_KINDS.includes(a.kind)) {
|
|
68
|
+
errors.push(`${path}.acceptance.kind: expected one of ${ACCEPTANCE_KINDS.join('|')}`);
|
|
69
|
+
}
|
|
70
|
+
if (a.criterionIds !== undefined) {
|
|
71
|
+
if (!Array.isArray(a.criterionIds) || !a.criterionIds.every(isStr)) {
|
|
72
|
+
errors.push(`${path}.acceptance.criterionIds: expected string[]`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function validateCheck(c, path, mode, errors) {
|
|
79
|
+
if (!isRecord(c)) {
|
|
80
|
+
errors.push(`${path}: expected object`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!isStr(c.code))
|
|
84
|
+
errors.push(`${path}.code: expected string`);
|
|
85
|
+
if (!VERIFICATION_CATEGORIES.includes(c.category)) {
|
|
86
|
+
errors.push(`${path}.category: expected one of ${VERIFICATION_CATEGORIES.join('|')}`);
|
|
87
|
+
}
|
|
88
|
+
if (typeof c.pass !== 'boolean')
|
|
89
|
+
errors.push(`${path}.pass: expected boolean`);
|
|
90
|
+
if (!Array.isArray(c.violations)) {
|
|
91
|
+
errors.push(`${path}.violations: expected array`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
c.violations.forEach((v, i) => validateViolation(v, `${path}.violations[${i}]`, errors));
|
|
95
|
+
}
|
|
96
|
+
if (c.target !== undefined) {
|
|
97
|
+
validateTarget(c.target, `${path}.target`, errors);
|
|
98
|
+
}
|
|
99
|
+
else if (mode === 'ingested') {
|
|
100
|
+
// Adapter fail-closed (DEC-S1): a track-ingested check with no target is rejected.
|
|
101
|
+
errors.push(`${path}.target: required for a track-ingested check (adapter fails closed)`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Validate an unknown value against the frozen VerificationRun v0 contract. Pure, dependency-free,
|
|
106
|
+
* deterministic. Returns every error rather than throwing on the first.
|
|
107
|
+
*/
|
|
108
|
+
export function validateVerificationRunV0(run, opts = {}) {
|
|
109
|
+
const mode = opts.mode ?? 'structural';
|
|
110
|
+
const errors = [];
|
|
111
|
+
if (!isRecord(run)) {
|
|
112
|
+
return { valid: false, errors: ['$: expected object'] };
|
|
113
|
+
}
|
|
114
|
+
if (run.schemaVersion !== 1)
|
|
115
|
+
errors.push('$.schemaVersion: expected 1 (unknown version fails closed)');
|
|
116
|
+
for (const key of ['runId', 'commit', 'branch', 'env', 'runner', 'command', 'artifactLocator']) {
|
|
117
|
+
if (!isStr(run[key]))
|
|
118
|
+
errors.push(`$.${key}: expected string`);
|
|
119
|
+
}
|
|
120
|
+
if (!VERIFICATION_CATEGORIES.includes(run.category)) {
|
|
121
|
+
errors.push(`$.category: expected one of ${VERIFICATION_CATEGORIES.join('|')}`);
|
|
122
|
+
}
|
|
123
|
+
if (run.result !== 'pass' && run.result !== 'fail') {
|
|
124
|
+
errors.push('$.result: expected pass|fail');
|
|
125
|
+
}
|
|
126
|
+
if (!isStr(run.startedAt))
|
|
127
|
+
errors.push('$.startedAt: expected ISO-8601 string');
|
|
128
|
+
if (!isStr(run.finishedAt))
|
|
129
|
+
errors.push('$.finishedAt: expected ISO-8601 string');
|
|
130
|
+
if (!Array.isArray(run.checks)) {
|
|
131
|
+
errors.push('$.checks: expected array');
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
run.checks.forEach((c, i) => validateCheck(c, `$.checks[${i}]`, mode, errors));
|
|
135
|
+
}
|
|
136
|
+
if (!Array.isArray(run.violations)) {
|
|
137
|
+
errors.push('$.violations: expected array');
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
run.violations.forEach((v, i) => validateViolation(v, `$.violations[${i}]`, errors));
|
|
141
|
+
}
|
|
142
|
+
if (!Array.isArray(run.artifacts) || !run.artifacts.every(isStr)) {
|
|
143
|
+
errors.push('$.artifacts: expected string[]');
|
|
144
|
+
}
|
|
145
|
+
return { valid: errors.length === 0, errors };
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Derive the scope verdict from violations+severity (DEC-S3, the frozen cross-contract predicate):
|
|
149
|
+
* any `blocking` ⇒ `violation`; else any `advisory` ⇒ `conditional`; else `clean`. NEVER derived
|
|
150
|
+
* from `result`. The harness does NOT route on this (that is the track-side adapter); it is exposed
|
|
151
|
+
* so the predicate can be asserted against the frozen contract rather than trusted.
|
|
152
|
+
*/
|
|
153
|
+
export function deriveVerdict(violations) {
|
|
154
|
+
if (violations.some((v) => v.severity === 'blocking'))
|
|
155
|
+
return 'violation';
|
|
156
|
+
if (violations.some((v) => v.severity === 'advisory'))
|
|
157
|
+
return 'conditional';
|
|
158
|
+
return 'clean';
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=validate-verification-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-verification-run.js","sourceRoot":"","sources":["../../src/artifacts/validate-verification-run.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,8EAA8E;AAC9E,yDAAyD;AACzD,EAAE;AACF,SAAS;AACT,sFAAsF;AACtF,gGAAgG;AAChG,+FAA+F;AAC/F,2FAA2F;AAI3F,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE,MAAM;IACN,QAAQ;IACR,MAAM;IACN,aAAa;IACb,KAAK;IACL,IAAI;IACJ,KAAK;IACL,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAiC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE3F,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAe3E,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,KAAK,CAAC,CAAU;IACvB,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC/B,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAU,EAAE,IAAY,EAAE,MAAgB;IACnE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,mBAAmB,CAAC,CAAC;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AE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,UAA0D;IAE1D,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC;QAAE,OAAO,WAAW,CAAC;IAC1E,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC;QAAE,OAAO,aAAa,CAAC;IAC5E,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type VerificationCategory = 'none' | 'static' | 'unit' | 'integration' | 'e2e' | 'ci' | 'uat';
|
|
1
|
+
export type VerificationCategory = 'none' | 'static' | 'unit' | 'integration' | 'e2e' | 'ci' | 'uat' | 'security';
|
|
2
2
|
export type ViolationSeverity = 'advisory' | 'blocking';
|
|
3
3
|
/** A single policy violation found by a check. */
|
|
4
4
|
export interface Violation {
|
|
@@ -19,12 +19,46 @@ export interface CheckResult {
|
|
|
19
19
|
reason: string;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Structured evidence target for a single check (DEC-S1, the freeze keystone).
|
|
24
|
+
*
|
|
25
|
+
* Carried PER-CHECK (not per-run) because one `harness verify` aggregates N checks that can
|
|
26
|
+
* span multiple WPs / acceptance criteria. A track-side adapter routes from the target, never
|
|
27
|
+
* from `category`/`branch`/`commit`/path globs (DEC-S4). ≥1 of `scope`|`acceptance` is required
|
|
28
|
+
* for any TRACK-INGESTED check; a check with no target FAILS CLOSED at the adapter (never
|
|
29
|
+
* auto-itemized, never glob-routed). The harness does NOT enforce that here — `target` is
|
|
30
|
+
* optional on the type so non-ingested / producer-local checks remain representable.
|
|
31
|
+
*/
|
|
32
|
+
export interface VerificationTarget {
|
|
33
|
+
/** present ⇒ adapter emits `scope.verification` (verdict derived from violations+severity). */
|
|
34
|
+
scope?: {
|
|
35
|
+
/** exact `scope.declare` itemId / stable scope key (no inference). */
|
|
36
|
+
wpRef: string;
|
|
37
|
+
};
|
|
38
|
+
/** present ⇒ adapter emits `acceptance.run` (+ one `acceptance.link` per criterionId). */
|
|
39
|
+
acceptance?: {
|
|
40
|
+
/**
|
|
41
|
+
* Caller-supplied DETERMINISTIC evidence key (DEC §7 M2=B): the harness supplies this key
|
|
42
|
+
* on `acceptance.link` and `acceptance.run` references it — single-phase, replayable,
|
|
43
|
+
* retry-safe. It is NOT a server-minted id.
|
|
44
|
+
*/
|
|
45
|
+
evidenceId: string;
|
|
46
|
+
kind: 'unit' | 'integration' | 'e2e' | 'manual';
|
|
47
|
+
criterionIds?: string[];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
22
50
|
/** One check's contribution inside a VerificationRun. */
|
|
23
51
|
export interface VerificationCheck {
|
|
24
52
|
code: string;
|
|
25
53
|
category: VerificationCategory;
|
|
26
54
|
pass: boolean;
|
|
27
55
|
violations: Violation[];
|
|
56
|
+
/**
|
|
57
|
+
* Structured evidence target (DEC-S1). ≥1 of `scope`|`acceptance` is required for a
|
|
58
|
+
* track-ingested check; absent ⇒ the track-side adapter FAILS CLOSED (never auto-itemized,
|
|
59
|
+
* never glob-routed). Optional on the type so producer-local checks stay representable.
|
|
60
|
+
*/
|
|
61
|
+
target?: VerificationTarget;
|
|
28
62
|
}
|
|
29
63
|
export interface VerificationRun {
|
|
30
64
|
schemaVersion: 1;
|
|
@@ -42,7 +76,14 @@ export interface VerificationRun {
|
|
|
42
76
|
checks: VerificationCheck[];
|
|
43
77
|
/** Flattened union of all check violations (convenience for ingesters). */
|
|
44
78
|
violations: Violation[];
|
|
45
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Immutable locator for the full VerificationRun JSON — the CANONICAL evidence (DEC-S2).
|
|
81
|
+
* `scope.verification.violations: string[]` is only a display/index projection of this run.
|
|
82
|
+
* Immutability is a PRODUCER guarantee (the track adapter RECORDS the locator, never verifies
|
|
83
|
+
* it — OQ-3); not validated here. REQUIRED.
|
|
84
|
+
*/
|
|
85
|
+
artifactLocator: string;
|
|
86
|
+
/** Opaque references to OTHER produced artifacts (paths/urls). */
|
|
46
87
|
artifacts: string[];
|
|
47
88
|
}
|
|
48
89
|
//# sourceMappingURL=verification-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-run.d.ts","sourceRoot":"","sources":["../../src/artifacts/verification-run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification-run.d.ts","sourceRoot":"","sources":["../../src/artifacts/verification-run.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,QAAQ,GACR,MAAM,GACN,aAAa,GACb,KAAK,GACL,IAAI,GACJ,KAAK,GACL,UAAU,CAAC;AAEf,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,C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OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,2EAA2E;IAC3E,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// superset of track's `TestRun{ commit, env, runner, result, at }` so the seam holds.
|
|
6
6
|
//
|
|
7
7
|
// `category` is the BR25 **D3** verification taxonomy (APPROVED 2026-06-04), bound to this
|
|
8
|
-
// field.
|
|
8
|
+
// field. `security` is reserved NOW as a frozen v0 slot (DEC §2 / §6): adding an enum value
|
|
9
|
+
// after the freeze would be a major bump, so the slot is locked even though the security
|
|
10
|
+
// verify-hook is not wired yet. In v0 `security` stays schema-artifact-only / OFF-WIRE (OQ-7).
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=verification-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-run.js","sourceRoot":"","sources":["../../src/artifacts/verification-run.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,sFAAsF;AACtF,EAAE;AACF,2FAA2F;AAC3F,
|
|
1
|
+
{"version":3,"file":"verification-run.js","sourceRoot":"","sources":["../../src/artifacts/verification-run.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,sFAAsF;AACtF,EAAE;AACF,2FAA2F;AAC3F,4FAA4F;AAC5F,yFAAyF;AACzF,+FAA+F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const harnessCliCommandIntentAdapter: Readonly<{
|
|
2
|
+
runnerId: "harness";
|
|
3
|
+
source: "@sentropic/harness";
|
|
4
|
+
parseIntent(argv: readonly string[]): {
|
|
5
|
+
runnerId: "harness";
|
|
6
|
+
source: "@sentropic/harness";
|
|
7
|
+
argv: string[];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=command-intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-intent.d.ts","sourceRoot":"","sources":["../../src/cli/command-intent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B;;;sBAGvB,SAAS,MAAM,EAAE;;;;;EAGnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const harnessCliCommandIntentAdapter = Object.freeze({
|
|
2
|
+
runnerId: 'harness',
|
|
3
|
+
source: '@sentropic/harness',
|
|
4
|
+
parseIntent(argv) {
|
|
5
|
+
return { runnerId: this.runnerId, source: this.source, argv: [...argv] };
|
|
6
|
+
},
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=command-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-intent.js","sourceRoot":"","sources":["../../src/cli/command-intent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1D,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,oBAAoB;IAC5B,WAAW,CAAC,IAAuB;QACjC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const HARNESS_PACKAGE: "@sentropic/harness";
|
|
2
|
-
export type { VerificationRun, VerificationCheck, VerificationCategory, Violation, ViolationSeverity, CheckResult, } from './artifacts/verification-run.js';
|
|
2
|
+
export type { VerificationRun, VerificationCheck, VerificationTarget, VerificationCategory, Violation, ViolationSeverity, CheckResult, } from './artifacts/verification-run.js';
|
|
3
|
+
export { validateVerificationRunV0, deriveVerdict, VERIFICATION_CATEGORIES, VIOLATION_SEVERITIES, } from './artifacts/validate-verification-run.js';
|
|
4
|
+
export type { ValidationMode, ValidateOptions, ValidationResult, } from './artifacts/validate-verification-run.js';
|
|
3
5
|
export type { WorkEvent, WorkEventVerb, WorkEventStatus, WorkEventValue, } from './artifacts/work-event.js';
|
|
4
6
|
export { toWorkEvent } from './run/work-event.js';
|
|
5
7
|
export type { WorkEventInput, WorkEventContext } from './run/work-event.js';
|
|
@@ -19,4 +21,5 @@ export type { NamedCheck, VerificationContext } from './run/emit.js';
|
|
|
19
21
|
export { HARNESS_SKILLS, HOST_SKILL_DIR, isHostId } from './skills/manifest.js';
|
|
20
22
|
export type { SkillEntry, HostId } from './skills/manifest.js';
|
|
21
23
|
export { runHarnessCli } from './cli/run.js';
|
|
24
|
+
export { harnessCliCommandIntentAdapter } from './cli/command-intent.js';
|
|
22
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,sBAAgC,CAAC;AAG7D,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,YA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C,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// Tooling-only: no product-runtime imports (no Drizzle/Hono/Svelte/Mistral), no
|
|
4
4
|
// `@sentropic/*` deps, and NO track import — harness only EMITS neutral artifacts.
|
|
5
5
|
export const HARNESS_PACKAGE = '@sentropic/harness';
|
|
6
|
+
// Dependency-free runtime validator + frozen verdict-derivation predicate for the v0 seam.
|
|
7
|
+
export { validateVerificationRunV0, deriveVerdict, VERIFICATION_CATEGORIES, VIOLATION_SEVERITIES, } from './artifacts/validate-verification-run.js';
|
|
6
8
|
export { toWorkEvent } from './run/work-event.js';
|
|
7
9
|
export { sentropicProfile } from './profile/sentropic.js';
|
|
8
10
|
export { stubProfile } from './profile/stub.js';
|
|
@@ -18,4 +20,5 @@ export { toVerificationRun } from './run/emit.js';
|
|
|
18
20
|
export { HARNESS_SKILLS, HOST_SKILL_DIR, isHostId } from './skills/manifest.js';
|
|
19
21
|
// Pure, arg-based CLI driver (the `harness` bin is a thin wrapper over this).
|
|
20
22
|
export { runHarnessCli } from './cli/run.js';
|
|
23
|
+
export { harnessCliCommandIntentAdapter } from './cli/command-intent.js';
|
|
21
24
|
//# 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,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AAEnF,MAAM,CAAC,MAAM,eAAe,GAAG,oBAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AAEnF,MAAM,CAAC,MAAM,eAAe,GAAG,oBAA6B,CAAC;AAa7D,2FAA2F;AAC3F,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,0CAA0C,CAAC;AAclD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,wBAAwB;AACxB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlF,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,6EAA6E;AAC7E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhF,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/run/emit.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export interface VerificationContext {
|
|
|
15
15
|
startedAt: string;
|
|
16
16
|
finishedAt: string;
|
|
17
17
|
artifacts?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Immutable locator for the full run JSON (DEC-S2). Producer-supplied; when omitted a
|
|
20
|
+
* deterministic `verification-run:{runId}` placeholder is used so the field stays REQUIRED
|
|
21
|
+
* on the artifact. Immutability is a producer guarantee, not enforced here.
|
|
22
|
+
*/
|
|
23
|
+
artifactLocator?: string;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* Assemble a NEUTRAL `VerificationRun` from check results. harness EMITS this artifact and
|
package/dist/run/emit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/run/emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAEf,oBAAoB,EAErB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/run/emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAEf,oBAAoB,EAErB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,mBAAmB,GAAG,eAAe,CA0BjG"}
|
package/dist/run/emit.js
CHANGED
package/dist/run/emit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/run/emit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/run/emit.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoB,EAAE,GAAwB;IAC9E,MAAM,kBAAkB,GAAwB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;QACnB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU;KAChC,CAAC,CAAC,CAAC;IACJ,MAAM,UAAU,GAAgB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC9B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,MAAM,EAAE,kBAAkB;QAC1B,UAAU;QACV,eAAe,EAAE,GAAG,CAAC,eAAe,IAAI,oBAAoB,GAAG,CAAC,KAAK,EAAE;QACvE,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE;KAC/B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentropic/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Neutral, host-agnostic code-work / PR-workflow tooling for AI dev: a homogeneous `harness <verb>` method layer (branch/scope/verify/test/debug/review/brainstorm/plan), the native superpowers replacement. Tooling-only, zero product-runtime deps. (BR-42h)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
+
"schema",
|
|
25
26
|
"skills",
|
|
26
27
|
"README.md",
|
|
27
28
|
"LICENSE"
|
|
@@ -34,6 +35,6 @@
|
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@types/node": "^20.12.0",
|
|
36
37
|
"typescript": "5.4.5",
|
|
37
|
-
"vitest": "4.0
|
|
38
|
+
"vitest": "4.1.0"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/rhanka/sentropic/packages/harness/schema/verification-run.schema.json",
|
|
4
|
+
"title": "VerificationRun (harness↔track seam v0)",
|
|
5
|
+
"description": "Neutral verification artifact emitted by @sentropic/harness checks and ingested by a track-side adapter. Frozen v0 per spec/SPEC_DECISION_SEAM_HARNESS_TRACK_V0.md. harness EMITS this artifact and never imports @sentropic/track; the adapter is 100% track-side. Versioning: unknown major/schemaVersion ⇒ fail-closed reject; minor ⇒ additive OPTIONAL fields only; consumers ignore unknown optional fields but MUST NOT route an unknown target-kind / enum value silently.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"$comment": "VERDICT-DERIVATION INVARIANT (DEC-S3, frozen cross-contract): the track-side adapter DERIVES the scope verdict from violations+severity, NEVER from `result`. Predicate: any violation with severity='blocking' ⇒ verdict='violation'; else any violation with severity='advisory' ⇒ verdict='conditional'; else verdict='clean'. The harness does NOT derive the verdict; this predicate is frozen here so it holds cross-contract, not on trust. `acceptance.run.result` uses VerificationRun.result / the check pass flag directly (binary pass|fail).",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"required": [
|
|
10
|
+
"schemaVersion",
|
|
11
|
+
"runId",
|
|
12
|
+
"commit",
|
|
13
|
+
"branch",
|
|
14
|
+
"env",
|
|
15
|
+
"runner",
|
|
16
|
+
"category",
|
|
17
|
+
"command",
|
|
18
|
+
"result",
|
|
19
|
+
"startedAt",
|
|
20
|
+
"finishedAt",
|
|
21
|
+
"checks",
|
|
22
|
+
"violations",
|
|
23
|
+
"artifactLocator",
|
|
24
|
+
"artifacts"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schemaVersion": {
|
|
28
|
+
"const": 1,
|
|
29
|
+
"description": "v0 freeze. Unknown schemaVersion ⇒ fail-closed reject."
|
|
30
|
+
},
|
|
31
|
+
"runId": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Stable id per invocation. The track adapter MINTS a globally-unique runId PER EMITTED VERDICT (a per-check/per-target projection id ≠ this physical run id — DEC §7 M1). This physical id lives in the artifact behind artifactLocator."
|
|
34
|
+
},
|
|
35
|
+
"commit": { "type": "string" },
|
|
36
|
+
"branch": { "type": "string" },
|
|
37
|
+
"env": { "type": "string" },
|
|
38
|
+
"runner": { "type": "string" },
|
|
39
|
+
"category": { "$ref": "#/definitions/VerificationCategory" },
|
|
40
|
+
"command": { "type": "string" },
|
|
41
|
+
"result": {
|
|
42
|
+
"enum": ["pass", "fail"],
|
|
43
|
+
"description": "Run-level binary outcome. NEVER the source of the scope verdict (see the verdict-derivation invariant)."
|
|
44
|
+
},
|
|
45
|
+
"startedAt": { "type": "string", "format": "date-time" },
|
|
46
|
+
"finishedAt": { "type": "string", "format": "date-time" },
|
|
47
|
+
"checks": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "$ref": "#/definitions/VerificationCheck" }
|
|
50
|
+
},
|
|
51
|
+
"violations": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"description": "Flattened union of all check violations (convenience for ingesters).",
|
|
54
|
+
"items": { "$ref": "#/definitions/Violation" }
|
|
55
|
+
},
|
|
56
|
+
"artifactLocator": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Immutable locator for the full VerificationRun JSON — the CANONICAL evidence (DEC-S2). Immutability is a PRODUCER guarantee the adapter RECORDS, never verifies (OQ-3). REQUIRED."
|
|
59
|
+
},
|
|
60
|
+
"artifacts": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"description": "Opaque references to OTHER produced artifacts (paths/urls).",
|
|
63
|
+
"items": { "type": "string" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"definitions": {
|
|
67
|
+
"VerificationCategory": {
|
|
68
|
+
"enum": [
|
|
69
|
+
"none",
|
|
70
|
+
"static",
|
|
71
|
+
"unit",
|
|
72
|
+
"integration",
|
|
73
|
+
"e2e",
|
|
74
|
+
"ci",
|
|
75
|
+
"uat",
|
|
76
|
+
"security"
|
|
77
|
+
],
|
|
78
|
+
"description": "BR25 D3 verification taxonomy. `security` is a frozen v0 slot reserved NOW (adding an enum value post-freeze would be a major bump); it stays schema-artifact-only / OFF-WIRE in v0 (OQ-7). An unknown category MUST NOT route silently."
|
|
79
|
+
},
|
|
80
|
+
"ViolationSeverity": {
|
|
81
|
+
"enum": ["advisory", "blocking"],
|
|
82
|
+
"description": "FROZEN v0 enum (DEC §7 SHOULD-FIX). Feeds the verdict-derivation invariant; the freeze pins the predicate cross-contract."
|
|
83
|
+
},
|
|
84
|
+
"Violation": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": ["code", "message", "severity"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"code": { "type": "string" },
|
|
90
|
+
"path": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Offending path, when the violation is path-scoped (e.g. C2)."
|
|
93
|
+
},
|
|
94
|
+
"message": { "type": "string" },
|
|
95
|
+
"severity": { "$ref": "#/definitions/ViolationSeverity" }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"VerificationTarget": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"description": "Structured evidence target (DEC-S1, freeze keystone). Carried per-check. The adapter routes from the target, never from category/branch/commit/path globs (DEC-S4). At least one of `scope`|`acceptance` should be present for a track-ingested check; a check with no target FAILS CLOSED at the adapter.",
|
|
102
|
+
"minProperties": 1,
|
|
103
|
+
"properties": {
|
|
104
|
+
"scope": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": ["wpRef"],
|
|
108
|
+
"description": "present ⇒ adapter emits scope.verification (verdict derived from violations+severity).",
|
|
109
|
+
"properties": {
|
|
110
|
+
"wpRef": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "Exact scope.declare itemId / stable scope key (no inference)."
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"acceptance": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": ["evidenceId", "kind"],
|
|
120
|
+
"description": "present ⇒ adapter emits acceptance.run (+ one acceptance.link per criterionId).",
|
|
121
|
+
"properties": {
|
|
122
|
+
"evidenceId": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"description": "Caller-supplied DETERMINISTIC evidence key (DEC §7 M2=B) — NOT a server-minted id."
|
|
125
|
+
},
|
|
126
|
+
"kind": { "enum": ["unit", "integration", "e2e", "manual"] },
|
|
127
|
+
"criterionIds": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": { "type": "string" }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"VerificationCheck": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"additionalProperties": false,
|
|
138
|
+
"required": ["code", "category", "pass", "violations"],
|
|
139
|
+
"properties": {
|
|
140
|
+
"code": { "type": "string" },
|
|
141
|
+
"category": { "$ref": "#/definitions/VerificationCategory" },
|
|
142
|
+
"pass": { "type": "boolean" },
|
|
143
|
+
"violations": {
|
|
144
|
+
"type": "array",
|
|
145
|
+
"items": { "$ref": "#/definitions/Violation" }
|
|
146
|
+
},
|
|
147
|
+
"target": {
|
|
148
|
+
"$ref": "#/definitions/VerificationTarget",
|
|
149
|
+
"description": "≥1 of scope|acceptance required for a track-ingested check; absent ⇒ adapter fail-closed (never auto-itemized, never glob-routed). Optional so producer-local checks stay representable."
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|