@agent-ix/quoin 0.15.1 → 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.
Files changed (125) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/default-modules.yaml +15 -6
  4. package/dist/advisor/advise.d.ts +14 -1
  5. package/dist/advisor/advise.d.ts.map +1 -1
  6. package/dist/advisor/methods.d.ts +11 -1
  7. package/dist/advisor/methods.d.ts.map +1 -1
  8. package/dist/{advisor-D35K3_iI.js → advisor-a9axb4Jl.js} +21 -8
  9. package/dist/assurance/graph.d.ts +79 -0
  10. package/dist/assurance/graph.d.ts.map +1 -0
  11. package/dist/assurance/index.d.ts +9 -0
  12. package/dist/assurance/index.d.ts.map +1 -0
  13. package/dist/assurance/render.d.ts +3 -0
  14. package/dist/assurance/render.d.ts.map +1 -0
  15. package/dist/auditor/audit.d.ts +37 -5
  16. package/dist/auditor/audit.d.ts.map +1 -1
  17. package/dist/auditor/combinatorial.d.ts +53 -0
  18. package/dist/auditor/combinatorial.d.ts.map +1 -0
  19. package/dist/auditor/index.d.ts +1 -1
  20. package/dist/auditor/index.d.ts.map +1 -1
  21. package/dist/auditor-W2jFinr6.js +188 -0
  22. package/dist/{base-CtpwIg4M.js → base-BE20w0jY.js} +1 -1
  23. package/dist/cli.js +1 -1
  24. package/dist/combinatorial-Cq01XfhV.js +80 -0
  25. package/dist/commands/advise.d.ts +16 -0
  26. package/dist/commands/advise.d.ts.map +1 -0
  27. package/dist/commands/advise.js +164 -0
  28. package/dist/commands/assurance.d.ts +14 -0
  29. package/dist/commands/assurance.d.ts.map +1 -0
  30. package/dist/commands/assurance.js +179 -0
  31. package/dist/commands/catalog/list.js +2 -2
  32. package/dist/commands/catalog/methods.js +3 -3
  33. package/dist/commands/catalog/show.js +2 -2
  34. package/dist/commands/catalog/validate.js +2 -2
  35. package/dist/commands/completeness.d.ts +16 -0
  36. package/dist/commands/completeness.d.ts.map +1 -0
  37. package/dist/commands/completeness.js +49 -0
  38. package/dist/commands/config/doctor.js +1 -1
  39. package/dist/commands/config/edit.js +1 -1
  40. package/dist/commands/config/get.js +1 -1
  41. package/dist/commands/config/set.js +1 -1
  42. package/dist/commands/evidence/affirm.d.ts.map +1 -1
  43. package/dist/commands/evidence/affirm.js +36 -50
  44. package/dist/commands/evidence/audit.d.ts +11 -0
  45. package/dist/commands/evidence/audit.d.ts.map +1 -1
  46. package/dist/commands/evidence/audit.js +60 -154
  47. package/dist/commands/evidence/baseline.d.ts +14 -0
  48. package/dist/commands/evidence/baseline.d.ts.map +1 -0
  49. package/dist/commands/evidence/baseline.js +79 -0
  50. package/dist/commands/evidence/gc.js +2 -2
  51. package/dist/commands/evidence/index.d.ts.map +1 -1
  52. package/dist/commands/evidence/index.js +4 -2
  53. package/dist/commands/evidence/record.d.ts +3 -0
  54. package/dist/commands/evidence/record.d.ts.map +1 -1
  55. package/dist/commands/evidence/record.js +97 -53
  56. package/dist/commands/matrix.js +1 -1
  57. package/dist/commands/module/ensure-defaults.js +3 -3
  58. package/dist/commands/module/install.js +2 -2
  59. package/dist/commands/module/list.js +2 -2
  60. package/dist/commands/module/remove.js +2 -2
  61. package/dist/commands/review.js +1 -1
  62. package/dist/commands/to-plan.js +1 -1
  63. package/dist/commands/update.js +2 -2
  64. package/dist/commands/write.js +3 -3
  65. package/dist/completeness/assess.d.ts +82 -0
  66. package/dist/completeness/assess.d.ts.map +1 -0
  67. package/dist/completeness/bundle.d.ts +52 -0
  68. package/dist/completeness/bundle.d.ts.map +1 -0
  69. package/dist/completeness/declarations.d.ts +46 -0
  70. package/dist/completeness/declarations.d.ts.map +1 -0
  71. package/dist/completeness/index.d.ts +11 -0
  72. package/dist/completeness/index.d.ts.map +1 -0
  73. package/dist/completeness/run.d.ts +35 -0
  74. package/dist/completeness/run.d.ts.map +1 -0
  75. package/dist/completeness-BeqcskAI.js +228 -0
  76. package/dist/evidence/adapters/agent-eval.d.ts +26 -0
  77. package/dist/evidence/adapters/agent-eval.d.ts.map +1 -0
  78. package/dist/evidence/adapters/audit-script.d.ts +25 -0
  79. package/dist/evidence/adapters/audit-script.d.ts.map +1 -0
  80. package/dist/evidence/adapters/cargo-mutants.d.ts +3 -0
  81. package/dist/evidence/adapters/cargo-mutants.d.ts.map +1 -0
  82. package/dist/evidence/adapters/junit.d.ts +17 -0
  83. package/dist/evidence/adapters/junit.d.ts.map +1 -0
  84. package/dist/evidence/adapters/registry.d.ts +63 -0
  85. package/dist/evidence/adapters/registry.d.ts.map +1 -0
  86. package/dist/evidence/adapters/sarif.d.ts +35 -0
  87. package/dist/evidence/adapters/sarif.d.ts.map +1 -0
  88. package/dist/evidence/adapters/sbom.d.ts +35 -0
  89. package/dist/evidence/adapters/sbom.d.ts.map +1 -0
  90. package/dist/evidence/adapters/types.d.ts +55 -0
  91. package/dist/evidence/adapters/types.d.ts.map +1 -0
  92. package/dist/evidence/index.d.ts +11 -1
  93. package/dist/evidence/index.d.ts.map +1 -1
  94. package/dist/evidence/record.d.ts +6 -0
  95. package/dist/evidence/record.d.ts.map +1 -1
  96. package/dist/evidence/store.d.ts +124 -8
  97. package/dist/evidence/store.d.ts.map +1 -1
  98. package/dist/evidence/types.d.ts +110 -5
  99. package/dist/evidence/types.d.ts.map +1 -1
  100. package/dist/evidence-FRF9RN77.js +595 -0
  101. package/dist/{flow-command-BSMqxass.js → flow-command-BrzzKBo9.js} +1 -1
  102. package/dist/index.js +6 -6
  103. package/dist/{modules-Ckfaq5p4.js → modules-_FQTZ3gx.js} +2 -2
  104. package/dist/{plugins-CLuXx2Jr.js → plugins-Q1MtCIE5.js} +1 -1
  105. package/dist/quire/contract.d.ts +1 -1
  106. package/dist/quire/contract.d.ts.map +1 -1
  107. package/dist/quire/exec.d.ts +44 -0
  108. package/dist/quire/exec.d.ts.map +1 -0
  109. package/dist/quire/index.d.ts +1 -0
  110. package/dist/quire/index.d.ts.map +1 -1
  111. package/dist/{quire-MbMdffPh.js → quire-Dis3ky5t.js} +316 -262
  112. package/dist/{version-By2YFRZQ.js → version-D0l3nDPZ.js} +1 -1
  113. package/dist/{write-8JJ8Dumo.js → write-CMA6BDUq.js} +1 -1
  114. package/package.json +2 -1
  115. package/skills/spec-evidence-analysis/SKILL.md +27 -11
  116. package/skills/spec-fuzz/SKILL.md +94 -0
  117. package/skills/spec-fuzz/assets/templates/atheris.py.md +74 -0
  118. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +83 -0
  119. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +76 -0
  120. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +51 -0
  121. package/skills/spec-fuzz/references/step-1-select-obligations.md +47 -0
  122. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +55 -0
  123. package/skills/spec-fuzz/references/step-3-emit-targets.md +65 -0
  124. package/skills/spec-fuzz/references/step-4-report.md +56 -0
  125. package/dist/evidence-BvUyw-Yv.js +0 -171
