@tangle-network/agent-eval 1.0.13 → 1.0.15
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/CHANGELOG.md +10 -0
- package/dist/analyst/index.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/contract/index.js +1 -1
- package/dist/{default-registry-eCkZFfuF.js → default-registry-BB9_jzyH.js} +2 -2
- package/dist/{default-registry-eCkZFfuF.js.map → default-registry-BB9_jzyH.js.map} +1 -1
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +19 -13
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{exporters-ByLcILYU.js → exporters-BKZLt1Px.js} +2 -2
- package/dist/{exporters-ByLcILYU.js.map → exporters-BKZLt1Px.js.map} +1 -1
- package/dist/{hf-dataset-DPVQXW5n.js → hf-dataset-Bv114tzB.js} +11 -11
- package/dist/{hf-dataset-DPVQXW5n.js.map → hf-dataset-Bv114tzB.js.map} +1 -1
- package/dist/index-f09MX_H_.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/{integrity-Vx5xgn3s.js → integrity-BHM4voOx.js} +3 -3
- package/dist/{integrity-Vx5xgn3s.js.map → integrity-BHM4voOx.js.map} +1 -1
- package/dist/{mint-BH_3Ak2x.js → mint-yF51iBgY.js} +2 -2
- package/dist/{mint-BH_3Ak2x.js.map → mint-yF51iBgY.js.map} +1 -1
- package/dist/multishot/golden/index.d.ts.map +1 -1
- package/dist/multishot/golden/index.js +3 -5
- package/dist/multishot/golden/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{render-BVPfP7dc.js → render-CsHLoMUl.js} +70 -47
- package/dist/render-CsHLoMUl.js.map +1 -0
- package/dist/rl.js +3 -3
- package/dist/rollout/index.js +5 -5
- package/dist/{rollout-CbOGxuHl.js → rollout-Cu7kHGIe.js} +5 -5
- package/dist/{rollout-CbOGxuHl.js.map → rollout-Cu7kHGIe.js.map} +1 -1
- package/dist/{rollout-nodes-DKZ3vAYY.js → rollout-nodes-DhSPJ2X7.js} +4 -4
- package/dist/rollout-nodes-DhSPJ2X7.js.map +1 -0
- package/dist/{schema-YUIXT8iW.js → schema-ChIZfnqY.js} +37 -5
- package/dist/schema-ChIZfnqY.js.map +1 -0
- package/dist/supervisor-run/index.d.ts +1 -0
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +3 -3
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +2 -5
- package/dist/trace-repair/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/render-BVPfP7dc.js.map +0 -1
- package/dist/rollout-nodes-DKZ3vAYY.js.map +0 -1
- package/dist/schema-YUIXT8iW.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/diagnosis/findings.ts","../../src/diagnosis/first-failure.ts","../../src/diagnosis/deterministic.ts","../../src/diagnosis/model-pass.ts","../../src/diagnosis/engine.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/diagnosis/findings.ts","../../src/diagnosis/first-failure.ts","../../src/diagnosis/deterministic.ts","../../src/diagnosis/model-pass.ts","../../src/diagnosis/engine.ts"],"mappings":";;;;;;;;;;;;;;KAaY;;KAGA;UAEK;EACf;EACA;EACA;;EAEA;;UAGe;EACf;EACA,UAAU;EACV;EACA;EACA,UAAU;;EAEV;EACA;EACA,YAAY;EACZ;;UAGe;EACf;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA,QAAQ;EACR;;UAGe;EACf;EACA;IACE;IACA;IACA;IACA;;EAEF;IACE,cAAc,eAAe;IAC7B,SAAS;IACT,YAAY;;EAEd,UAAU;;KClBA;UAEK;EACf;EACA;EACA,OAAO;EACP;EACA;EACA,MAAM;;EAEN;;EAEA,gBAAgB;EAChB,OAAO;;EAEP;EACA;;UAGe;EACf;EACA;EACA,OAAO;;EAEP;EACA;EACA;;UAGe;EACf;EACA;EACA;;;;;;;UAQe;EACf;EACA;;EAEA;EACA;;KAGU,eACR,oBACA,wBACA,mBACA;;wBAGY,iBAAiB,gBAAgB,kBAAkB;UCjClD;EACf;EACA;EACA,aAAa;EACb;EACA;EACA;;EAEA,eAAe;;EAEf,WAAW;EACX;;UAGe;EACf,YAAY;EACZ,cAAc,eAAe;EAC7B,SAAS;EACT,OAAO;EACP,UAAU;EACV;;UCpEe;;EAEf,WAAW;;EAEX;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAY;IAA4B;;;UAGzB;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;IAAa;IAAiB;IAAkB;;EAChD,OAAO;EACP;;UC/Be;;EAEf;;EAEA;;EAEA;;;;;EAKA;;EAEA;;EAEA;IAAa,MAAM;MAAQ;QAAe;MAA6B;;KAG7D;EACN;EAAuB;EAAiB,SAAS;;EACjD;EAAe,OAAO;EAAuB,SAAS;;UAE3C;EACf;EACA;EACA;EACA;;UAGe;;EAEf,UAAU;;EAEV,WAAW;;EAEX,OAAO;;EAEP,WAAW;IAAQ;IAAiB;;EACpC,OAAO;EACP,aAAa;EACb,QAAQ;;EAER,UAAU;EACV;IACE;IACA;IACA,MAAM;IACN;IACA,OAAO;;EAET;IAAU;IAA8B;;;wBAOpB,cACpB,2BACA,SAAS,kBACT,SAAS,mBACR,QAAQ"}
|
package/dist/diagnosis/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as summarizeExecution } from "../analyze-runs-C7vWBDhl.js";
|
|
2
2
|
import { a as emptyRedactionReport, c as redactText, o as redact } from "../redact-zp_ILC4l.js";
|
|
3
|
+
import { n as isRecord } from "../json-DtvZNAU9.js";
|
|
3
4
|
import { t as packageVersion } from "../package-version-CJl_pY9W.js";
|
|
4
5
|
import { r as classifyFailureReason } from "../failure-taxonomy-9eQfXKoW.js";
|
|
5
6
|
import { c as runPrimeExchange, n as buildPrimePrompt, o as primeProtocolSha256 } from "../prime-protocol-CrhpXRz9.js";
|
|
@@ -578,6 +579,14 @@ function round(value) {
|
|
|
578
579
|
return Math.round(value * 10) / 10;
|
|
579
580
|
}
|
|
580
581
|
// src/diagnosis/findings.ts
|
|
582
|
+
/**
|
|
583
|
+
* The diagnosis findings document: what the engine returns and what the
|
|
584
|
+
* diagnosis report renders. It mirrors the kit's JSON Schema
|
|
585
|
+
* (`https://tangle.tools/schemas/diagnosis-findings-v1.json`, owned by the
|
|
586
|
+
* traces repository's diagnosis kit) field for field, including its closed
|
|
587
|
+
* objects, so a document that passes {@link validateDiagnosisFindings} passes
|
|
588
|
+
* that schema.
|
|
589
|
+
*/
|
|
581
590
|
const SEVERITIES$1 = /* @__PURE__ */ new Set([
|
|
582
591
|
"critical",
|
|
583
592
|
"high",
|
|
@@ -598,7 +607,7 @@ const SEVERITY_RANK = {
|
|
|
598
607
|
*/
|
|
599
608
|
function validateDiagnosisFindings(document, options = {}) {
|
|
600
609
|
const errors = [];
|
|
601
|
-
if (!
|
|
610
|
+
if (!isRecord(document)) return ["document is not an object"];
|
|
602
611
|
closed(document, [
|
|
603
612
|
"schemaVersion",
|
|
604
613
|
"subject",
|
|
@@ -607,7 +616,7 @@ function validateDiagnosisFindings(document, options = {}) {
|
|
|
607
616
|
], "", errors);
|
|
608
617
|
if (document.schemaVersion !== 1) errors.push("schemaVersion must be 1");
|
|
609
618
|
const subject = document.subject;
|
|
610
|
-
if (!
|
|
619
|
+
if (!isRecord(subject)) errors.push("subject must be an object");
|
|
611
620
|
else {
|
|
612
621
|
closed(subject, [
|
|
613
622
|
"label",
|
|
@@ -621,26 +630,26 @@ function validateDiagnosisFindings(document, options = {}) {
|
|
|
621
630
|
if (subject.contentIncluded !== void 0 && typeof subject.contentIncluded !== "boolean") errors.push("subject.contentIncluded must be a boolean");
|
|
622
631
|
}
|
|
623
632
|
const coverage = document.coverage;
|
|
624
|
-
if (!
|
|
633
|
+
if (!isRecord(coverage)) errors.push("coverage must be an object");
|
|
625
634
|
else {
|
|
626
635
|
closed(coverage, [
|
|
627
636
|
"capabilities",
|
|
628
637
|
"skipped",
|
|
629
638
|
"redaction"
|
|
630
639
|
], "coverage", errors);
|
|
631
|
-
if (!
|
|
632
|
-
else for (const [name, capability] of Object.entries(coverage.capabilities)) if (!
|
|
640
|
+
if (!isRecord(coverage.capabilities)) errors.push("coverage.capabilities must be an object");
|
|
641
|
+
else for (const [name, capability] of Object.entries(coverage.capabilities)) if (!isRecord(capability) || typeof capability.available !== "boolean") errors.push(`coverage.capabilities.${name}.available must be a boolean`);
|
|
633
642
|
else if (!capability.available && !(typeof capability.reason === "string" && capability.reason)) errors.push(`coverage.capabilities.${name} is unavailable without a reason`);
|
|
634
643
|
if (!Array.isArray(coverage.skipped)) errors.push("coverage.skipped must be an array");
|
|
635
644
|
else coverage.skipped.forEach((entry, index) => {
|
|
636
|
-
if (!
|
|
645
|
+
if (!isRecord(entry) || typeof entry.analysis !== "string" || typeof entry.reason !== "string") errors.push(`coverage.skipped[${index}] needs analysis and reason strings`);
|
|
637
646
|
});
|
|
638
647
|
if (coverage.redaction !== void 0) {
|
|
639
648
|
const redaction = coverage.redaction;
|
|
640
|
-
if (!
|
|
649
|
+
if (!isRecord(redaction)) errors.push("coverage.redaction must be an object");
|
|
641
650
|
else {
|
|
642
651
|
if (!Number.isInteger(redaction.redactionCount) || redaction.redactionCount < 0) errors.push("coverage.redaction.redactionCount must be a non-negative integer");
|
|
643
|
-
if (redaction.byRule !== void 0 && !
|
|
652
|
+
if (redaction.byRule !== void 0 && !isRecord(redaction.byRule)) errors.push("coverage.redaction.byRule must be an object");
|
|
644
653
|
if (redaction.droppedAttributes !== void 0 && !Array.isArray(redaction.droppedAttributes)) errors.push("coverage.redaction.droppedAttributes must be an array");
|
|
645
654
|
}
|
|
646
655
|
}
|
|
@@ -648,7 +657,7 @@ function validateDiagnosisFindings(document, options = {}) {
|
|
|
648
657
|
if (!Array.isArray(document.findings)) errors.push("findings must be an array");
|
|
649
658
|
else document.findings.forEach((finding, index) => {
|
|
650
659
|
const at = `findings[${index}]`;
|
|
651
|
-
if (!
|
|
660
|
+
if (!isRecord(finding)) {
|
|
652
661
|
errors.push(`${at} must be an object`);
|
|
653
662
|
return;
|
|
654
663
|
}
|
|
@@ -675,7 +684,7 @@ function validateDiagnosisFindings(document, options = {}) {
|
|
|
675
684
|
else if (options.spanIds && !options.spanIds.has(id)) errors.push(`${at}.evidence ${id} does not resolve`);
|
|
676
685
|
if (finding.measure !== void 0) {
|
|
677
686
|
const measure = finding.measure;
|
|
678
|
-
if (!
|
|
687
|
+
if (!isRecord(measure) || typeof measure.name !== "string" || typeof measure.value !== "number" || !Number.isFinite(measure.value) || typeof measure.unit !== "string") errors.push(`${at}.measure needs name, finite value and unit`);
|
|
679
688
|
else if (!(typeof measure.denominator === "string" && measure.denominator)) errors.push(`${at}.measure has no denominator`);
|
|
680
689
|
}
|
|
681
690
|
for (const key of ["reproduce", "recommendation"]) if (finding[key] !== void 0 && typeof finding[key] !== "string") errors.push(`${at}.${key} must be a string`);
|
|
@@ -685,9 +694,6 @@ function validateDiagnosisFindings(document, options = {}) {
|
|
|
685
694
|
function closed(value, allowed, at, errors) {
|
|
686
695
|
for (const key of Object.keys(value)) if (!allowed.includes(key)) errors.push(`${at ? `${at}.` : ""}${key} is not allowed`);
|
|
687
696
|
}
|
|
688
|
-
function isObject(value) {
|
|
689
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
690
|
-
}
|
|
691
697
|
// src/diagnosis/model-pass.ts
|
|
692
698
|
const MAX_ROWS = 12;
|
|
693
699
|
const MAX_STRING = 400;
|