@agent-ix/quoin 0.17.0 → 0.19.2
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/default-modules.yaml +15 -6
- package/dist/advisor/advise.d.ts +14 -1
- package/dist/advisor/advise.d.ts.map +1 -1
- package/dist/{advisor-Dhy9S7PS.js → advisor-a9axb4Jl.js} +1 -1
- package/dist/assurance/graph.d.ts +79 -0
- package/dist/assurance/graph.d.ts.map +1 -0
- package/dist/assurance/index.d.ts +9 -0
- package/dist/assurance/index.d.ts.map +1 -0
- package/dist/assurance/render.d.ts +3 -0
- package/dist/assurance/render.d.ts.map +1 -0
- package/dist/auditor/audit.d.ts +23 -2
- package/dist/auditor/audit.d.ts.map +1 -1
- package/dist/auditor/combinatorial.d.ts +53 -0
- package/dist/auditor/combinatorial.d.ts.map +1 -0
- package/dist/auditor-W2jFinr6.js +188 -0
- package/dist/{base-D_-Jy4cE.js → base-BE20w0jY.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/combinatorial-Cq01XfhV.js +80 -0
- package/dist/commands/advise.js +35 -32
- package/dist/commands/assurance.d.ts +14 -0
- package/dist/commands/assurance.d.ts.map +1 -0
- package/dist/commands/assurance.js +179 -0
- package/dist/commands/catalog/list.js +2 -2
- package/dist/commands/catalog/methods.js +3 -3
- package/dist/commands/catalog/show.js +2 -2
- package/dist/commands/catalog/validate.js +2 -2
- package/dist/commands/completeness.d.ts +16 -0
- package/dist/commands/completeness.d.ts.map +1 -0
- package/dist/commands/completeness.js +49 -0
- package/dist/commands/config/doctor.js +1 -1
- package/dist/commands/config/edit.js +1 -1
- package/dist/commands/config/get.js +1 -1
- package/dist/commands/config/set.js +1 -1
- package/dist/commands/evidence/affirm.js +3 -3
- package/dist/commands/evidence/audit.d.ts +10 -0
- package/dist/commands/evidence/audit.d.ts.map +1 -1
- package/dist/commands/evidence/audit.js +54 -36
- package/dist/commands/evidence/baseline.js +12 -12
- package/dist/commands/evidence/gc.js +2 -2
- package/dist/commands/evidence/index.js +1 -1
- package/dist/commands/evidence/record.d.ts +2 -0
- package/dist/commands/evidence/record.d.ts.map +1 -1
- package/dist/commands/evidence/record.js +89 -32
- package/dist/commands/matrix.js +1 -1
- package/dist/commands/module/ensure-defaults.js +3 -3
- package/dist/commands/module/install.js +2 -2
- package/dist/commands/module/list.js +2 -2
- package/dist/commands/module/remove.js +2 -2
- package/dist/commands/review.js +1 -1
- package/dist/commands/to-plan.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/write.js +3 -3
- package/dist/completeness/assess.d.ts +82 -0
- package/dist/completeness/assess.d.ts.map +1 -0
- package/dist/completeness/bundle.d.ts +52 -0
- package/dist/completeness/bundle.d.ts.map +1 -0
- package/dist/completeness/declarations.d.ts +46 -0
- package/dist/completeness/declarations.d.ts.map +1 -0
- package/dist/completeness/index.d.ts +11 -0
- package/dist/completeness/index.d.ts.map +1 -0
- package/dist/completeness/run.d.ts +35 -0
- package/dist/completeness/run.d.ts.map +1 -0
- package/dist/completeness-BeqcskAI.js +228 -0
- package/dist/evidence/adapters/agent-eval.d.ts +26 -0
- package/dist/evidence/adapters/agent-eval.d.ts.map +1 -0
- package/dist/evidence/adapters/audit-script.d.ts +25 -0
- package/dist/evidence/adapters/audit-script.d.ts.map +1 -0
- package/dist/evidence/adapters/cargo-mutants.d.ts +3 -0
- package/dist/evidence/adapters/cargo-mutants.d.ts.map +1 -0
- package/dist/evidence/adapters/junit.d.ts +17 -0
- package/dist/evidence/adapters/junit.d.ts.map +1 -0
- package/dist/evidence/adapters/registry.d.ts +63 -0
- package/dist/evidence/adapters/registry.d.ts.map +1 -0
- package/dist/evidence/adapters/sarif.d.ts +35 -0
- package/dist/evidence/adapters/sarif.d.ts.map +1 -0
- package/dist/evidence/adapters/sbom.d.ts +35 -0
- package/dist/evidence/adapters/sbom.d.ts.map +1 -0
- package/dist/evidence/adapters/types.d.ts +55 -0
- package/dist/evidence/adapters/types.d.ts.map +1 -0
- package/dist/evidence/index.d.ts +10 -0
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/store.d.ts +48 -2
- package/dist/evidence/store.d.ts.map +1 -1
- package/dist/evidence/types.d.ts +84 -0
- package/dist/evidence/types.d.ts.map +1 -1
- package/dist/evidence-FRF9RN77.js +595 -0
- package/dist/{flow-command-B-ZBn9Sd.js → flow-command-BrzzKBo9.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/{modules-DSkUXhHn.js → modules-_FQTZ3gx.js} +2 -2
- package/dist/{plugins-DiS0OXoo.js → plugins-Q1MtCIE5.js} +1 -1
- package/dist/quire/contract.d.ts +1 -1
- package/dist/quire/contract.d.ts.map +1 -1
- package/dist/{quire-D7ra5rUF.js → quire-Dis3ky5t.js} +1 -1
- package/dist/{version-DmZHxX4n.js → version-D0l3nDPZ.js} +1 -1
- package/dist/{write-CPdSNIkF.js → write-CMA6BDUq.js} +1 -1
- package/package.json +2 -1
- package/skills/spec-fuzz/SKILL.md +94 -0
- package/skills/spec-fuzz/assets/templates/atheris.py.md +74 -0
- package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +83 -0
- package/skills/spec-fuzz/assets/templates/fast-check.ts.md +76 -0
- package/skills/spec-fuzz/references/step-0-scope-and-harness.md +51 -0
- package/skills/spec-fuzz/references/step-1-select-obligations.md +47 -0
- package/skills/spec-fuzz/references/step-2-ground-entry-point.md +55 -0
- package/skills/spec-fuzz/references/step-3-emit-targets.md +65 -0
- package/skills/spec-fuzz/references/step-4-report.md +56 -0
- package/dist/audit-CudnEJmh.js +0 -127
- package/dist/evidence-QUw0KyMH.js +0 -209
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared vocabulary coverage, read from module data (FR-037).
|
|
3
|
+
*
|
|
4
|
+
* quire-rs FR-059 computes which declared values no document claims. This reads
|
|
5
|
+
* the *same declaration* the engine reads, so quoin can say what a finding means
|
|
6
|
+
* — which vocabulary, how many values it has, and where a justified absence may
|
|
7
|
+
* be recorded — without minting a second list.
|
|
8
|
+
*
|
|
9
|
+
* Minting one is the failure this whole area exists to avoid: the 25010
|
|
10
|
+
* characteristic set is **12 values in module data**, and the original ticket
|
|
11
|
+
* proposed walking a hardcoded 9.
|
|
12
|
+
*/
|
|
13
|
+
/** One `traceability.vocabulary_coverage` entry, with its values resolved. */
|
|
14
|
+
export interface VocabularyDeclaration {
|
|
15
|
+
/** The declaration's own name, e.g. `quality-characteristics`. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Artifact type the projection reads, e.g. `NFR`. */
|
|
18
|
+
from: string;
|
|
19
|
+
/** Frontmatter field carrying the claim, e.g. `quality_attribute`. */
|
|
20
|
+
field: string;
|
|
21
|
+
/** Corpus-check token the engine reports under. */
|
|
22
|
+
check: string;
|
|
23
|
+
/** Frontmatter field recording a deliberate non-applicability, if declared. */
|
|
24
|
+
justifiedAbsenceField?: string;
|
|
25
|
+
/** The declared vocabulary, read from the artifact type's frontmatter schema. */
|
|
26
|
+
values: string[];
|
|
27
|
+
/** Module that declared it, for collision reporting. */
|
|
28
|
+
moduleName: string;
|
|
29
|
+
}
|
|
30
|
+
export interface VocabularyDeclarations {
|
|
31
|
+
declarations: VocabularyDeclaration[];
|
|
32
|
+
/** Declarations whose vocabulary could not be resolved, and why. */
|
|
33
|
+
unresolved: Array<{
|
|
34
|
+
name: string;
|
|
35
|
+
reason: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Load every module's declared vocabulary coverage.
|
|
40
|
+
*
|
|
41
|
+
* A module declaring none contributes none. A declaration whose values cannot be
|
|
42
|
+
* resolved is **reported, not dropped** — it is the case where the engine emits
|
|
43
|
+
* findings quoin cannot explain, and silence there is worse than an empty list.
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadVocabularyCoverage(moduleRoots?: string[]): VocabularyDeclarations;
|
|
46
|
+
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/completeness/declarations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iFAAiF;IACjF,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,oEAAoE;IACpE,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,WAAuB,GACjC,sBAAsB,CAoDxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared-vocabulary completeness and its verdict policy (FR-037).
|
|
3
|
+
*
|
|
4
|
+
* The split ADR-0011 names: quire-rs computes coverage over the spec corpus,
|
|
5
|
+
* quoin decides what a gap is worth and whether an excuse was earned.
|
|
6
|
+
*/
|
|
7
|
+
export { assessVocabulary, verdictFor, writtenReasonFor, type CompletenessFinding, type CompletenessReport, type DocumentClaims, type FindingKind, type Severity, type Verdict, type VocabularyRollup, } from './assess.js';
|
|
8
|
+
export { loadVocabularyCoverage, type VocabularyDeclaration, type VocabularyDeclarations, } from './declarations.js';
|
|
9
|
+
export { claimsFor, readBundleClaims, readBundleFrontmatter, type BundleDocument, type BundleRead, type FrontmatterRead, } from './bundle.js';
|
|
10
|
+
export { assessBundle, type AssessOptions, type BundleAssessment, } from './run.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/completeness/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CompletenessReport } from './assess.js';
|
|
2
|
+
export interface AssessOptions {
|
|
3
|
+
/** Bundle root — the directory whose documents are read. */
|
|
4
|
+
bundleRoot: string;
|
|
5
|
+
/** Promote an admitted gap to a failing verdict. */
|
|
6
|
+
strict?: boolean;
|
|
7
|
+
/** Module roots to read declarations from; defaults to the installed set. */
|
|
8
|
+
moduleRoots?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface BundleAssessment extends CompletenessReport {
|
|
11
|
+
bundleRoot: string;
|
|
12
|
+
/** Declarations found, so a report of zero findings can be told from zero checks. */
|
|
13
|
+
vocabularies: string[];
|
|
14
|
+
/** Declarations whose vocabulary could not be resolved. */
|
|
15
|
+
unresolved: Array<{
|
|
16
|
+
name: string;
|
|
17
|
+
reason: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** Documents whose frontmatter could not be parsed. */
|
|
20
|
+
unreadable: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Assess a bundle and return the report the command prints.
|
|
27
|
+
*
|
|
28
|
+
* **Zero declarations is reported, not passed.** A repository whose module set
|
|
29
|
+
* declares no vocabulary coverage has not been checked, and printing `PASS`
|
|
30
|
+
* over it would be the "green matrix over dead links" result this program was
|
|
31
|
+
* created to stop. `vocabularies: []` makes the difference visible in both the
|
|
32
|
+
* human and JSON output.
|
|
33
|
+
*/
|
|
34
|
+
export declare function assessBundle(options: AssessOptions): BundleAssessment;
|
|
35
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/completeness/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,uDAAuD;IACvD,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,gBAAgB,CA8CrE"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { n as e, s as t } from "./base-BE20w0jY.js";
|
|
2
|
+
import { readFileSync as n, readdirSync as r } from "node:fs";
|
|
3
|
+
import { join as i, relative as a, sep as o } from "node:path";
|
|
4
|
+
import { parse as s } from "yaml";
|
|
5
|
+
//#region src/completeness/assess.ts
|
|
6
|
+
var c = /* @__PURE__ */ new Set([
|
|
7
|
+
"-",
|
|
8
|
+
"—",
|
|
9
|
+
"n/a",
|
|
10
|
+
"na",
|
|
11
|
+
"none",
|
|
12
|
+
"tbd",
|
|
13
|
+
"todo",
|
|
14
|
+
"?",
|
|
15
|
+
""
|
|
16
|
+
]), l = 3;
|
|
17
|
+
function u(e, t) {
|
|
18
|
+
let n = new Set(e.values), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = [];
|
|
19
|
+
for (let o of t) {
|
|
20
|
+
for (let e of o.claims) n.has(e) && r.add(e);
|
|
21
|
+
for (let t of o.excuses) {
|
|
22
|
+
if (!n.has(t)) {
|
|
23
|
+
a.push({
|
|
24
|
+
vocabulary: e.name,
|
|
25
|
+
value: t,
|
|
26
|
+
kind: "undeclared-exclusion",
|
|
27
|
+
severity: "high",
|
|
28
|
+
document: o.path,
|
|
29
|
+
message: `'${t}' is excused under '${e.justifiedAbsenceField}' but is not one of the ${n.size} values '${e.name}' declares, so it excuses nothing`
|
|
30
|
+
});
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
i.add(t), d(t, o.body) === null && a.push({
|
|
34
|
+
vocabulary: e.name,
|
|
35
|
+
value: t,
|
|
36
|
+
kind: "unjustified-exclusion",
|
|
37
|
+
severity: "high",
|
|
38
|
+
document: o.path,
|
|
39
|
+
message: `'${t}' is excused under '${e.justifiedAbsenceField}' with no written reason; state why it does not apply in a table row naming '${t}'`
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (let t of e.values) r.has(t) || i.has(t) || a.push({
|
|
44
|
+
vocabulary: e.name,
|
|
45
|
+
value: t,
|
|
46
|
+
kind: "unowned",
|
|
47
|
+
severity: "medium",
|
|
48
|
+
message: `no document claims '${t}' for '${e.field}', and nothing records it under '${e.justifiedAbsenceField ?? "a justified-absence field"}'`
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
rollup: {
|
|
52
|
+
vocabulary: e.name,
|
|
53
|
+
declared: n.size,
|
|
54
|
+
owned: r.size,
|
|
55
|
+
excused: i.size,
|
|
56
|
+
unowned: e.values.filter((e) => !r.has(e) && !i.has(e)).length
|
|
57
|
+
},
|
|
58
|
+
findings: a
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function d(e, t) {
|
|
62
|
+
for (let n of t.split("\n")) {
|
|
63
|
+
let t = n.trim();
|
|
64
|
+
if (!t.startsWith("|")) continue;
|
|
65
|
+
let r = t.split("|").slice(1, -1).map((e) => e.trim().replace(/^`|`$/g, "").trim());
|
|
66
|
+
if (!(r.length < 2) && r[0].toLowerCase() === e.toLowerCase()) {
|
|
67
|
+
for (let e of r.slice(1)) if (f(e)) return e;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function f(e) {
|
|
73
|
+
let t = e.toLowerCase().replace(/[.\s]+$/, "");
|
|
74
|
+
return !c.has(t) && e.split(/\s+/).filter(Boolean).length >= l;
|
|
75
|
+
}
|
|
76
|
+
function p(e, t, n = 1) {
|
|
77
|
+
return n === 0 ? "UNCHECKED" : e.some((e) => e.severity === "high") ? "FAIL" : e.length === 0 ? "PASS" : t ? "FAIL" : "CONDITIONAL";
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/completeness/declarations.ts
|
|
81
|
+
function m(r = e()) {
|
|
82
|
+
let a = [], o = [], c = /* @__PURE__ */ new Set();
|
|
83
|
+
for (let e of r) {
|
|
84
|
+
let r = t(e);
|
|
85
|
+
if (!r || c.has(r)) continue;
|
|
86
|
+
c.add(r);
|
|
87
|
+
let l;
|
|
88
|
+
try {
|
|
89
|
+
l = s(n(i(r, "manifest.yaml"), "utf8"));
|
|
90
|
+
} catch {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!l || typeof l != "object") continue;
|
|
94
|
+
let u = String(l.name ?? r), d = l.traceability?.vocabulary_coverage;
|
|
95
|
+
if (Array.isArray(d)) for (let e of d) {
|
|
96
|
+
let t = String(e.name ?? ""), n = String(e.from ?? ""), i = String(e.field ?? ""), s = h(l, r, n, i);
|
|
97
|
+
if (typeof s == "string") {
|
|
98
|
+
o.push({
|
|
99
|
+
name: t,
|
|
100
|
+
reason: s
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
a.push({
|
|
105
|
+
name: t,
|
|
106
|
+
from: n,
|
|
107
|
+
field: i,
|
|
108
|
+
check: String(e.check ?? ""),
|
|
109
|
+
justifiedAbsenceField: typeof e.justified_absence_field == "string" ? e.justified_absence_field : void 0,
|
|
110
|
+
values: s,
|
|
111
|
+
moduleName: u
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
declarations: a,
|
|
117
|
+
unresolved: o
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function h(e, t, r, a) {
|
|
121
|
+
let o = e.artifact_types;
|
|
122
|
+
if (!Array.isArray(o)) return "module declares no artifact_types";
|
|
123
|
+
let s = o.find((e) => String(e.name ?? "") === r);
|
|
124
|
+
if (!s) return `no artifact type '${r}' in this module`;
|
|
125
|
+
let c = s.frontmatter_schema_ref;
|
|
126
|
+
if (typeof c != "string") return `artifact type '${r}' declares no frontmatter schema`;
|
|
127
|
+
let l;
|
|
128
|
+
try {
|
|
129
|
+
l = JSON.parse(n(i(t, c), "utf8"));
|
|
130
|
+
} catch (e) {
|
|
131
|
+
return `frontmatter schema '${c}' unreadable: ${e instanceof Error ? e.message : String(e)}`;
|
|
132
|
+
}
|
|
133
|
+
let u = l.properties?.[a];
|
|
134
|
+
if (!u) return `schema '${c}' declares no property '${a}'`;
|
|
135
|
+
let d = u.enum;
|
|
136
|
+
return Array.isArray(d) ? d.map(String) : `property '${a}' declares no enum, so its vocabulary is open`;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/completeness/bundle.ts
|
|
140
|
+
var g = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
141
|
+
function _(e, t) {
|
|
142
|
+
let n = [];
|
|
143
|
+
for (let r of e) {
|
|
144
|
+
let { path: e, frontmatter: i } = r, a = b(i[t.field]), o = t.justifiedAbsenceField ? b(i[t.justifiedAbsenceField]) : [];
|
|
145
|
+
(a.length !== 0 || o.length !== 0) && n.push({
|
|
146
|
+
path: e,
|
|
147
|
+
claims: a,
|
|
148
|
+
excuses: o,
|
|
149
|
+
body: r.body
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return n;
|
|
153
|
+
}
|
|
154
|
+
function v(e) {
|
|
155
|
+
let t = [], r = [];
|
|
156
|
+
for (let i of y(e)) {
|
|
157
|
+
let c = a(e, i).split(o).join("/"), l;
|
|
158
|
+
try {
|
|
159
|
+
l = n(i, "utf8");
|
|
160
|
+
} catch (e) {
|
|
161
|
+
r.push({
|
|
162
|
+
path: c,
|
|
163
|
+
reason: x(e)
|
|
164
|
+
});
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
let u = g.exec(l);
|
|
168
|
+
if (!u) continue;
|
|
169
|
+
let d;
|
|
170
|
+
try {
|
|
171
|
+
d = s(u[1]) ?? {};
|
|
172
|
+
} catch (e) {
|
|
173
|
+
r.push({
|
|
174
|
+
path: c,
|
|
175
|
+
reason: x(e)
|
|
176
|
+
});
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
!d || typeof d != "object" || t.push({
|
|
180
|
+
path: c,
|
|
181
|
+
frontmatter: d,
|
|
182
|
+
body: u[2]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
documents: t,
|
|
187
|
+
unreadable: r
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function y(e) {
|
|
191
|
+
let t;
|
|
192
|
+
try {
|
|
193
|
+
t = r(e, {
|
|
194
|
+
recursive: !0,
|
|
195
|
+
encoding: "utf8"
|
|
196
|
+
});
|
|
197
|
+
} catch {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
return t.filter((e) => e.endsWith(".md")).map((t) => i(e, t)).sort();
|
|
201
|
+
}
|
|
202
|
+
function b(e) {
|
|
203
|
+
return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
204
|
+
}
|
|
205
|
+
function x(e) {
|
|
206
|
+
return e instanceof Error ? e.message : String(e);
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/completeness/run.ts
|
|
210
|
+
function S(e) {
|
|
211
|
+
let { declarations: t, unresolved: n } = m(e.moduleRoots), r = [], i = [], a = [], o = /* @__PURE__ */ new Set(), s = v(e.bundleRoot);
|
|
212
|
+
for (let e of s.unreadable) o.has(e.path) || (o.add(e.path), a.push(e));
|
|
213
|
+
for (let e of t) {
|
|
214
|
+
let t = u(e, _(s.documents, e));
|
|
215
|
+
i.push(t.rollup), r.push(...t.findings);
|
|
216
|
+
}
|
|
217
|
+
return r.sort((e, t) => e.vocabulary.localeCompare(t.vocabulary) || e.kind.localeCompare(t.kind) || e.value.localeCompare(t.value)), {
|
|
218
|
+
bundleRoot: e.bundleRoot,
|
|
219
|
+
vocabularies: t.map((e) => e.name),
|
|
220
|
+
unresolved: n,
|
|
221
|
+
unreadable: a,
|
|
222
|
+
rollups: i,
|
|
223
|
+
findings: r,
|
|
224
|
+
verdict: p(r, e.strict ?? !1, t.length)
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { v as n, S as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdapterResult, EvidenceAdapter } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `cli-agent-evals` reports → run entries, one per scenario (FR-042).
|
|
4
|
+
*
|
|
5
|
+
* **Why this is worth an adapter at all.** An eval drives the real agent through
|
|
6
|
+
* the real CLI, which makes it the most convincing verification this project
|
|
7
|
+
* has — and until now the least recorded. `quire coverage` reconciles matrix
|
|
8
|
+
* rows against test symbols in code; eval scenarios are data in
|
|
9
|
+
* `evals/scenarios/index.mjs`, so they mint no symbol and can never back a row.
|
|
10
|
+
*
|
|
11
|
+
* Measured at the time of writing: **71 unbacked rows** across `spec/evals.md`,
|
|
12
|
+
* `FR-028` and `FR-038`, every one of them a criterion whose ✅ rested on
|
|
13
|
+
* somebody having run the evals (`SR-008` FND-001). For FR-038 they had been
|
|
14
|
+
* run — four scenarios, 4/4, live — and the repository dropped the report.
|
|
15
|
+
*
|
|
16
|
+
* With a run record, an eval suite is subject to the same freshness, staleness
|
|
17
|
+
* and vacuity checks as any other, and a matrix row is backed by a fact rather
|
|
18
|
+
* than by trust.
|
|
19
|
+
*
|
|
20
|
+
* **The scenario id IS the symbol.** `TC-EV-054` is what the matrix row names
|
|
21
|
+
* and what the report keys on, so no mapping is needed and none is invented —
|
|
22
|
+
* the join FR-034 usually has to construct is already stated here.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseAgentEval(raw: string): AdapterResult;
|
|
25
|
+
export declare const agentEvalAdapter: EvidenceAdapter;
|
|
26
|
+
//# sourceMappingURL=agent-eval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-eval.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/agent-eval.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CA4CzD;AAoBD,eAAO,MAAM,gBAAgB,EAAE,eAM9B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FindingResult } from './sarif.js';
|
|
2
|
+
/**
|
|
3
|
+
* Architecture-conformance audit scripts → findings (FR-036).
|
|
4
|
+
*
|
|
5
|
+
* **Why this is the format worth reading for architecture conformance.**
|
|
6
|
+
* Specs and ADRs declare boundaries — "engine/surfaces split", "no solver dep
|
|
7
|
+
* in core", "thin CLI" — that rot silently unless something enforces them. The
|
|
8
|
+
* audit-script pattern is the worked prior art (`quire-rs/scripts/audits/`, a
|
|
9
|
+
* README mapping each script to the criteria it audits), and this reads its
|
|
10
|
+
* output without asking anyone to change it.
|
|
11
|
+
*
|
|
12
|
+
* **The join is literal here, which it is not for most scanners.** FR-034
|
|
13
|
+
* described a scanner rule id ⇄ obligation id as *"a verification method, not a
|
|
14
|
+
* generic scan"*. An audit script already prints the criterion in its failure
|
|
15
|
+
* line — `check_no_schemars: FAIL — 'schemars' present (quire-rs FR-003-AC-4)` — so the
|
|
16
|
+
* obligation it discharges is stated by the tool rather than mapped after the
|
|
17
|
+
* fact.
|
|
18
|
+
*
|
|
19
|
+
* **A script reporting `OK` is a rule that ran and passed**, which is why
|
|
20
|
+
* `rulesEvaluated` counts every line of either kind. A file with no recognised
|
|
21
|
+
* line means no audit ran, and that is vacuous (FR-034): the check found
|
|
22
|
+
* nothing because it looked for nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseAuditScript(raw: string): FindingResult;
|
|
25
|
+
//# sourceMappingURL=audit-script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-script.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/audit-script.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA8BhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAyB3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cargo-mutants.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/cargo-mutants.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAuCpB,eAAO,MAAM,mBAAmB,EAAE,eA+EjC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EvidenceAdapter } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `classname` + `name` → the qualified name the symbol extractor produces.
|
|
4
|
+
*
|
|
5
|
+
* This is the join, and it is the whole job. A tool's own test name is not a
|
|
6
|
+
* symbol identity: `quire` records `tests::tc001`, JUnit records
|
|
7
|
+
* `classname="tests" name="tc001"`. Anything that skipped this would write a
|
|
8
|
+
* store whose entries match no declared symbol, and every obligation would
|
|
9
|
+
* read as unmatched while looking recorded.
|
|
10
|
+
*
|
|
11
|
+
* Separator is `::` because that is what the Rust and Python extractors emit
|
|
12
|
+
* for `container::member`. A `classname` that already contains the name — some
|
|
13
|
+
* runners repeat it — is not doubled.
|
|
14
|
+
*/
|
|
15
|
+
export declare function qualifiedName(classname: string, name: string): string;
|
|
16
|
+
export declare const junitAdapter: EvidenceAdapter;
|
|
17
|
+
//# sourceMappingURL=junit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"junit.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/junit.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AA+BpB;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAUrE;AAmCD,eAAO,MAAM,YAAY,EAAE,eA+B1B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FindingResult } from './sarif.js';
|
|
2
|
+
import { EvidenceAdapter } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The normalized shape `--results` has always accepted, kept as an adapter so
|
|
5
|
+
* the default path goes through the same seam as every other format.
|
|
6
|
+
*
|
|
7
|
+
* Named `entries` rather than `quoin` because that is what the payload calls
|
|
8
|
+
* itself, and because it is the shape a consumer writes by hand when no adapter
|
|
9
|
+
* fits their tool — the escape hatch that keeps the registry from being a
|
|
10
|
+
* gate.
|
|
11
|
+
*/
|
|
12
|
+
export declare const entriesAdapter: EvidenceAdapter;
|
|
13
|
+
/**
|
|
14
|
+
* Every adapter quoin ships, in the order `--help` lists them.
|
|
15
|
+
*
|
|
16
|
+
* Registration is a list rather than a hardcoded switch so an external user can
|
|
17
|
+
* add an adapter for their own tool. Nothing here is specific to agent-ix
|
|
18
|
+
* repositories: the three formats were chosen to exercise three different
|
|
19
|
+
* corners of the contract, not because of who produces them.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ADAPTERS: readonly EvidenceAdapter[];
|
|
22
|
+
/**
|
|
23
|
+
* Adapters producing a {@link FindingRecord} rather than run entries.
|
|
24
|
+
*
|
|
25
|
+
* A separate registry because the two produce different record types and the
|
|
26
|
+
* command must know which it is writing BEFORE it parses — a scan written into
|
|
27
|
+
* `runs/` would lose the clean-versus-unrun distinction that FR-034 exists to
|
|
28
|
+
* make, silently and at the point of intake.
|
|
29
|
+
*/
|
|
30
|
+
export interface FindingAdapter {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly summary: string;
|
|
33
|
+
readonly tools: readonly string[];
|
|
34
|
+
parse(raw: string): FindingResult;
|
|
35
|
+
}
|
|
36
|
+
export declare const FINDING_ADAPTERS: readonly FindingAdapter[];
|
|
37
|
+
export declare const ADAPTER_NAMES: readonly string[];
|
|
38
|
+
/**
|
|
39
|
+
* The finding-shaped adapter for these options, or `undefined` when the
|
|
40
|
+
* selection is run-shaped.
|
|
41
|
+
*
|
|
42
|
+
* Checked before {@link selectAdapter} so a `--adapter sarif` never falls
|
|
43
|
+
* through to the run path, where its output would be parsed as entries and
|
|
44
|
+
* fail with a message about JSON shape.
|
|
45
|
+
*/
|
|
46
|
+
export declare function selectFindingAdapter(options: {
|
|
47
|
+
adapter?: string;
|
|
48
|
+
tool?: string;
|
|
49
|
+
}): FindingAdapter | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Choose an adapter: an explicit `--adapter` wins, else the suite's declared
|
|
52
|
+
* `tool` selects one, else the normalized default.
|
|
53
|
+
*
|
|
54
|
+
* **An unknown explicit name is an error, never a silent fall back to the
|
|
55
|
+
* default.** Falling back would parse the file as normalized entries, fail with
|
|
56
|
+
* a message about JSON shape, and send the reader to look at their JUnit file
|
|
57
|
+
* instead of at their typo.
|
|
58
|
+
*/
|
|
59
|
+
export declare function selectAdapter(options: {
|
|
60
|
+
adapter?: string;
|
|
61
|
+
tool?: string;
|
|
62
|
+
}): EvidenceAdapter;
|
|
63
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,eAuB5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,eAAe,EAM9C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CACnC;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA2BrD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAG1C,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,cAAc,GAAG,SAAS,CAO7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,eAAe,CAmBlB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Finding } from '../types.js';
|
|
2
|
+
/** What a finding-shaped adapter produces. */
|
|
3
|
+
export interface FindingResult {
|
|
4
|
+
findings: Finding[];
|
|
5
|
+
tool?: string;
|
|
6
|
+
ruleset?: string;
|
|
7
|
+
rulesEvaluated?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* SARIF 2.1.0 → findings.
|
|
11
|
+
*
|
|
12
|
+
* **SARIF is the primary finding adapter** because many scanners converge on
|
|
13
|
+
* it — semgrep (`--sarif`), CodeQL, ESLint, ZAP via its converter — so one
|
|
14
|
+
* robust reader subsumes several bespoke ones. Bespoke adapters are kept only
|
|
15
|
+
* where a tool emits no SARIF at all, which is why `cargo-audit` has its own.
|
|
16
|
+
*
|
|
17
|
+
* A `run` with an empty `results` array is a scan that **happened and found
|
|
18
|
+
* nothing**. That is the whole reason this record type exists, and SARIF
|
|
19
|
+
* already models it: the run envelope is the proof of execution, independent of
|
|
20
|
+
* whether anything was reported.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseSarif(raw: string): FindingResult;
|
|
23
|
+
/**
|
|
24
|
+
* `cargo audit --json` → findings.
|
|
25
|
+
*
|
|
26
|
+
* Kept as a bespoke adapter for one measured reason: **cargo-audit emits no
|
|
27
|
+
* SARIF**, so the SARIF reader cannot subsume it. Its native output is what a
|
|
28
|
+
* consumer's CI actually produces.
|
|
29
|
+
*
|
|
30
|
+
* It also models clean-versus-unrun natively — `vulnerabilities.found: false`
|
|
31
|
+
* beside the `database` and `lockfile` it consulted — which is the same shape
|
|
32
|
+
* this record type generalizes.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseCargoAudit(raw: string): FindingResult;
|
|
35
|
+
//# sourceMappingURL=sarif.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sarif.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/sarif.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAuB3C,8CAA8C;AAC9C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAuErD;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAwD1D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AdapterResult, EvidenceAdapter } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* CycloneDX and SPDX inventories → run entries, one per component (FR-041).
|
|
4
|
+
*
|
|
5
|
+
* **What an SBOM leaf in an assurance case contains, and why that settles the
|
|
6
|
+
* record shape.** `agent-ix/quoin#116` deferred this until FR-040 existed,
|
|
7
|
+
* because the question was whether a supply-chain obligation is discharged by
|
|
8
|
+
* an SBOM's *presence* or by its *contents* — and those imply different records.
|
|
9
|
+
*
|
|
10
|
+
* FR-040 answered it. A GSN evidence leaf renders one line per obligation:
|
|
11
|
+
* statement, supported-or-open, and the auditor's reason. It does not render
|
|
12
|
+
* component lists, and could not usefully — a case is reviewed by a person, and
|
|
13
|
+
* a thousand-row inventory in an argument is not an argument.
|
|
14
|
+
*
|
|
15
|
+
* So the claim an SBOM supports is **"a complete inventory was produced at this
|
|
16
|
+
* commit"**, which is a run record. Contents-level judgement — *component X at
|
|
17
|
+
* version Y has advisory Z* — is finding-shaped and already lands through
|
|
18
|
+
* `cargo-audit` and SARIF (FR-034). There is no third record type here.
|
|
19
|
+
*
|
|
20
|
+
* **One entry per component, deliberately.** The alternative — a single entry
|
|
21
|
+
* with the count in `score` — makes an empty SBOM indistinguishable from a
|
|
22
|
+
* healthy one without a new check. As entries, an inventory listing nothing
|
|
23
|
+
* produces no entries, and `vacuous-evidence` reports it with no new machinery:
|
|
24
|
+
* a tool that ran and found nothing is exactly what that check exists to name.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseSbom(raw: string): AdapterResult;
|
|
27
|
+
/**
|
|
28
|
+
* `evidenceKind` is left unset, like every other adapter shipped here.
|
|
29
|
+
*
|
|
30
|
+
* The catalog gives `sca-sbom` an evidence kind and the suite registry declares
|
|
31
|
+
* one per suite; asserting a fourth copy from the format would be the drift
|
|
32
|
+
* agent-ix/quoin#114 exists to prevent.
|
|
33
|
+
*/
|
|
34
|
+
export declare const sbomAdapter: EvidenceAdapter;
|
|
35
|
+
//# sourceMappingURL=sbom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sbom.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/sbom.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAwBpD;AAqED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,eAMzB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RunEntry } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* One tool output format, transcribed into run entries.
|
|
4
|
+
*
|
|
5
|
+
* The contract is deliberately narrow, and the narrowness IS the contract
|
|
6
|
+
* (ADR-0011 invariant 1 — quoin transcribes; the consumer's CI executes):
|
|
7
|
+
*
|
|
8
|
+
* - **Pure.** `parse` receives the raw text and returns entries. It reads no
|
|
9
|
+
* file beyond that text, spawns no process, and reaches no network. An
|
|
10
|
+
* adapter that could run the tool would make `quoin evidence record` a test
|
|
11
|
+
* runner, and a transcript nobody can trust.
|
|
12
|
+
* - **No verdict.** An adapter reports what the tool said. Deciding whether a
|
|
13
|
+
* result is acceptable belongs to the auditor and the consumer's gate
|
|
14
|
+
* policy, never here — see {@link AdapterResult.evidenceKind} and the note on
|
|
15
|
+
* coverage in `AdapterRegistry`.
|
|
16
|
+
*/
|
|
17
|
+
export interface EvidenceAdapter {
|
|
18
|
+
/** Registry key, and the value `--adapter` takes. */
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/** One line for `--help`; what format this reads. */
|
|
21
|
+
readonly summary: string;
|
|
22
|
+
/**
|
|
23
|
+
* Tool identifiers this adapter claims, matched case-insensitively against
|
|
24
|
+
* the suite's declared `tool` as a substring. Empty means "never selected
|
|
25
|
+
* automatically" — an adapter that only runs when named explicitly.
|
|
26
|
+
*/
|
|
27
|
+
readonly tools: readonly string[];
|
|
28
|
+
parse(raw: string): AdapterResult;
|
|
29
|
+
}
|
|
30
|
+
/** What an adapter produces. */
|
|
31
|
+
export interface AdapterResult {
|
|
32
|
+
entries: RunEntry[];
|
|
33
|
+
/**
|
|
34
|
+
* The evidence kind this format proves, when the FORMAT ITSELF determines
|
|
35
|
+
* it — and usually it does not.
|
|
36
|
+
*
|
|
37
|
+
* A JUnit XML file is emitted by unit, integration and end-to-end suites
|
|
38
|
+
* alike, so an adapter answering "Unit" would be asserting something the
|
|
39
|
+
* format does not contain. The kind is declared by the suite registry
|
|
40
|
+
* (`Evidence Kind`) and passed with `--kind`; that is where the vocabulary
|
|
41
|
+
* lives, and where it stays.
|
|
42
|
+
*
|
|
43
|
+
* The field exists because an external adapter for a single-purpose tool may
|
|
44
|
+
* legitimately know. The adapters shipped here leave it unset rather than
|
|
45
|
+
* mint a fourth copy of a vocabulary that already exists in three places
|
|
46
|
+
* (agent-ix/quoin#114).
|
|
47
|
+
*/
|
|
48
|
+
evidenceKind?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Raised when an adapter cannot read its input. */
|
|
51
|
+
export declare class AdapterError extends Error {
|
|
52
|
+
readonly adapter: string;
|
|
53
|
+
constructor(adapter: string, message: string);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/evidence/adapters/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CACnC;AAED,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,oDAAoD;AACpD,qBAAa,YAAa,SAAQ,KAAK;IAEnC,QAAQ,CAAC,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM;CAKlB"}
|
package/dist/evidence/index.d.ts
CHANGED
|
@@ -10,4 +10,14 @@
|
|
|
10
10
|
export { affirm, baselinePath, bind, bindingsPath, canonicalJson, gc, inspectionsPath, latestRun, listRecordedSuites, listRuns, readBaseline, readBindings, readRun, readRuns, runPath, short, storeRoot, suitesPath, writeBaseline, writeBindings, writeRun, } from './store.js';
|
|
11
11
|
export { RUNS_DIR, STORE_SCHEMA_VERSION, type Affirmation, type BaselineFile, type Binding, type BindingsFile, type RunEntry, type RunRecord, } from './types.js';
|
|
12
12
|
export { obligationsFrom, recordRun, type RecordOutcome, type RecordRequest, } from './record.js';
|
|
13
|
+
export { ADAPTERS, ADAPTER_NAMES, FINDING_ADAPTERS, entriesAdapter, selectAdapter, selectFindingAdapter, type FindingAdapter, } from './adapters/registry.js';
|
|
14
|
+
export { junitAdapter, qualifiedName } from './adapters/junit.js';
|
|
15
|
+
export { cargoMutantsAdapter } from './adapters/cargo-mutants.js';
|
|
16
|
+
export { AdapterError, type AdapterResult, type EvidenceAdapter, } from './adapters/types.js';
|
|
17
|
+
export { parseCargoAudit, parseSarif, type FindingResult, } from './adapters/sarif.js';
|
|
18
|
+
export type { Finding, FindingRecord } from './types.js';
|
|
19
|
+
export { latestScan, listScans, readScan, readScans, scanIsVacuous, scanPath, writeScan, } from './store.js';
|
|
20
|
+
export { parseAuditScript } from './adapters/audit-script.js';
|
|
21
|
+
export { parseSbom, sbomAdapter } from './adapters/sbom.js';
|
|
22
|
+
export { parseAgentEval, agentEvalAdapter } from './adapters/agent-eval.js';
|
|
13
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evidence/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,EAAE,EACF,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,GACT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evidence/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,EAAE,EACF,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,GACT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,UAAU,EACV,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|