@@ -1,85 +1,129 @@
1
- import { n as e, t } from "../../quire-MbMdffPh.js";
2
- import { t as n } from "../../base-CtpwIg4M.js";
3
- import { n as r, t as i } from "../../evidence-BvUyw-Yv.js";
4
- import { readFileSync as a } from "node:fs";
5
- import { Flags as o } from "@oclif/core";
6
- import { execFileSync as s } from "node:child_process";
1
+ import { i as e, n as t, o as n, t as r } from "../../quire-Dis3ky5t.js";
2
+ import { t as i } from "../../base-BE20w0jY.js";
3
+ import { _ as a, a as o, c as s, i as c, m as l, n as u, r as d, t as f, v as p } from "../../evidence-FRF9RN77.js";
4
+ import { readFileSync as m } from "node:fs";
5
+ import { Flags as h } from "@oclif/core";
7
6
  //#region src/commands/evidence/record.ts
8
- var c = class a extends n {
7
+ var g = class u extends i {
9
8
  static summary = "Transcribe one suite run into the evidence store.";
10
- static description = "Records ONE run of ONE suite at ONE commit, then binds every obligation that\nrun discharged, stamping the statement hash as it stands now.\n\nquoin transcribes; the consumer's CI executes (ADR-0011 invariant 1). This\ncommand runs no test and judges no result — recording a FAILING run is as\nlegitimate as recording a passing one, and more useful, because a suite that\nstopped passing is exactly what a freshness check needs to see.\n\n--results takes normalized entries:\n\n {\"entries\": [{\"symbol\": \"tests::tc001\", \"outcome\": \"pass\", \"traceIds\": [\"FR-001-AC-1\"]}]}\n\nFormat adapters (junit, llvm-cov, cargo-mutants, SARIF) are a separate ticket\n(agent-ix/quoin#91); this verb owns the store, not the parsing of every tool.";
9
+ static description = "Records ONE run of ONE suite at ONE commit, then binds every obligation that\nrun discharged, stamping the statement hash as it stands now.\n\nquoin transcribes; the consumer's CI executes (ADR-0011 invariant 1). This\ncommand runs no test and judges no result — recording a FAILING run is as\nlegitimate as recording a passing one, and more useful, because a suite that\nstopped passing is exactly what a freshness check needs to see.\n\n--results takes normalized entries:\n\n {\"entries\": [{\"symbol\": \"tests::tc001\", \"outcome\": \"pass\", \"traceIds\": [\"FR-001-AC-1\"]}]}\n\n--adapter selects a format reader. Without it the suite's --tool picks one, and\nfailing that the normalized shape above is assumed. An adapter transcribes; it\nruns nothing and judges nothing.";
11
10
  static examples = ["quoin evidence record --suite SUITE-001 --commit $(git rev-parse HEAD) --tool 'cargo test' --results run.json"];
12
11
  static flags = {
13
- suite: o.string({
12
+ suite: h.string({
14
13
  description: "Suite id from spec/evidence/suites.md (e.g. SUITE-001).",
15
14
  required: !0
16
15
  }),
17
- commit: o.string({
16
+ commit: h.string({
18
17
  description: "Full commit sha the run was performed at.",
19
18
  required: !0
20
19
  }),
21
- tool: o.string({
20
+ tool: h.string({
22
21
  description: "Tool and version, as it identifies itself.",
23
22
  required: !0
24
23
  }),
25
- results: o.string({
24
+ kind: h.string({ description: "Evidence kind this run produced (Unit, Property, Static, Manual, …) — the vocabulary the catalog's `evidence_kind` and the suite registry's `Evidence Kind` column use. Method conformance compares kind to kind; without it the check stays silent rather than guessing." }),
25
+ discharges: h.string({
26
+ description: "Obligation ids this scan discharges, comma-separated. Finding-shaped only. A CLEAN scan is the strongest evidence a scanner produces and carries no finding to bind from, so the obligations it was run to check are stated rather than inferred. A scan that evaluated no rules binds nothing regardless.",
27
+ multiple: !1
28
+ }),
29
+ adapter: h.string({
30
+ description: `Format reader for --results (${f.join(", ")}). Defaults to the adapter claiming --tool, else the normalized shape. An unknown name is an error rather than a silent fall back, so a typo reports itself instead of failing later as a JSON-shape complaint.`,
31
+ options: [...f]
32
+ }),
33
+ results: h.string({
26
34
  description: "Normalized run entries as JSON. `-` reads stdin.",
27
35
  required: !0
28
36
  }),
29
- repo: o.string({
37
+ repo: h.string({
30
38
  description: "Repository root. Defaults to the working directory.",
31
39
  default: "."
32
40
  }),
33
- module: o.string({ description: "Module directory supplying the traceability model." }),
34
- timestamp: o.string({ description: "ISO-8601 run time. Defaults to now." }),
35
- json: o.boolean({ description: "Emit the outcome as JSON." })
41
+ module: h.string({ description: "Module directory supplying the traceability model." }),
42
+ timestamp: h.string({ description: "ISO-8601 run time. Defaults to now." }),
43
+ json: h.boolean({ description: "Emit the outcome as JSON." })
36
44
  };
37
45
  async run() {
38
- let { flags: n } = await this.parse(a), o = e(l());
39
- o && this.error(o.message, { exit: 2 });
40
- let c = u(n.results), d = [
46
+ let { flags: i } = await this.parse(u), f = n(r());
47
+ f && this.error(f.message, { exit: 2 });
48
+ let h = [
41
49
  "coverage",
42
50
  "--scope",
43
- n.repo,
51
+ i.repo,
44
52
  "--json"
45
53
  ];
46
- n.module && d.push("--module", n.module);
47
- let f = s("quire", d, {
48
- encoding: "utf8",
49
- stdio: [
50
- "ignore",
51
- "pipe",
52
- "ignore"
53
- ]
54
- }), p = t(f);
55
- p.ok || this.error(`${p.error.message}\n${p.error.errors.slice(0, 10).join("\n")}`, { exit: 2 });
56
- let m = r({
57
- repo: n.repo,
58
- suite: n.suite,
59
- commit: n.commit,
60
- tool: n.tool,
61
- timestamp: n.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
62
- entries: c,
63
- obligations: i(p.value)
54
+ i.module && h.push("--module", i.module);
55
+ let g = t(h), v = e(g);
56
+ v.ok || this.error(`${v.error.message}\n${v.error.errors.slice(0, 10).join("\n")}`, { exit: 2 });
57
+ let y = d({
58
+ adapter: i.adapter,
59
+ tool: i.tool
64
60
  });
65
- if (n.json) {
66
- this.log(JSON.stringify(m, null, 2));
61
+ if (y) {
62
+ let e = i.results === "-" ? m(0, "utf8") : m(i.results, "utf8"), t = y.parse(e), n = p(i.repo, {
63
+ schemaVersion: 1,
64
+ suite: i.suite,
65
+ commit: i.commit,
66
+ tool: t.tool ?? i.tool,
67
+ ...i.kind === void 0 ? {} : { evidenceKind: i.kind },
68
+ timestamp: i.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
69
+ ...t.ruleset === void 0 ? {} : { ruleset: t.ruleset },
70
+ ...t.rulesEvaluated === void 0 ? {} : { rulesEvaluated: t.rulesEvaluated },
71
+ findings: t.findings
72
+ }), r = t.rulesEvaluated === 0, o = (i.discharges ?? "").split(",").map((e) => e.trim()).filter((e) => e !== ""), u = [], d = [];
73
+ if (o.length > 0 && !r) {
74
+ let e = new Map(c(v.value).map((e) => [e.id, e])), t = l(i.repo).bindings;
75
+ for (let n of [...o].sort()) {
76
+ let r = e.get(n);
77
+ if (!r) {
78
+ d.push(n);
79
+ continue;
80
+ }
81
+ let a = s(t, {
82
+ obligation: n,
83
+ statementHashAtBinding: r.statement_hash,
84
+ suite: i.suite,
85
+ commit: i.commit,
86
+ symbols: []
87
+ });
88
+ t = a.bindings, a.created && u.push(n);
89
+ }
90
+ a(i.repo, { bindings: t });
91
+ }
92
+ if (i.json) {
93
+ this.log(JSON.stringify({
94
+ scanPath: n,
95
+ findings: t.findings,
96
+ bound: u,
97
+ unknown: d
98
+ }, null, 2));
99
+ return;
100
+ }
101
+ this.log(`recorded scan ${i.suite} @ ${i.commit.slice(0, 12)} → ${n}`), this.log(` bound: ${u.length}`), d.length > 0 && this.log(` discharges no such obligation: ${d.sort().join(", ")}`), r && o.length > 0 && this.log(" bound nothing: the scan evaluated no rules, so it found nothing because it looked for nothing"), this.log(` findings: ${t.findings.length}` + (t.rulesEvaluated === void 0 ? " (the tool reported no rule count, so this cannot be told from a scan with no rules enabled)" : ` over ${t.rulesEvaluated} rules evaluated`));
67
102
  return;
68
103
  }
69
- this.log(`recorded ${n.suite} @ ${n.commit.slice(0, 12)} → ${m.runPath}`), this.log(` bound: ${m.bound.length}`), m.suspect.length > 0 && this.log(` suspect (statement changed since binding, re-affirm to clear): ${m.suspect.join(", ")}`), m.unmatched.length > 0 && this.log(` unmatched trace ids (tagged in the suite, stated by no obligation): ${m.unmatched.join(", ")}`);
104
+ let b = _(i.results, {
105
+ adapter: i.adapter,
106
+ tool: i.tool
107
+ }), x = o({
108
+ repo: i.repo,
109
+ suite: i.suite,
110
+ commit: i.commit,
111
+ tool: i.tool,
112
+ evidenceKind: i.kind,
113
+ timestamp: i.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
114
+ entries: b,
115
+ obligations: c(v.value)
116
+ });
117
+ if (i.json) {
118
+ this.log(JSON.stringify(x, null, 2));
119
+ return;
120
+ }
121
+ this.log(`recorded ${i.suite} @ ${i.commit.slice(0, 12)} → ${x.runPath}`), this.log(` bound: ${x.bound.length}`), x.suspect.length > 0 && this.log(` suspect (statement changed since binding, re-affirm to clear): ${x.suspect.join(", ")}`), x.unmatched.length > 0 && this.log(` unmatched trace ids (tagged in the suite, stated by no obligation): ${x.unmatched.join(", ")}`);
70
122
  }
71
123
  };
72
- function l() {
73
- try {
74
- return s("quire", ["--version"], { encoding: "utf8" });
75
- } catch {
76
- return null;
77
- }
78
- }
79
- function u(e) {
80
- let t = a(e === "-" ? 0 : e, "utf8"), n = JSON.parse(t);
81
- if (!Array.isArray(n.entries)) throw Error("--results must be JSON of the form {\"entries\": [{symbol, outcome, traceIds?}]}");
82
- return n.entries;
124
+ function _(e, t) {
125
+ let n = m(e === "-" ? 0 : e, "utf8");
126
+ return u(t).parse(n).entries;
83
127
  }
84
128
  //#endregion
85
- export { c as default };
129
+ export { g as default };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../flow-command-BSMqxass.js";
1
+ import { t as e } from "../flow-command-BrzzKBo9.js";
2
2
  //#region src/commands/matrix.ts
3
3
  var t = class t extends e {
4
4
  static summary = "Build or update a requirements test matrix.";
@@ -1,6 +1,6 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
2
- import { r as t } from "../../plugins-CLuXx2Jr.js";
3
- import { n } from "../../modules-Ckfaq5p4.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
+ import { r as t } from "../../plugins-Q1MtCIE5.js";
3
+ import { n } from "../../modules-_FQTZ3gx.js";
4
4
  //#region src/commands/module/ensure-defaults.ts
5
5
  var r = class r extends e {
6
6
  static summary = "Idempotently install the default spec module set.";
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
2
- import { n as t } from "../../plugins-CLuXx2Jr.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
+ import { n as t } from "../../plugins-Q1MtCIE5.js";
3
3
  import { Args as n } from "@oclif/core";
4
4
  //#region src/commands/module/install.ts
5
5
  var r = class r extends e {
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
2
- import { r as t } from "../../plugins-CLuXx2Jr.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
+ import { r as t } from "../../plugins-Q1MtCIE5.js";
3
3
  //#region src/commands/module/list.ts
4
4
  var n = class n extends e {
5
5
  static summary = "List installed spec modules.";
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../base-CtpwIg4M.js";
2
- import { a as t } from "../../plugins-CLuXx2Jr.js";
1
+ import { t as e } from "../../base-BE20w0jY.js";
2
+ import { a as t } from "../../plugins-Q1MtCIE5.js";
3
3
  import { Args as n } from "@oclif/core";
4
4
  //#region src/commands/module/remove.ts
5
5
  var r = class r extends e {
@@ -1,4 +1,4 @@
1
- import { t as e } from "../flow-command-BSMqxass.js";
1
+ import { t as e } from "../flow-command-BrzzKBo9.js";
2
2
  //#region src/commands/review.ts
3
3
  var t = class t extends e {
4
4
  static summary = "Run a composite spec review workflow.";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../flow-command-BSMqxass.js";
1
+ import { t as e } from "../flow-command-BrzzKBo9.js";
2
2
  //#region src/commands/to-plan.ts
3
3
  var t = class t extends e {
4
4
  static summary = "Convert accepted requirements into an implementation plan.";
@@ -1,5 +1,5 @@
1
- import { t as e } from "../version-By2YFRZQ.js";
2
- import { t } from "../base-CtpwIg4M.js";
1
+ import { t as e } from "../version-D0l3nDPZ.js";
2
+ import { t } from "../base-BE20w0jY.js";
3
3
  import { runSelfUpdate as n } from "@agent-ix/ix-cli-core";
4
4
  import { Flags as r } from "@oclif/core";
5
5
  //#region src/commands/update.ts
@@ -1,6 +1,6 @@
1
- import { o as e, t } from "../base-CtpwIg4M.js";
2
- import { n } from "../modules-Ckfaq5p4.js";
3
- import { n as r, r as i, t as a } from "../write-8JJ8Dumo.js";
1
+ import { o as e, t } from "../base-BE20w0jY.js";
2
+ import { n } from "../modules-_FQTZ3gx.js";
3
+ import { n as r, r as i, t as a } from "../write-CMA6BDUq.js";
4
4
  import { Args as o, Flags as s } from "@oclif/core";
5
5
  //#region src/commands/write.ts
6
6
  var c = class c extends t {
@@ -0,0 +1,82 @@
1
+ import { VocabularyDeclaration } from './declarations.js';
2
+ export type FindingKind = "unowned" | "unjustified-exclusion" | "undeclared-exclusion";
3
+ export type Severity = "medium" | "high";
4
+ export interface CompletenessFinding {
5
+ /** Declaration this concerns, e.g. `quality-characteristics`. */
6
+ vocabulary: string;
7
+ /** The vocabulary value, e.g. `safety`. */
8
+ value: string;
9
+ kind: FindingKind;
10
+ severity: Severity;
11
+ message: string;
12
+ /** Document carrying the exclusion, for the two exclusion kinds. */
13
+ document?: string;
14
+ }
15
+ export interface VocabularyRollup {
16
+ vocabulary: string;
17
+ /** Values in the declared enum. */
18
+ declared: number;
19
+ /** Values some document claims. */
20
+ owned: number;
21
+ /** Values a document excuses, whether or not the excuse is justified. */
22
+ excused: number;
23
+ /** Values neither claimed nor excused. */
24
+ unowned: number;
25
+ }
26
+ /**
27
+ * `UNCHECKED` is not a fourth flavour of pass.
28
+ *
29
+ * A bundle whose module set declares no vocabulary has not been assessed, and
30
+ * `PASS` over it is the green-matrix-over-dead-links result this program was
31
+ * created to stop — the first draft of this file printed exactly that, and the
32
+ * criterion written to forbid it caught it.
33
+ */
34
+ export type Verdict = "PASS" | "CONDITIONAL" | "FAIL" | "UNCHECKED";
35
+ export interface CompletenessReport {
36
+ rollups: VocabularyRollup[];
37
+ findings: CompletenessFinding[];
38
+ verdict: Verdict;
39
+ }
40
+ /** One document's declared-vocabulary frontmatter, as read from the bundle. */
41
+ export interface DocumentClaims {
42
+ /** Path, relative to the bundle root. */
43
+ path: string;
44
+ /** Values this document claims via the declaration's `field`. */
45
+ claims: string[];
46
+ /** Values this document excuses via `justified_absence_field`. */
47
+ excuses: string[];
48
+ /** Raw body text, searched for the written reason behind each excuse. */
49
+ body: string;
50
+ }
51
+ /**
52
+ * Assess one vocabulary declaration against what the bundle's documents say.
53
+ *
54
+ * Note the asymmetry, which is the policy: **`unowned` is medium and an
55
+ * unjustified exclusion is high.** Saying nothing about reliability is an
56
+ * admitted gap that a reader can see. Excusing it without a reason is an
57
+ * assertion of completeness with nothing behind it, and it removes the finding
58
+ * that would have prompted the work.
59
+ */
60
+ export declare function assessVocabulary(declaration: VocabularyDeclaration, documents: DocumentClaims[]): {
61
+ rollup: VocabularyRollup;
62
+ findings: CompletenessFinding[];
63
+ };
64
+ /**
65
+ * The written reason for excusing `value`, or `null` when there is none.
66
+ *
67
+ * A table row whose first cell names the value and whose remaining cells carry
68
+ * a real sentence. A table is required rather than free prose because the value
69
+ * name will occur in passing — "safety" appears in any document discussing
70
+ * safety — and a mention is not a justification.
71
+ */
72
+ export declare function writtenReasonFor(value: string, body: string): string | null;
73
+ /**
74
+ * The verdict over every finding.
75
+ *
76
+ * `--strict` promotes an admitted gap to a failure; it does not invent one. The
77
+ * default is advisory because a new check landing as a hard error across a
78
+ * corpus teaches people to disable it, and a disabled check reports nothing
79
+ * forever — which is the outcome this whole area exists to prevent.
80
+ */
81
+ export declare function verdictFor(findings: CompletenessFinding[], strict: boolean, vocabulariesChecked?: number): Verdict;
82
+ //# sourceMappingURL=assess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assess.d.ts","sourceRoot":"","sources":["../../src/completeness/assess.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,MAAM,WAAW,GACrB,SAAS,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,WAAW,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kEAAkE;IAClE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;CACd;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,qBAAqB,EAClC,SAAS,EAAE,cAAc,EAAE,GAC1B;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAoE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe3E;AAQD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,MAAM,EAAE,OAAO,EACf,mBAAmB,SAAI,GACtB,OAAO,CAKT"}
@@ -0,0 +1,52 @@
1
+ import { VocabularyDeclaration } from './declarations.js';
2
+ import { DocumentClaims } from './assess.js';
3
+ export interface BundleRead {
4
+ documents: DocumentClaims[];
5
+ /** Documents whose frontmatter could not be parsed, and why. */
6
+ unreadable: Array<{
7
+ path: string;
8
+ reason: string;
9
+ }>;
10
+ }
11
+ /**
12
+ * Read every markdown document under `bundleRoot` for one declaration's fields.
13
+ *
14
+ * Both the claim field and the justified-absence field accept a scalar or a
15
+ * list, because `quality_attribute: security` and
16
+ * `quality_attributes_not_applicable: [safety, compliance]` are both ordinary
17
+ * authoring — the same two shapes the engine accepts, for the same reason.
18
+ */
19
+ export declare function readBundleClaims(bundleRoot: string, declaration: VocabularyDeclaration): BundleRead;
20
+ /**
21
+ * Project already-read documents onto one declaration.
22
+ *
23
+ * Split out from {@link readBundleClaims} so a caller with several declarations
24
+ * walks the bundle **once**. The combined form re-read every file per
25
+ * declaration, which NFR-011-M-2 budgets at one pass per invocation.
26
+ */
27
+ export declare function claimsFor(read: BundleDocument[], declaration: VocabularyDeclaration): DocumentClaims[];
28
+ /** One document's frontmatter and body, as read from the bundle. */
29
+ export interface BundleDocument {
30
+ /** Path, relative to the bundle root. */
31
+ path: string;
32
+ frontmatter: Record<string, unknown>;
33
+ body: string;
34
+ }
35
+ export interface FrontmatterRead {
36
+ documents: BundleDocument[];
37
+ unreadable: Array<{
38
+ path: string;
39
+ reason: string;
40
+ }>;
41
+ }
42
+ /**
43
+ * Every document under `bundleRoot` that carries parseable frontmatter.
44
+ *
45
+ * One pass and one reader, shared by the completeness sweep (FR-037) and the
46
+ * assurance view (FR-040). Two readers over the same files would drift, and the
47
+ * second would be written by whoever needed a field the first did not expose —
48
+ * which is how a repository ends up with two answers to "what does this
49
+ * document declare".
50
+ */
51
+ export declare function readBundleFrontmatter(bundleRoot: string): FrontmatterRead;
52
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/completeness/bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,gEAAgE;IAChE,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,qBAAqB,GACjC,UAAU,CAGZ;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,cAAc,EAAE,EACtB,WAAW,EAAE,qBAAqB,GACjC,cAAc,EAAE,CAalB;AAED,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAgCzE"}
@@ -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"}