@idlekit/core 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/scenario/compile.d.ts +2 -2
- package/dist/scenario/compile.js +19 -14
- package/dist/scenario/compile.js.map +1 -1
- package/dist/scenario/scenarioContract.d.ts +30 -0
- package/dist/scenario/scenarioContract.js +35 -0
- package/dist/scenario/scenarioContract.js.map +1 -1
- package/dist/sim/advance.d.ts +198 -0
- package/dist/sim/advance.js +609 -0
- package/dist/sim/advance.js.map +1 -0
- package/dist/sim/analysis/checks.d.ts +260 -0
- package/dist/sim/analysis/checks.js +1442 -0
- package/dist/sim/analysis/checks.js.map +1 -0
- package/dist/sim/analysis/contracts.js +4 -0
- package/dist/sim/analysis/contracts.js.map +1 -1
- package/dist/sim/analysis/flow.d.ts +169 -0
- package/dist/sim/analysis/flow.js +1359 -0
- package/dist/sim/analysis/flow.js.map +1 -0
- package/dist/sim/analysis/jevAdvisory.d.ts +113 -0
- package/dist/sim/analysis/jevAdvisory.js +846 -0
- package/dist/sim/analysis/jevAdvisory.js.map +1 -0
- package/dist/sim/analysis/judge.d.ts +145 -0
- package/dist/sim/analysis/judge.js +1451 -0
- package/dist/sim/analysis/judge.js.map +1 -0
- package/dist/sim/analysis/registry.d.ts +9 -6
- package/dist/sim/analysis/registry.js +15 -2
- package/dist/sim/analysis/registry.js.map +1 -1
- package/dist/sim/analysis/resetCycle.js +30 -6
- package/dist/sim/analysis/resetCycle.js.map +1 -1
- package/dist/sim/executionBackend.d.ts +165 -0
- package/dist/sim/executionBackend.js +521 -0
- package/dist/sim/executionBackend.js.map +1 -0
- package/dist/sim/integrationMatrix.d.ts +52 -0
- package/dist/sim/integrationMatrix.js +68 -0
- package/dist/sim/integrationMatrix.js.map +1 -0
- package/dist/sim/observation.d.ts +11 -0
- package/dist/sim/observation.js +12 -0
- package/dist/sim/observation.js.map +1 -1
- package/dist/sim/offline.d.ts +2 -0
- package/dist/sim/offline.js +68 -1
- package/dist/sim/offline.js.map +1 -1
- package/dist/sim/simulator.d.ts +2 -0
- package/dist/sim/simulator.js +71 -1
- package/dist/sim/simulator.js.map +1 -1
- package/dist/sim/step.d.ts +10 -0
- package/dist/sim/step.js +22 -8
- package/dist/sim/step.js.map +1 -1
- package/dist/sim/types.d.ts +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jevAdvisory.js","sourceRoot":"","sources":["../../../src/sim/analysis/jevAdvisory.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAE3D;;;GAGG;AAEH,MAAM,aAAa,GAAG,yDAAkE,CAAC;AACzF,MAAM,qBAAqB,GAAG,gBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAuCD;;;GAGG;AACH,IAAI,4BAA0F,CAAC;AAE/F;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAA8B,EAAE,CAChF,CAAC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA0C,CAAC,CAAC,KAAK,CAAC,CAAC;AAElF,SAAS,kBAAkB;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAiD;AACnD,CAAC;AAED,IAAI,iBAAoE,CAAC;AAEzE;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,iBAAiB,KAAK,kBAAkB,EAAE,CAAC;IAC3C,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import typia, { type IValidation } from "typia";
|
|
2
|
+
import { type AnalysisArtifactV1, type MetricReadingV1 } from "./contracts";
|
|
3
|
+
import { type BalanceCheckReportV1, type BalanceObservationV1, type CheckOperator, type CheckSeverity, type FailOnToken, type MissingPolicy } from "./checks";
|
|
4
|
+
/**
|
|
5
|
+
* Optional rules judge. It reads a finished analysis artifact and a versioned rubric.
|
|
6
|
+
* Numeric comparisons go through the balance-check engine. This module does not run a simulation,
|
|
7
|
+
* does not rewrite that engine's report, and does not call an external provider.
|
|
8
|
+
*/
|
|
9
|
+
declare const JUDGE_SCHEMA_ID: "https://idlekit.dev/schemas/judge.output.schema.json";
|
|
10
|
+
declare const JUDGE_ALGORITHM_VERSION: "judge-rules-1";
|
|
11
|
+
export declare function judgeSchemaId(): typeof JUDGE_SCHEMA_ID;
|
|
12
|
+
export declare function judgeAlgorithmVersion(): typeof JUDGE_ALGORITHM_VERSION;
|
|
13
|
+
export type RecommendationId = "rec.metric.within-threshold" | "rec.metric.outside-threshold" | "rec.metric.insufficient" | "rec.metric.estimate-not-measured" | "rec.metric.unsupported" | "rec.metric.identity-mismatch";
|
|
14
|
+
export type JudgeLayer = "rule" | "estimate" | "semantic";
|
|
15
|
+
export type DiagnosticStatus = "conflict" | "insufficient" | "unsupported" | "noted" | "indeterminate";
|
|
16
|
+
export type JudgeRuleV1 = Readonly<{
|
|
17
|
+
id: string;
|
|
18
|
+
metricId: string;
|
|
19
|
+
operator: CheckOperator;
|
|
20
|
+
threshold: number;
|
|
21
|
+
upperThreshold: number | null;
|
|
22
|
+
unit: string;
|
|
23
|
+
severity: CheckSeverity;
|
|
24
|
+
missingPolicy: MissingPolicy;
|
|
25
|
+
definition: string;
|
|
26
|
+
method: string;
|
|
27
|
+
scenarioVersion: string | null;
|
|
28
|
+
specVersion: string | null;
|
|
29
|
+
engineId: string | null;
|
|
30
|
+
pluginVersion: string | null;
|
|
31
|
+
seed: string | null;
|
|
32
|
+
algorithmVersion: string | null;
|
|
33
|
+
recommendationId: RecommendationId;
|
|
34
|
+
}>;
|
|
35
|
+
export type JudgeRubricV1 = Readonly<{
|
|
36
|
+
schemaVersion: 1;
|
|
37
|
+
contract: "idlekit.judge.rubric.v1";
|
|
38
|
+
rubricVersion: string;
|
|
39
|
+
failOn: readonly FailOnToken[];
|
|
40
|
+
rules: readonly JudgeRuleV1[];
|
|
41
|
+
}>;
|
|
42
|
+
export type JudgeDiagnosticV1 = Readonly<{
|
|
43
|
+
id: string;
|
|
44
|
+
category: JudgeLayer;
|
|
45
|
+
severity: "error" | "warn" | "info";
|
|
46
|
+
evidenceRefs: readonly string[];
|
|
47
|
+
assumptionRefs: readonly string[];
|
|
48
|
+
recommendationId: RecommendationId;
|
|
49
|
+
status: DiagnosticStatus;
|
|
50
|
+
text: Readonly<{
|
|
51
|
+
en: string;
|
|
52
|
+
ko: string;
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
export type EstimatedObservationV1 = Readonly<{
|
|
56
|
+
metricId: string;
|
|
57
|
+
value: number | null;
|
|
58
|
+
reason: string | null;
|
|
59
|
+
}>;
|
|
60
|
+
export type JudgeReportV1 = Readonly<{
|
|
61
|
+
schemaVersion: 1;
|
|
62
|
+
contract: "idlekit.judge.v1";
|
|
63
|
+
algorithmVersion: typeof JUDGE_ALGORITHM_VERSION;
|
|
64
|
+
provider: "rules";
|
|
65
|
+
rubricVersion: string;
|
|
66
|
+
advisoryDigest: string;
|
|
67
|
+
numerical: BalanceCheckReportV1;
|
|
68
|
+
estimatedObservations: readonly EstimatedObservationV1[];
|
|
69
|
+
diagnostics: readonly JudgeDiagnosticV1[];
|
|
70
|
+
externalProvider: false;
|
|
71
|
+
baselineRewrite: false;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider The provider is rules. The output contract does not carry a vendor response.
|
|
75
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider #bb58b8a Re-read the section: provider is rules and externalProvider is false.
|
|
76
|
+
*/
|
|
77
|
+
export declare const judgeRulesProvider: "rules-not-vendor";
|
|
78
|
+
/**
|
|
79
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-check-reuse A numeric threshold is decided by the balance-check engine.
|
|
80
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-check-reuse #33488b3 Re-read the section: the judge does not recompute the metric.
|
|
81
|
+
*/
|
|
82
|
+
export declare const judgeCheckReuse: "checks-not-recomputed";
|
|
83
|
+
/**
|
|
84
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-evidence-refs A rubric ref must name a metric that exists on the artifact.
|
|
85
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-evidence-refs #a078dea Re-read the section: a bad version or a missing ref is rejected.
|
|
86
|
+
*/
|
|
87
|
+
export declare const judgeEvidenceRefs: "existing-refs-only";
|
|
88
|
+
/**
|
|
89
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-separated-report Numerical results, estimates, and semantic notes stay in separate fields.
|
|
90
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-separated-report #0fb3aa6 Re-read the section: a conflict does not rewrite the numerical verdict.
|
|
91
|
+
*/
|
|
92
|
+
export declare const judgeSeparatedReport: "layers-stay-apart";
|
|
93
|
+
/**
|
|
94
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-insufficient Missing information stays insufficient.
|
|
95
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-insufficient #ed2626d Re-read the section: the report does not assign a health label.
|
|
96
|
+
*/
|
|
97
|
+
export declare const judgeInsufficient: "not-a-health-label";
|
|
98
|
+
/**
|
|
99
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider The published validator is createValidate of the judge report.
|
|
100
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider #bb58b8a Re-read the section: the structural document is JudgeReportV1.
|
|
101
|
+
*/
|
|
102
|
+
export declare const validateJudgeReport: (input: unknown) => IValidation<JudgeReportV1>;
|
|
103
|
+
declare function buildJudgeJsonSchema(): typia.IJsonSchemaUnit.IV3_1<Readonly<{
|
|
104
|
+
schemaVersion: 1;
|
|
105
|
+
contract: "idlekit.judge.v1";
|
|
106
|
+
algorithmVersion: typeof JUDGE_ALGORITHM_VERSION;
|
|
107
|
+
provider: "rules";
|
|
108
|
+
rubricVersion: string;
|
|
109
|
+
advisoryDigest: string;
|
|
110
|
+
numerical: BalanceCheckReportV1;
|
|
111
|
+
estimatedObservations: readonly EstimatedObservationV1[];
|
|
112
|
+
diagnostics: readonly JudgeDiagnosticV1[];
|
|
113
|
+
externalProvider: false;
|
|
114
|
+
baselineRewrite: false;
|
|
115
|
+
}>>;
|
|
116
|
+
/**
|
|
117
|
+
* @evidence docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider The structural schema is OpenAPI 3.1 from typia.
|
|
118
|
+
* @evidenceReview docs/requirements/active/optional-analysis-judge.md#req-pr18-rules-provider #bb58b8a Re-read the section: schema version is 3.1 and the contract id is idlekit.judge.v1.
|
|
119
|
+
*/
|
|
120
|
+
export declare function judgeJsonSchema(): ReturnType<typeof buildJudgeJsonSchema>;
|
|
121
|
+
export declare function parseJudgeRubric(input: unknown): {
|
|
122
|
+
ok: true;
|
|
123
|
+
rubric: JudgeRubricV1;
|
|
124
|
+
} | {
|
|
125
|
+
ok: false;
|
|
126
|
+
issues: readonly string[];
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* readMetric records a method only on an estimate, so observed and unavailable readings carry none.
|
|
130
|
+
* A numeric reading records a domain but no unit, and an unavailable amount carries no unit either.
|
|
131
|
+
* A field the reading does not record cannot disagree with the rule, so the rule's value stands in;
|
|
132
|
+
* a field the reading records (a method, an amount unit) is compared as is.
|
|
133
|
+
*/
|
|
134
|
+
export declare function toObservation(artifact: AnalysisArtifactV1, reading: MetricReadingV1, rule: JudgeRuleV1): {
|
|
135
|
+
observation: BalanceObservationV1;
|
|
136
|
+
estimated: EstimatedObservationV1 | null;
|
|
137
|
+
};
|
|
138
|
+
export declare function judgeArtifact(artifact: AnalysisArtifactV1, rubric: JudgeRubricV1): {
|
|
139
|
+
ok: true;
|
|
140
|
+
report: JudgeReportV1;
|
|
141
|
+
} | {
|
|
142
|
+
ok: false;
|
|
143
|
+
issues: readonly string[];
|
|
144
|
+
};
|
|
145
|
+
export {};
|