@agent-ix/quoin 0.19.2 → 0.21.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.
Files changed (66) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/default-modules.yaml +4 -4
  4. package/dist/advisor/advise.d.ts +54 -11
  5. package/dist/advisor/advise.d.ts.map +1 -1
  6. package/dist/advisor/index.d.ts +1 -1
  7. package/dist/advisor/index.d.ts.map +1 -1
  8. package/dist/{advisor-a9axb4Jl.js → advisor-C4P3aTJT.js} +1 -1
  9. package/dist/auditor/audit.d.ts +23 -0
  10. package/dist/auditor/audit.d.ts.map +1 -1
  11. package/dist/auditor/index.d.ts +1 -1
  12. package/dist/auditor/index.d.ts.map +1 -1
  13. package/dist/auditor-B6Hs00oH.js +269 -0
  14. package/dist/{base-BE20w0jY.js → base-DQg6yfbN.js} +1 -1
  15. package/dist/cli.js +1 -1
  16. package/dist/commands/advise.d.ts.map +1 -1
  17. package/dist/commands/advise.js +82 -36
  18. package/dist/commands/assurance.js +13 -13
  19. package/dist/commands/catalog/list.js +2 -2
  20. package/dist/commands/catalog/methods.js +3 -3
  21. package/dist/commands/catalog/show.js +2 -2
  22. package/dist/commands/catalog/validate.js +2 -2
  23. package/dist/commands/completeness.js +2 -2
  24. package/dist/commands/config/doctor.js +1 -1
  25. package/dist/commands/config/edit.js +1 -1
  26. package/dist/commands/config/get.js +1 -1
  27. package/dist/commands/config/set.js +1 -1
  28. package/dist/commands/evidence/affirm.js +5 -5
  29. package/dist/commands/evidence/audit.d.ts.map +1 -1
  30. package/dist/commands/evidence/audit.js +36 -42
  31. package/dist/commands/evidence/baseline.js +13 -13
  32. package/dist/commands/evidence/gc.js +2 -2
  33. package/dist/commands/evidence/index.js +1 -1
  34. package/dist/commands/evidence/record.js +12 -12
  35. package/dist/commands/matrix.js +1 -1
  36. package/dist/commands/module/ensure-defaults.js +3 -3
  37. package/dist/commands/module/install.js +2 -2
  38. package/dist/commands/module/list.js +2 -2
  39. package/dist/commands/module/remove.js +2 -2
  40. package/dist/commands/review.js +1 -1
  41. package/dist/commands/to-plan.js +1 -1
  42. package/dist/commands/update.js +2 -2
  43. package/dist/commands/write.js +3 -3
  44. package/dist/{completeness-BeqcskAI.js → completeness-B1qG_rZo.js} +1 -1
  45. package/dist/evidence/index.d.ts +1 -1
  46. package/dist/evidence/index.d.ts.map +1 -1
  47. package/dist/evidence/record.d.ts.map +1 -1
  48. package/dist/evidence/store.d.ts +12 -0
  49. package/dist/evidence/store.d.ts.map +1 -1
  50. package/dist/{evidence-FRF9RN77.js → evidence-DopNnj0E.js} +120 -110
  51. package/dist/{flow-command-BrzzKBo9.js → flow-command-CrMEzCWz.js} +1 -1
  52. package/dist/index.js +6 -6
  53. package/dist/{modules-_FQTZ3gx.js → modules-CvBmrY7T.js} +2 -2
  54. package/dist/{plugins-Q1MtCIE5.js → plugins-C7jz-Y_w.js} +1 -1
  55. package/dist/quire/contract.d.ts +2 -2
  56. package/dist/quire/types.d.ts +11 -0
  57. package/dist/quire/types.d.ts.map +1 -1
  58. package/dist/{quire-Dis3ky5t.js → quire-VZjWaHph.js} +2 -2
  59. package/dist/schemas/coverage-v1.schema.json +23 -1
  60. package/dist/{version-D0l3nDPZ.js → version-DgWC58-h.js} +1 -1
  61. package/dist/{write-CMA6BDUq.js → write-68NgoaMy.js} +1 -1
  62. package/package.json +2 -2
  63. package/skills/spec-evidence-analysis/SKILL.md +51 -1
  64. package/skills/spec-fuzz/SKILL.md +30 -0
  65. package/dist/auditor-W2jFinr6.js +0 -188
  66. package/dist/combinatorial-Cq01XfhV.js +0 -80
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quoin",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "description": "Spec authoring, review, matrix, and planning skills for Agent IX.",
5
5
  "author": {
6
6
  "name": "Agent IX"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quoin",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "description": "Spec authoring, review, matrix, and planning skills for Agent IX.",
5
5
  "author": {
6
6
  "name": "Agent IX",
@@ -10,13 +10,13 @@ schemaVersion: 1
10
10
  name: quoin-default-modules
11
11
  entries:
12
12
  - name: spec-artifacts-iso
13
- version: "0.15.0"
13
+ version: "0.17.0"
14
14
  defaultEnabled: true
15
15
  source:
16
16
  type: git-subdir
17
17
  url: agent-ix/spec-artifacts-iso
18
18
  path: spec_artifacts_iso
19
- ref: v0.15.0
19
+ ref: v0.17.0
20
20
 
21
21
  - name: spec-artifacts-app
22
22
  version: "0.5.0"
@@ -28,13 +28,13 @@ entries:
28
28
  ref: v0.5.0
29
29
 
30
30
  - name: spec-artifacts-process
31
- version: "0.18.0"
31
+ version: "0.21.1"
32
32
  defaultEnabled: true
33
33
  source:
34
34
  type: git-subdir
35
35
  url: agent-ix/spec-artifacts-process
36
36
  path: spec_artifacts_process
37
- ref: v0.18.0
37
+ ref: v0.21.1
38
38
 
39
39
  - name: spec-objects-business
40
40
  version: "0.6.0"
@@ -11,6 +11,42 @@ export interface ObligationFacts {
11
11
  archetype?: string | null;
12
12
  /** Object types the spec declares near this requirement, if any. */
13
13
  objectTypes?: string[];
14
+ /**
15
+ * What the evidence store already knows about this obligation.
16
+ *
17
+ * Supplied by the caller, never read here: `advise` performs no I/O, so the
18
+ * command opens the store and hands the answer in — the same way
19
+ * `propertyShape` and `archetype` arrive. Absent means "not consulted", which
20
+ * is different from "consulted and empty" and must not mint anything.
21
+ */
22
+ evidence?: ObligationEvidence;
23
+ /**
24
+ * The obligation's declared criticality, verbatim (`P0`, `high`, …).
25
+ *
26
+ * Carried rather than interpreted. `mutation-testing` is keyed on
27
+ * `high-criticality`, and the engine does not get to decide which values
28
+ * count as high — CR-008 deleted a hardcoded `["P0"]` for exactly that
29
+ * reason. So the characteristic is minted when the value **says so itself**,
30
+ * which is reading it, not judging it.
31
+ */
32
+ criticality?: string | null;
33
+ }
34
+ /**
35
+ * What the evidence store records about one obligation.
36
+ *
37
+ * Only what the advisor needs to answer a single question: has anything
38
+ * measured that this obligation's tests would catch a fault?
39
+ */
40
+ export interface ObligationEvidence {
41
+ /** True when at least one binding names this obligation. */
42
+ bound: boolean;
43
+ /**
44
+ * Fault-detection scores from runs bound to it, tool-scoped by the catalog.
45
+ *
46
+ * Empty while `bound` is true is the interesting case, not an error: the
47
+ * obligation is exercised and nothing says the exercise discriminates.
48
+ */
49
+ faultDetectionScores: number[];
14
50
  }
15
51
  /** Why a method was recommended — the rule and the value that matched. */
16
52
  export interface MatchReason {
@@ -43,21 +79,28 @@ export interface Advice {
43
79
  */
44
80
  inconclusive: boolean;
45
81
  }
82
+ export declare function characteristicsOf(statement: string, criticality?: string | null, evidence?: ObligationEvidence): string[];
46
83
  /**
47
- * Characteristics readable from an obligation's statement.
84
+ * Every `characteristics` value any code path in quoin can produce.
85
+ *
86
+ * This exists so the **join** between the catalog and the fact set is
87
+ * checkable. The catalog declares the values that trigger a method; this is the
88
+ * set that can ever be produced to match them. Nothing compared the two, and
89
+ * the consequence was silent: `matchRules` skips an unknown *axis* by design
90
+ * (FR-054-CON-2 leaves the axis set open) but an unknown *value* on a known
91
+ * axis simply never matches, and `inconclusive` is already a legitimate
92
+ * outcome. A systematically under-advising advisor was indistinguishable from a
93
+ * quiet one.
48
94
  *
49
- * Mostly prose regexes, plus one **structural** signal: a statement that parses
50
- * as a declared configuration space (quire-rs FR-061) is a configuration matrix
51
- * by construction, whatever words it happens to contain.
95
+ * Measured when this was added: the installed catalog declared **60** values
96
+ * and 20 were producible, leaving **7 methods** — `integration-testing` and
97
+ * `mutation-testing` among them — that no statement could ever reach
98
+ * (agent-ix/quoin#128).
52
99
  *
53
- * The regex alone would miss it. A minted space reads
54
- * `2-way over features(default|python|wasm) target(linux|wasm32)` — no
55
- * "configuration", no "feature flag", no "combination of" — so the very
56
- * obligations that most need the combinatorial method would be the ones it was
57
- * never advised for. A structural test cannot false-positive on prose either,
58
- * which a widened regex would.
100
+ * Derived from the regex table rather than hand-listed, because a hand-listed
101
+ * copy is the failure mode this whole check exists to catch.
59
102
  */
60
- export declare function characteristicsOf(statement: string): string[];
103
+ export declare function mintableCharacteristics(): Set<string>;
61
104
  /**
62
105
  * Recommend methods for one obligation.
63
106
  *
@@ -1 +1 @@
1
- {"version":3,"file":"advise.d.ts","sourceRoot":"","sources":["../../src/advisor/advise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAGtE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAA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E,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAsPD,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,EAC3B,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,MAAM,EAAE,CA2CV;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,IAAI,GAAG,CAAC,MAAM,CAAC,CASrD;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAqD7E"}
@@ -6,5 +6,5 @@
6
6
  * happens.
7
7
  */
8
8
  export { loadMethodCatalog, methodClasses, type MethodCatalog, type VerificationMethod, } from './methods.js';
9
- export { advise, characteristicsOf, type Advice, type MatchReason, type ObligationFacts, type Recommendation, } from './advise.js';
9
+ export { advise, characteristicsOf, mintableCharacteristics, type Advice, type MatchReason, type ObligationEvidence, type ObligationFacts, type Recommendation, } from './advise.js';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/advisor/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/advisor/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC"}
@@ -1,4 +1,4 @@
1
- import { n as e, s as t } from "./base-BE20w0jY.js";
1
+ import { n as e, s as t } from "./base-DQg6yfbN.js";
2
2
  import { readFileSync as n } from "node:fs";
3
3
  import { join as r } from "node:path";
4
4
  import { parse as i } from "yaml";
@@ -60,6 +60,29 @@ export interface AuditReport {
60
60
  * the inputs, which is what makes the whole thing testable without a repository.
61
61
  */
62
62
  export declare function audit(input: AuditInput): AuditReport;
63
+ /**
64
+ * The tools one catalog method declares, lowercased — or `null` when the method
65
+ * is absent.
66
+ *
67
+ * Generalised from `mutationToolsIn` so the advisor can ask the same question
68
+ * without a second copy of the lookup (agent-ix/quoin#158). Declaration-driven
69
+ * either way: the method id is named at the call site and the tool names stay
70
+ * module data, so no tool is ever hardcoded here.
71
+ *
72
+ * `null` rather than an empty set is the load-bearing part. With no entry the
73
+ * question "did this kind of tool produce this number" cannot be asked at all,
74
+ * and a caller must say nothing rather than something wrong.
75
+ */
76
+ export declare function toolsFor(catalog: AuditInput["catalog"], methodId: string): Set<string> | null;
77
+ /**
78
+ * Fault-detection scores among the runs bound to this obligation.
79
+ *
80
+ * Exported for the advisor (agent-ix/quoin#158), which needs the same answer to
81
+ * decide whether anything has measured that the tests discriminate. One
82
+ * definition, so the auditor's finding and the advisor's recommendation cannot
83
+ * disagree about what a score is.
84
+ */
85
+ export declare function scoresFor(bindings: Binding[], runs: RunRecord[], catalog: AuditInput["catalog"]): number[];
63
86
  /** The baseline key for one finding. */
64
87
  export declare function findingKey(finding: Finding): string;
65
88
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/auditor/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,4DAA4D;AAC5D,MAAM,WAAW,OAAO;IACtB,IAAI,EACA,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,wCAAwC;IACxC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,0DAA0D;IAC1D,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,sEAAsE;IACtE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC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E,UAAU,CAAC,SAAS,CAAC,GAC7B,MAAM,EAAE,CAkBV;AAED,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAC/B,OAAO,EAAE,CAKX;AAED,0DAA0D;AAC1D,wBAAgB,KAAK,CACnB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,WAAW,GACjB;IAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAO3C"}
@@ -4,5 +4,5 @@
4
4
  * Reads the store and reports. Runs nothing (ADR-0011 invariant 1): an auditor
5
5
  * that could re-run a suite could also make a finding disappear by re-running it.
6
6
  */
7
- export { audit, delta, findingKey, ratchet, type AuditInput, type AuditReport, type Finding, type Severity, } from './audit.js';
7
+ export { audit, delta, findingKey, ratchet, scoresFor, toolsFor, type AuditInput, type AuditReport, type Finding, type Severity, } from './audit.js';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auditor/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,OAAO,EACP,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auditor/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC"}
@@ -0,0 +1,269 @@
1
+ import { _ as e } from "./evidence-DopNnj0E.js";
2
+ //#region src/auditor/combinatorial.ts
3
+ var t = /^(\d+)-way over\s/, n = /([^\s(]+)\(([^)]*)\)/g, r = /excluding\[([^\]]*)\]/g;
4
+ function i(e) {
5
+ let i = t.exec(e);
6
+ if (!i) return null;
7
+ let a = Number.parseInt(i[1], 10);
8
+ if (!Number.isFinite(a) || a < 1) return null;
9
+ let o = e.split("excluding[")[0], s = [];
10
+ for (let e of o.matchAll(n)) {
11
+ let t = e[2].split("|").map((e) => e.trim()).filter((e) => e !== "");
12
+ t.length < 2 || s.push({
13
+ name: e[1],
14
+ values: t
15
+ });
16
+ }
17
+ if (s.length < 2) return null;
18
+ let c = [];
19
+ for (let t of e.matchAll(r)) {
20
+ let e = t[1].split(",").map((e) => e.trim()).filter((e) => e !== "").map((e) => {
21
+ let t = e.indexOf("=");
22
+ return t === -1 ? null : [e.slice(0, t).trim(), e.slice(t + 1).trim()];
23
+ }).filter((e) => e !== null);
24
+ e.length >= 2 && c.push({ assignments: e });
25
+ }
26
+ return {
27
+ strength: a,
28
+ dimensions: s,
29
+ exclusions: c
30
+ };
31
+ }
32
+ function a(e, t) {
33
+ if (t > e || t < 1) return [];
34
+ let n = [], r = [], i = (a) => {
35
+ if (r.length === t) {
36
+ n.push([...r]);
37
+ return;
38
+ }
39
+ for (let t = a; t < e; t += 1) r.push(t), i(t + 1), r.pop();
40
+ };
41
+ return i(0), n;
42
+ }
43
+ function o(e) {
44
+ return [...e].sort((e, t) => e[0] < t[0] ? -1 : +(e[0] > t[0])).map(([e, t]) => `${e}=${t}`).join(" & ");
45
+ }
46
+ function s(e, t) {
47
+ return e.exclusions.some((e) => e.assignments.every(([e, n]) => t.some(([t, r]) => t === e && r === n)));
48
+ }
49
+ function c(e) {
50
+ let t = /* @__PURE__ */ new Set();
51
+ for (let n of a(e.dimensions.length, e.strength)) {
52
+ let r = (i, a) => {
53
+ if (i === n.length) {
54
+ s(e, a) || t.add(o(a));
55
+ return;
56
+ }
57
+ let c = e.dimensions[n[i]];
58
+ for (let e of c.values) a.push([c.name, e]), r(i + 1, a), a.pop();
59
+ };
60
+ r(0, []);
61
+ }
62
+ return t;
63
+ }
64
+ function l(e, t) {
65
+ let n = e.dimensions.filter((e) => t[e.name] !== void 0 && e.values.includes(t[e.name])), r = /* @__PURE__ */ new Set();
66
+ for (let i of a(n.length, e.strength)) r.add(o(i.map((e) => [n[e].name, t[n[e].name]])));
67
+ return r;
68
+ }
69
+ function u(e, t) {
70
+ let n = c(e), r = /* @__PURE__ */ new Set();
71
+ for (let i of t) for (let t of l(e, i)) n.has(t) && r.add(t);
72
+ let i = [...n].filter((e) => !r.has(e)).sort();
73
+ return {
74
+ strength: e.strength,
75
+ demanded: n.size,
76
+ covered: r.size,
77
+ gaps: i
78
+ };
79
+ }
80
+ //#endregion
81
+ //#region src/auditor/audit.ts
82
+ function d(t) {
83
+ let n = [], r = [], a = /* @__PURE__ */ new Map();
84
+ for (let e of t.bindings) {
85
+ let t = a.get(e.obligation) ?? [];
86
+ t.push(e), a.set(e.obligation, t);
87
+ }
88
+ let o = new Map(t.runs.map((e) => [e.suite, e])), s = new Map((t.scans ?? []).map((e) => [e.suite, e]));
89
+ for (let c of [...t.obligations].sort(p)) {
90
+ let l = (a.get(c.id) ?? []).slice().sort((e, t) => f(e.suite, t.suite));
91
+ if (l.length === 0) {
92
+ n.push({
93
+ kind: "undischarged",
94
+ obligation: c.id,
95
+ severity: "medium",
96
+ summary: `no evidence is bound to ${c.id}`
97
+ });
98
+ continue;
99
+ }
100
+ let d = l.filter((e) => e.statementHashAtBinding !== c.statement_hash);
101
+ if (d.length > 0) {
102
+ n.push({
103
+ kind: "suspect-link",
104
+ obligation: c.id,
105
+ severity: "high",
106
+ summary: `${c.id} was reworded after its evidence was bound in ${d.map((e) => e.suite).join(", ")} (bound against ${d[0].statementHashAtBinding.slice(0, 12)}…, now ${c.statement_hash.slice(0, 12)}…). Re-affirm or re-verify.`
107
+ });
108
+ continue;
109
+ }
110
+ let p = l.filter((e) => !o.has(e.suite) && !s.has(e.suite));
111
+ if (p.length > 0) {
112
+ n.push({
113
+ kind: "stale-evidence",
114
+ obligation: c.id,
115
+ severity: "high",
116
+ summary: `${c.id} is bound to ${p.map((e) => e.suite).join(", ")}, which ${p.length === 1 ? "has" : "have"} no recorded run. The binding claims evidence that is not in the store.`
117
+ });
118
+ continue;
119
+ }
120
+ let _ = l.map((e) => s.get(e.suite)).filter((e) => e !== void 0).filter((t) => e(t) === !0);
121
+ if (_.length > 0) {
122
+ n.push({
123
+ kind: "vacuous-evidence",
124
+ obligation: c.id,
125
+ severity: "high",
126
+ summary: `${c.id} rests on a scan that evaluated no rules: ` + _.map((e) => `${e.suite} (${e.tool})`).sort(f).join(", ") + ". It reported no finding because it looked for nothing."
127
+ });
128
+ continue;
129
+ }
130
+ let v = l.filter((e) => o.has(e.suite));
131
+ if (v.length === 0) continue;
132
+ let y = v.map((e) => o.get(e.suite));
133
+ if (t.headCommit) {
134
+ let e = l.filter((e, n) => y[n].commit !== t.headCommit);
135
+ e.length > 0 && n.push({
136
+ kind: "stale-evidence",
137
+ obligation: c.id,
138
+ severity: "medium",
139
+ summary: `${c.id} rests on ` + e.map((e) => `a ${e.suite} run at ${o.get(e.suite).commit.slice(0, 12)}`).join(" and ") + `, not at HEAD (${t.headCommit.slice(0, 12)}).`
140
+ });
141
+ }
142
+ let b = v.flatMap((e, t) => e.symbols.filter((e) => {
143
+ let n = y[t].entries.find((t) => t.symbol === e);
144
+ return !n || n.outcome === "skip";
145
+ }).map((t) => `${e.suite}:${t}`)), x = v.reduce((e, t) => e + t.symbols.length, 0);
146
+ if (b.length > 0 && b.length === x) {
147
+ n.push({
148
+ kind: "vacuous-evidence",
149
+ obligation: c.id,
150
+ severity: "high",
151
+ summary: `every symbol bound to ${c.id} was skipped or absent from its run: ${b.sort(f).join(", ")}. The row reads as covered and nothing was verified.`
152
+ });
153
+ continue;
154
+ }
155
+ let S = i(c.statement ?? "");
156
+ if (S) {
157
+ let e = u(S, y.flatMap((e) => e.entries.map((e) => e.config).filter((e) => !!e)));
158
+ if (e.covered < e.demanded) {
159
+ n.push({
160
+ kind: "combinatorial-gap",
161
+ obligation: c.id,
162
+ severity: "medium",
163
+ summary: `${c.id} demands ${e.demanded} ${e.strength}-way combinations and its runs reached ${e.covered}. Never run: ${e.gaps.slice(0, 10).join("; ")}` + (e.gaps.length > 10 ? ` (and ${e.gaps.length - 10} more)` : "")
164
+ });
165
+ continue;
166
+ }
167
+ }
168
+ let C = m(c, v, y, t.catalog);
169
+ if (C) {
170
+ n.push(C);
171
+ continue;
172
+ }
173
+ let w = h(c, l, t);
174
+ if (w) {
175
+ n.push(w);
176
+ continue;
177
+ }
178
+ let T = g(c, v, y, t);
179
+ if (T) {
180
+ n.push(T);
181
+ continue;
182
+ }
183
+ r.push(c.id);
184
+ }
185
+ return n.sort((e, t) => f(e.obligation, t.obligation) || f(e.kind, t.kind)), {
186
+ findings: n,
187
+ healthy: r.sort(f)
188
+ };
189
+ }
190
+ function f(e, t) {
191
+ return e === t ? 0 : e < t ? -1 : 1;
192
+ }
193
+ function p(e, t) {
194
+ return f(e.id, t.id);
195
+ }
196
+ function m(e, t, n, r) {
197
+ if (!r || !e.method) return null;
198
+ let i = e.method.trim().toLowerCase(), a = r.methods.filter((e) => e.id.toLowerCase() === i || e.class.toLowerCase() === i);
199
+ if (a.length === 0) return {
200
+ kind: "unknown-method",
201
+ obligation: e.id,
202
+ severity: "medium",
203
+ summary: `${e.id} declares \`${e.method}\`, which is neither a catalog method id nor a catalog class. Nothing can say what discharging it means, so no conformance check can run against it.`
204
+ };
205
+ let o = new Set(a.map((e) => e.evidenceKind).filter((e) => typeof e == "string" && e.length > 0));
206
+ if (o.size === 0) return null;
207
+ let s = t.filter((e, t) => {
208
+ let r = n[t].evidenceKind;
209
+ return typeof r == "string" && r.length > 0 && !o.has(r);
210
+ });
211
+ return s.length === 0 ? null : {
212
+ kind: "method-conformance",
213
+ obligation: e.id,
214
+ severity: "medium",
215
+ summary: `${e.id} declares \`${e.method}\`, whose evidence kind is ${[...o].sort(f).join("/")}, but is discharged by ` + s.map((e) => `a ${n[t.indexOf(e)].evidenceKind} run in ${e.suite}`).join(" and ") + ". A method is not discharged by evidence of another kind."
216
+ };
217
+ }
218
+ function h(e, t, n) {
219
+ let r = n.multiplicityRequires ?? [];
220
+ if (r.length === 0 || !e.criticality || !r.includes(e.criticality)) return null;
221
+ let i = new Set(t.map((e) => e.suite));
222
+ return i.size >= 2 ? null : {
223
+ kind: "insufficient-multiplicity",
224
+ obligation: e.id,
225
+ severity: "medium",
226
+ summary: `${e.id} is criticality ${e.criticality}, which requires two independent methods, but all its evidence comes from ${[...i].join(", ")}.`
227
+ };
228
+ }
229
+ function g(e, t, n, r) {
230
+ let i = r.mutationFloor ?? {};
231
+ if (!e.criticality) return null;
232
+ let a = i[e.criticality];
233
+ if (a === void 0 || !_(r.catalog)) return null;
234
+ let o = y(t, n, r.catalog);
235
+ if (o.length === 0) return {
236
+ kind: "unmeasured-mutation-score",
237
+ obligation: e.id,
238
+ severity: "medium",
239
+ summary: `${e.id} is criticality ${e.criticality}, which demands a mutation score of at least ${a}, and no run bound to it records one.`
240
+ };
241
+ let s = Math.min(...o);
242
+ return s >= a ? null : {
243
+ kind: "insufficient-mutation-score",
244
+ obligation: e.id,
245
+ severity: "medium",
246
+ summary: `${e.id} is criticality ${e.criticality}, which demands a mutation score of at least ${a}; its weakest bound symbol scores ${s}.`
247
+ };
248
+ }
249
+ function _(e) {
250
+ return v(e, "mutation-testing");
251
+ }
252
+ function v(e, t) {
253
+ let n = new Set((e?.methods ?? []).filter((e) => e.id === t).flatMap((e) => e.tooling).map((e) => e.toLowerCase()));
254
+ return n.size > 0 ? n : null;
255
+ }
256
+ function y(e, t, n) {
257
+ let r = new Set(e.map((e) => e.suite)), i = _(n) ?? /* @__PURE__ */ new Set(), a = [];
258
+ for (let e of t) if (r.has(e.suite) && [...i].some((t) => e.tool.toLowerCase().startsWith(t))) for (let t of e.entries) t.score !== void 0 && t.outcome !== "skip" && a.push(t.score);
259
+ return a;
260
+ }
261
+ function b(e) {
262
+ return `${e.kind}:${e.obligation}`;
263
+ }
264
+ function x(e, t) {
265
+ let n = new Set(t.accepted);
266
+ return e.findings.filter((e) => !n.has(b(e)));
267
+ }
268
+ //#endregion
269
+ export { i as a, y as i, b as n, x as r, d as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./version-D0l3nDPZ.js";
1
+ import { t as e } from "./version-DgWC58-h.js";
2
2
  import { BaseCommand as t, maybeOfferUpdate as n } from "@agent-ix/ix-cli-core";
3
3
  import { existsSync as r, readFileSync as i, readdirSync as a, statSync as o } from "node:fs";
4
4
  import { basename as s, join as c, resolve as l } from "node:path";
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./version-D0l3nDPZ.js";
1
+ import { n as e, t } from "./version-DgWC58-h.js";
2
2
  import { run as n } from "@agent-ix/ix-cli-core";
3
3
  //#region src/cli.ts
4
4
  function r(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"advise.d.ts","sourceRoot":"","sources":["../../src/commands/advise.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa1C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAY;IAC9C,MAAM,CAAC,OAAO,SAC6D;IAC3E,MAAM,CAAC,WAAW,SAY4D;IAE9E,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;MAaV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA4D1B,OAAO,CAAC,MAAM;CAqBf"}
1
+ {"version":3,"file":"advise.d.ts","sourceRoot":"","sources":["../../src/commands/advise.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqB1C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAY;IAC9C,MAAM,CAAC,OAAO,SAC6D;IAC3E,MAAM,CAAC,WAAW,SAY4D;IAE9E,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;MAaV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAyE1B,OAAO,CAAC,MAAM;CAqBf"}