@gate-forge/core 0.10.4 → 0.11.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/dist/classifier/bind.d.ts +2 -2
- package/dist/classifier/bind.d.ts.map +1 -1
- package/dist/classifier/classify.d.ts +2 -2
- package/dist/classifier/classify.d.ts.map +1 -1
- package/dist/classifier/classify.js.map +1 -1
- package/dist/config/index.d.ts +286 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +109 -0
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +51 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -6
- package/dist/index.js.map +1 -1
- package/dist/policy/business-rules.d.ts +143 -0
- package/dist/policy/business-rules.d.ts.map +1 -0
- package/dist/policy/business-rules.js +314 -0
- package/dist/policy/business-rules.js.map +1 -0
- package/dist/policy/evaluate.d.ts +8 -0
- package/dist/policy/evaluate.d.ts.map +1 -1
- package/dist/policy/index.d.ts +1 -0
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/index.js +1 -0
- package/dist/policy/index.js.map +1 -1
- package/dist/schemas/business-rules.d.ts +215 -0
- package/dist/schemas/business-rules.d.ts.map +1 -0
- package/dist/schemas/business-rules.js +227 -0
- package/dist/schemas/business-rules.js.map +1 -0
- package/dist/schemas/classification-policy.d.ts +74 -11
- package/dist/schemas/classification-policy.d.ts.map +1 -1
- package/dist/schemas/classification-policy.js +62 -28
- package/dist/schemas/classification-policy.js.map +1 -1
- package/dist/schemas/scan-config.d.ts +94 -0
- package/dist/schemas/scan-config.d.ts.map +1 -0
- package/dist/schemas/scan-config.js +101 -0
- package/dist/schemas/scan-config.js.map +1 -0
- package/dist/schemas/test-catalog.d.ts +12 -12
- package/dist/schemas/test-map.d.ts +4 -4
- package/dist/schemas/verdict.d.ts +4 -0
- package/dist/schemas/verdict.d.ts.map +1 -1
- package/dist/schemas/verdict.js +13 -0
- package/dist/schemas/verdict.js.map +1 -1
- package/dist/testing/gate-runner.d.ts +2 -2
- package/dist/testing/gate-runner.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { type BusinessRule, type BusinessRuleCaseStatus, type BusinessRuleTestType, type BusinessRuleTypeRow } from '../schemas/business-rules.js';
|
|
2
|
+
import { type CauseCode } from '../schemas/verdict.js';
|
|
3
|
+
import type { EvidenceRecord } from '../schemas/evidence.js';
|
|
4
|
+
/** One bound test, as the resolver produced it (a DECLARATION, not proof). */
|
|
5
|
+
export interface BusinessRuleBinding {
|
|
6
|
+
/** Stable catalog logical key the declaration resolves to. */
|
|
7
|
+
logicalKey: string;
|
|
8
|
+
/** Declaration origin; only `native`/`sidecar` grade. */
|
|
9
|
+
origin: 'native' | 'sidecar' | 'inferred' | 'prior-run';
|
|
10
|
+
/** Declared kind, when the declaration named one. */
|
|
11
|
+
declaredKind: string | null;
|
|
12
|
+
/** Runner the bound instances execute under. */
|
|
13
|
+
runner: string;
|
|
14
|
+
/** True when discovery observed the spec mocking the system under test. */
|
|
15
|
+
mocked: boolean;
|
|
16
|
+
/** The sidecar declaration's review reason, when present. */
|
|
17
|
+
reason: string | null;
|
|
18
|
+
/** The test's source file (repo-relative), for starter-test rendering. */
|
|
19
|
+
file: string;
|
|
20
|
+
}
|
|
21
|
+
/** One test's SEALED facts of the run being graded. */
|
|
22
|
+
export interface BusinessRuleTestFact {
|
|
23
|
+
/** Catalog logical key. */
|
|
24
|
+
logicalKey: string;
|
|
25
|
+
/** Runner the sealed run executed it under. */
|
|
26
|
+
runner: string;
|
|
27
|
+
/** Outcome the supervision observed (never the reporter's own summary). */
|
|
28
|
+
status: 'passed' | 'failed' | 'skipped' | 'fixme' | 'not-run';
|
|
29
|
+
/**
|
|
30
|
+
* Whether the sealed run's GRADED SLICE selected this test. False on a
|
|
31
|
+
* `--scope changed` run that did not select it: the case is reported as
|
|
32
|
+
* `unproven (outside this run's graded slice)`, never silently absent
|
|
33
|
+
* and never satisfied by a receipt that never covered it.
|
|
34
|
+
*/
|
|
35
|
+
inGradedSlice: boolean;
|
|
36
|
+
/** Witness session ids the sealed run attributed to this test. */
|
|
37
|
+
sessionIds: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The sealed facts one run makes available to the evaluator. `null`
|
|
41
|
+
* (no sealed run) is the honest static-`check` input: everything mapped
|
|
42
|
+
* is `unproven` until a run exists.
|
|
43
|
+
*/
|
|
44
|
+
export interface BusinessRuleRunFacts {
|
|
45
|
+
/** The receipt's evaluation scope. */
|
|
46
|
+
scope: 'full' | 'changed';
|
|
47
|
+
/** True for the engine-owned docs-only slice (zero records by construction). */
|
|
48
|
+
docsOnly: boolean;
|
|
49
|
+
/** Per-test sealed facts keyed by catalog logicalKey. */
|
|
50
|
+
tests: ReadonlyMap<string, BusinessRuleTestFact>;
|
|
51
|
+
/** The sealed run's witness evidence records. */
|
|
52
|
+
records: readonly EvidenceRecord[];
|
|
53
|
+
/** Runners whose suite the owner declared WITNESSED for this run. */
|
|
54
|
+
witnessedRunners: ReadonlySet<string>;
|
|
55
|
+
}
|
|
56
|
+
/** Configuration error: a rule names a subject the inventory cannot see. */
|
|
57
|
+
export interface BusinessRuleConfigError {
|
|
58
|
+
/** Always `BUSINESS_RULE_SUBJECT_UNKNOWN`. */
|
|
59
|
+
code: 'BUSINESS_RULE_SUBJECT_UNKNOWN';
|
|
60
|
+
/** The rule the error is scoped to. */
|
|
61
|
+
ruleId: string;
|
|
62
|
+
/** The unknown subject name. */
|
|
63
|
+
subject: string;
|
|
64
|
+
/** Single-cause explanation; callers turn this into exit 2. */
|
|
65
|
+
detail: string;
|
|
66
|
+
}
|
|
67
|
+
/** One typed rule finding (blocking or advisory, decided by the caller). */
|
|
68
|
+
export interface BusinessRuleFinding {
|
|
69
|
+
/** Stable finding code; equal to `cause`. */
|
|
70
|
+
code: CauseCode;
|
|
71
|
+
/** The report cause code. */
|
|
72
|
+
cause: CauseCode;
|
|
73
|
+
/** Owning rule id. */
|
|
74
|
+
ruleId: string;
|
|
75
|
+
/** Owning case id. */
|
|
76
|
+
caseId: string;
|
|
77
|
+
/** The claim id the case is mapped by. */
|
|
78
|
+
claimId: string;
|
|
79
|
+
/** Single-cause explanation naming the rule, the case and the gap. */
|
|
80
|
+
detail: string;
|
|
81
|
+
/** The shared next action for this cause. */
|
|
82
|
+
nextAction: string;
|
|
83
|
+
/** The mapped test keys the finding is about (sorted, possibly empty). */
|
|
84
|
+
tests: readonly string[];
|
|
85
|
+
}
|
|
86
|
+
/** One graded rule case. */
|
|
87
|
+
export interface BusinessRuleCaseResult {
|
|
88
|
+
/** Owning rule id. */
|
|
89
|
+
ruleId: string;
|
|
90
|
+
/** Owning case id. */
|
|
91
|
+
caseId: string;
|
|
92
|
+
/** The claim id this case is mapped by. */
|
|
93
|
+
claimId: string;
|
|
94
|
+
/** The graded status. */
|
|
95
|
+
status: BusinessRuleCaseStatus;
|
|
96
|
+
/** The proof channel when satisfied (e.g. `observe`), else null. */
|
|
97
|
+
channel: string | null;
|
|
98
|
+
/** Sorted logical keys of the gradeable mapped tests. */
|
|
99
|
+
mappedTests: readonly string[];
|
|
100
|
+
/** The typed finding when the case is not satisfied; null when satisfied. */
|
|
101
|
+
finding: BusinessRuleFinding | null;
|
|
102
|
+
}
|
|
103
|
+
/** The complete evaluator result. */
|
|
104
|
+
export interface BusinessRuleEvaluation {
|
|
105
|
+
configErrors: BusinessRuleConfigError[];
|
|
106
|
+
/** Every case of every rule, sorted by rule id then case id. */
|
|
107
|
+
cases: BusinessRuleCaseResult[];
|
|
108
|
+
}
|
|
109
|
+
/** Inputs of {@link evaluateBusinessRules}. */
|
|
110
|
+
export interface EvaluateBusinessRulesInput {
|
|
111
|
+
/** The owner rules, already validated. */
|
|
112
|
+
rules: readonly BusinessRule[];
|
|
113
|
+
/** Resolved rule bindings keyed by claim id. */
|
|
114
|
+
bindings: ReadonlyMap<string, readonly BusinessRuleBinding[]>;
|
|
115
|
+
/** The resource names this run discovered (validates `subject`). */
|
|
116
|
+
inventory: readonly string[];
|
|
117
|
+
/** The sealed run's facts, or null when no sealed run exists. */
|
|
118
|
+
runFacts: BusinessRuleRunFacts | null;
|
|
119
|
+
/** Type table override (tests); defaults to the shipped table. */
|
|
120
|
+
typeTable?: Readonly<Record<BusinessRuleTestType, BusinessRuleTypeRow>>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Grades every case of every rule. A rule with no `subject` is graded
|
|
124
|
+
* regardless of the inventory; a rule naming a subject the inventory
|
|
125
|
+
* cannot see is a CONFIGURATION ERROR (the caller exits 2) because a name
|
|
126
|
+
* the inventory cannot see is silently uncheckable.
|
|
127
|
+
*
|
|
128
|
+
* Args:
|
|
129
|
+
* input: rules, resolved bindings, the run's resource inventory, and the
|
|
130
|
+
* sealed run's facts (`null` when no sealed run exists).
|
|
131
|
+
*
|
|
132
|
+
* Returns:
|
|
133
|
+
* BusinessRuleEvaluation: config errors plus every case, sorted by rule
|
|
134
|
+
* id then case id.
|
|
135
|
+
*/
|
|
136
|
+
export declare function evaluateBusinessRules(input: EvaluateBusinessRulesInput): BusinessRuleEvaluation;
|
|
137
|
+
/** Whether a case result is one of the four findings the gate reports. */
|
|
138
|
+
export declare function isBusinessRuleFinding(result: BusinessRuleCaseResult): result is BusinessRuleCaseResult & {
|
|
139
|
+
finding: BusinessRuleFinding;
|
|
140
|
+
};
|
|
141
|
+
/** Worst status among a rule's cases (`satisfied` when it has none). */
|
|
142
|
+
export declare function worstBusinessRuleStatus(results: readonly BusinessRuleCaseResult[]): BusinessRuleCaseStatus;
|
|
143
|
+
//# sourceMappingURL=business-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business-rules.d.ts","sourceRoot":"","sources":["../../src/policy/business-rules.ts"],"names":[],"mappings":"AAmCA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB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MAAM,WAAW,0BAA0B;IACzC,0CAA0C;IAC1C,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC,CAAC;IAC9D,oEAAoE;IACpE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,kEAAkE;IAClE,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC,CAAC;CACzE;AA4PD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,sBAAsB,CA8B/F;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,sBAAsB,GAAG;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAErE;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,CAM1G"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-declared BUSINESS RULES evaluator (plan 2026-10-05 §4/D4).
|
|
3
|
+
*
|
|
4
|
+
* Pure and deterministic, exactly like the closed-world coverage
|
|
5
|
+
* evaluator it is modelled on: given the owner rules, the type table,
|
|
6
|
+
* the resolver's rule bindings, the derived test catalog and (optionally)
|
|
7
|
+
* the SEALED facts of one run, it returns one status per rule case plus
|
|
8
|
+
* typed findings. It never reads a file, never reads an environment
|
|
9
|
+
* variable and never mutates its inputs.
|
|
10
|
+
*
|
|
11
|
+
* The four statuses, and the honesty each one carries:
|
|
12
|
+
*
|
|
13
|
+
* | status | meaning |
|
|
14
|
+
* |--------------|------------------------------------------------------------------|
|
|
15
|
+
* | `unmapped` | no gradeable binding of an accepted kind exists |
|
|
16
|
+
* | `wrong-type` | bindings exist, but none of an accepted kind/runner |
|
|
17
|
+
* | `unproven` | mapped, but no sealed run / not executed / outside the graded |
|
|
18
|
+
* | | slice / missing the type's proof |
|
|
19
|
+
* | `failing` | a mapped test of an accepted kind failed |
|
|
20
|
+
* | `satisfied` | EVERY mapped test of an accepted kind passed with the type's |
|
|
21
|
+
* | | proof; the report names the channel (`satisfied (observe)`) |
|
|
22
|
+
*
|
|
23
|
+
* Invariants this function is built to hold:
|
|
24
|
+
* - a DECLARATION is never proof — a mapping alone is at best `unmapped`
|
|
25
|
+
* resolved into `unproven` until a sealed run says otherwise;
|
|
26
|
+
* - no WEAKER kind satisfies a stronger type (the type table is
|
|
27
|
+
* closed-world; a row never inherits another row's kinds);
|
|
28
|
+
* - a mocked spec, a quarantined test (dropped by the resolver before
|
|
29
|
+
* this call) and an inferred-only binding never satisfy;
|
|
30
|
+
* - a GREEN sibling never forgives a RED one — one failing mapped test
|
|
31
|
+
* makes the whole case `failing`;
|
|
32
|
+
* - findings sort by rule id then case id, so the same inputs always
|
|
33
|
+
* produce the same output.
|
|
34
|
+
*/
|
|
35
|
+
import { compareStrings } from '../graph/util.js';
|
|
36
|
+
import { BUSINESS_RULE_TYPE_TABLE, businessRuleClaimId, casesOf, } from '../schemas/business-rules.js';
|
|
37
|
+
import { CAUSE_NEXT_ACTIONS } from '../schemas/verdict.js';
|
|
38
|
+
/** The record kind a `browser-e2e` binding must have produced. */
|
|
39
|
+
const BROWSER_ANCHOR_KIND = 'ui.action';
|
|
40
|
+
/** The record kind an `observed-e2e` binding must have produced. */
|
|
41
|
+
const OBSERVED_EXCHANGE_KIND = 'http.request';
|
|
42
|
+
/**
|
|
43
|
+
* Whether the sealed run holds a record of `kind` attributable to one of
|
|
44
|
+
* the test's own witness sessions. This is the WP3 attribution: the run's
|
|
45
|
+
* session trace joins a test to its session ids, and a record carrying
|
|
46
|
+
* `payload.sessionId` joins the session back to the test — no obligation
|
|
47
|
+
* claim is involved anywhere in that join.
|
|
48
|
+
*/
|
|
49
|
+
function sessionProves(facts, sessionIds, kind) {
|
|
50
|
+
if (sessionIds.length === 0)
|
|
51
|
+
return false;
|
|
52
|
+
const sessions = new Set(sessionIds);
|
|
53
|
+
return facts.records.some((record) => {
|
|
54
|
+
if (record.kind !== kind)
|
|
55
|
+
return false;
|
|
56
|
+
const session = sessionIdOf(record);
|
|
57
|
+
return session !== null && sessions.has(session);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Statuses ordered by how badly a case is doing (worst first). */
|
|
61
|
+
const STATUS_SEVERITY = Object.freeze({
|
|
62
|
+
unmapped: 0,
|
|
63
|
+
'wrong-type': 1,
|
|
64
|
+
failing: 2,
|
|
65
|
+
unproven: 3,
|
|
66
|
+
satisfied: 4,
|
|
67
|
+
});
|
|
68
|
+
/** The session id a record was stamped under, when it carries one. */
|
|
69
|
+
function sessionIdOf(record) {
|
|
70
|
+
const payload = record.payload;
|
|
71
|
+
if (payload === null || typeof payload !== 'object' || Array.isArray(payload))
|
|
72
|
+
return null;
|
|
73
|
+
const value = payload['sessionId'];
|
|
74
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
75
|
+
}
|
|
76
|
+
/** The record kind a binding's accepted test kind must have produced. */
|
|
77
|
+
function anchorKindFor(kind) {
|
|
78
|
+
if (kind === 'browser-e2e')
|
|
79
|
+
return BROWSER_ANCHOR_KIND;
|
|
80
|
+
if (kind === 'observed-e2e')
|
|
81
|
+
return OBSERVED_EXCHANGE_KIND;
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
/** Grades one accepted binding against the sealed facts. */
|
|
85
|
+
function gradeBinding(binding, kind, row, facts) {
|
|
86
|
+
if (facts === null) {
|
|
87
|
+
return {
|
|
88
|
+
failing: null,
|
|
89
|
+
unproven: {
|
|
90
|
+
logicalKey: binding.logicalKey,
|
|
91
|
+
detail: `test '${binding.logicalKey}' is mapped but no sealed supervised run exists yet — ` +
|
|
92
|
+
'a mapping is a declaration, never a proof (`gateforge test-gates`)',
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const fact = facts.tests.get(binding.logicalKey);
|
|
97
|
+
if (fact === undefined) {
|
|
98
|
+
return {
|
|
99
|
+
failing: null,
|
|
100
|
+
unproven: {
|
|
101
|
+
logicalKey: binding.logicalKey,
|
|
102
|
+
detail: `test '${binding.logicalKey}' is mapped but the sealed run did not execute it — ` +
|
|
103
|
+
'a test that did not run proves nothing',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (!fact.inGradedSlice) {
|
|
108
|
+
return {
|
|
109
|
+
failing: null,
|
|
110
|
+
unproven: {
|
|
111
|
+
logicalKey: binding.logicalKey,
|
|
112
|
+
detail: `test '${binding.logicalKey}' is mapped but sits outside this run's graded slice ` +
|
|
113
|
+
`(scope '${facts.scope}') — re-run without the narrowed scope, or let the slice select it`,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (fact.status === 'failed') {
|
|
118
|
+
return { failing: binding.logicalKey, unproven: null };
|
|
119
|
+
}
|
|
120
|
+
if (fact.status !== 'passed') {
|
|
121
|
+
return {
|
|
122
|
+
failing: null,
|
|
123
|
+
unproven: {
|
|
124
|
+
logicalKey: binding.logicalKey,
|
|
125
|
+
detail: `test '${binding.logicalKey}' is mapped but the sealed run recorded it as ` +
|
|
126
|
+
`'${fact.status}' — only a passing run proves the rule`,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (row.requiresWitnessedSuite && !facts.witnessedRunners.has(row.runner)) {
|
|
131
|
+
return {
|
|
132
|
+
failing: null,
|
|
133
|
+
unproven: {
|
|
134
|
+
logicalKey: binding.logicalKey,
|
|
135
|
+
detail: `test '${binding.logicalKey}' passed, but no WITNESSED ${row.runner} suite ran in the ` +
|
|
136
|
+
`sealed run — mark the suite witnessed (\`diagnostics.suites[].witnessed\` in .gateforge.yml); ` +
|
|
137
|
+
'an unwitnessed suite is not proof',
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const anchor = anchorKindFor(kind);
|
|
142
|
+
if (anchor !== null && !sessionProves(facts, fact.sessionIds, anchor)) {
|
|
143
|
+
return {
|
|
144
|
+
failing: null,
|
|
145
|
+
unproven: {
|
|
146
|
+
logicalKey: binding.logicalKey,
|
|
147
|
+
detail: `test '${binding.logicalKey}' passed but produced no '${anchor}' witness record ` +
|
|
148
|
+
'attributable to its own session — a ' + kind + ' test must run on the Gateforge fixture ' +
|
|
149
|
+
"(`@gate-forge/pack-playwright/fixture`) so the witness sees the journey",
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return { failing: null, unproven: null };
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Grades one rule case. Pure; `bindings` are the case's gradeable
|
|
157
|
+
* bindings (the resolver has already dropped quarantined and stale
|
|
158
|
+
* ones).
|
|
159
|
+
*/
|
|
160
|
+
function gradeCase(rule, caseId, describe, bindings, typeTable, facts) {
|
|
161
|
+
const claimId = businessRuleClaimId(rule.id, caseId);
|
|
162
|
+
const row = typeTable[rule.test];
|
|
163
|
+
const gradeable = bindings.filter((binding) => binding.origin === 'native' || binding.origin === 'sidecar');
|
|
164
|
+
const mappedTests = [...new Set(gradeable.map((binding) => binding.logicalKey))].sort(compareStrings);
|
|
165
|
+
const finding = (code, detail, tests) => ({
|
|
166
|
+
code,
|
|
167
|
+
cause: code,
|
|
168
|
+
ruleId: rule.id,
|
|
169
|
+
caseId,
|
|
170
|
+
claimId,
|
|
171
|
+
detail: `business rule '${rule.id}' case '${caseId}' (${describe}): ${detail}`,
|
|
172
|
+
nextAction: CAUSE_NEXT_ACTIONS[code],
|
|
173
|
+
tests,
|
|
174
|
+
});
|
|
175
|
+
if (gradeable.length === 0) {
|
|
176
|
+
return {
|
|
177
|
+
ruleId: rule.id,
|
|
178
|
+
caseId,
|
|
179
|
+
claimId,
|
|
180
|
+
status: 'unmapped',
|
|
181
|
+
channel: null,
|
|
182
|
+
mappedTests: [],
|
|
183
|
+
finding: finding('BUSINESS_RULE_TEST_MISSING', `no test is mapped for this case; the rule needs a '${row.label}' test ` +
|
|
184
|
+
`(${row.acceptedKinds.join(' or ')}) — \`gateforge next\` prints a starter and the exact mark command`, []),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const accepted = gradeable.filter((binding) => row.acceptedKinds.includes(binding.declaredKind ?? '') && binding.runner === row.runner);
|
|
188
|
+
if (accepted.length === 0) {
|
|
189
|
+
const kinds = [...new Set(gradeable.map((binding) => binding.declaredKind ?? 'undeclared'))].sort(compareStrings);
|
|
190
|
+
return {
|
|
191
|
+
ruleId: rule.id,
|
|
192
|
+
caseId,
|
|
193
|
+
claimId,
|
|
194
|
+
status: 'wrong-type',
|
|
195
|
+
channel: null,
|
|
196
|
+
mappedTests,
|
|
197
|
+
finding: finding('BUSINESS_RULE_TEST_TYPE_MISMATCH', `the ${kinds.join('/')} test(s) mapped to this case cannot prove a '${row.label}' rule: ` +
|
|
198
|
+
`this type accepts ${row.acceptedKinds.join(' or ')} under runner '${row.runner}' ` +
|
|
199
|
+
'(a weaker kind never satisfies a stronger type)', mappedTests),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const unmocked = accepted.filter((binding) => !binding.mocked);
|
|
203
|
+
const failing = [];
|
|
204
|
+
const unproven = [];
|
|
205
|
+
const channels = new Set();
|
|
206
|
+
for (const binding of unmocked) {
|
|
207
|
+
const kind = binding.declaredKind;
|
|
208
|
+
const graded = gradeBinding(binding, kind, row, facts);
|
|
209
|
+
if (graded.failing !== null)
|
|
210
|
+
failing.push(graded.failing);
|
|
211
|
+
if (graded.unproven !== null)
|
|
212
|
+
unproven.push(graded.unproven);
|
|
213
|
+
if (graded.failing === null && graded.unproven === null) {
|
|
214
|
+
channels.add(row.kindChannels[kind] ?? row.defaultChannel);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const acceptedTests = [...new Set(accepted.map((binding) => binding.logicalKey))].sort(compareStrings);
|
|
218
|
+
if (unmocked.length < accepted.length) {
|
|
219
|
+
const mockedKeys = accepted.filter((binding) => binding.mocked).map((binding) => binding.logicalKey);
|
|
220
|
+
unproven.push({
|
|
221
|
+
logicalKey: mockedKeys.sort(compareStrings)[0] ?? '',
|
|
222
|
+
detail: `test(s) ${mockedKeys.sort(compareStrings).join(', ')} mock the system under test — ` +
|
|
223
|
+
"a mocked spec never proves an end-to-end rule (the catalog observed an interception in the file)",
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
if (failing.length > 0) {
|
|
227
|
+
const failed = [...new Set(failing)].sort(compareStrings);
|
|
228
|
+
return {
|
|
229
|
+
ruleId: rule.id,
|
|
230
|
+
caseId,
|
|
231
|
+
claimId,
|
|
232
|
+
status: 'failing',
|
|
233
|
+
channel: null,
|
|
234
|
+
mappedTests,
|
|
235
|
+
finding: finding('BUSINESS_RULE_TEST_FAILING', `mapped test(s) ${failed.join(', ')} failed in the sealed run; every mapped test of a case ` +
|
|
236
|
+
'must pass (a green sibling never forgives a red one)', failed),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (unproven.length > 0) {
|
|
240
|
+
const sorted = [...unproven].sort((a, b) => compareStrings(a.logicalKey, b.logicalKey));
|
|
241
|
+
return {
|
|
242
|
+
ruleId: rule.id,
|
|
243
|
+
caseId,
|
|
244
|
+
claimId,
|
|
245
|
+
status: 'unproven',
|
|
246
|
+
channel: null,
|
|
247
|
+
mappedTests,
|
|
248
|
+
finding: finding('BUSINESS_RULE_TEST_UNPROVEN', sorted.map((entry) => entry.detail).join('; '), sorted.map((entry) => entry.logicalKey).filter((key) => key.length > 0)),
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
ruleId: rule.id,
|
|
253
|
+
caseId,
|
|
254
|
+
claimId,
|
|
255
|
+
status: 'satisfied',
|
|
256
|
+
channel: [...channels].sort(compareStrings).join('+') || row.defaultChannel,
|
|
257
|
+
mappedTests,
|
|
258
|
+
finding: null,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Grades every case of every rule. A rule with no `subject` is graded
|
|
263
|
+
* regardless of the inventory; a rule naming a subject the inventory
|
|
264
|
+
* cannot see is a CONFIGURATION ERROR (the caller exits 2) because a name
|
|
265
|
+
* the inventory cannot see is silently uncheckable.
|
|
266
|
+
*
|
|
267
|
+
* Args:
|
|
268
|
+
* input: rules, resolved bindings, the run's resource inventory, and the
|
|
269
|
+
* sealed run's facts (`null` when no sealed run exists).
|
|
270
|
+
*
|
|
271
|
+
* Returns:
|
|
272
|
+
* BusinessRuleEvaluation: config errors plus every case, sorted by rule
|
|
273
|
+
* id then case id.
|
|
274
|
+
*/
|
|
275
|
+
export function evaluateBusinessRules(input) {
|
|
276
|
+
const typeTable = input.typeTable ?? BUSINESS_RULE_TYPE_TABLE;
|
|
277
|
+
const inventory = new Set(input.inventory);
|
|
278
|
+
const configErrors = [];
|
|
279
|
+
const cases = [];
|
|
280
|
+
const rules = [...input.rules].sort((a, b) => compareStrings(a.id, b.id));
|
|
281
|
+
for (const rule of rules) {
|
|
282
|
+
if (rule.subject !== undefined && !inventory.has(rule.subject)) {
|
|
283
|
+
configErrors.push({
|
|
284
|
+
code: 'BUSINESS_RULE_SUBJECT_UNKNOWN',
|
|
285
|
+
ruleId: rule.id,
|
|
286
|
+
subject: rule.subject,
|
|
287
|
+
detail: `business rule '${rule.id}' names subject '${rule.subject}', which is not present in the ` +
|
|
288
|
+
'current resource inventory; a subject the inventory cannot see is silently uncheckable, so ' +
|
|
289
|
+
'the run fails as a configuration error (ranking and display only — a subject is never proof)',
|
|
290
|
+
});
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
for (const businessCase of casesOf(rule)) {
|
|
294
|
+
const claimId = businessRuleClaimId(rule.id, businessCase.id);
|
|
295
|
+
cases.push(gradeCase(rule, businessCase.id, businessCase.describe, input.bindings.get(claimId) ?? [], typeTable, input.runFacts));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
cases.sort((a, b) => compareStrings(a.ruleId, b.ruleId) || compareStrings(a.caseId, b.caseId));
|
|
299
|
+
return { configErrors, cases };
|
|
300
|
+
}
|
|
301
|
+
/** Whether a case result is one of the four findings the gate reports. */
|
|
302
|
+
export function isBusinessRuleFinding(result) {
|
|
303
|
+
return result.finding !== null;
|
|
304
|
+
}
|
|
305
|
+
/** Worst status among a rule's cases (`satisfied` when it has none). */
|
|
306
|
+
export function worstBusinessRuleStatus(results) {
|
|
307
|
+
let worst = 'satisfied';
|
|
308
|
+
for (const result of results) {
|
|
309
|
+
if (STATUS_SEVERITY[result.status] < STATUS_SEVERITY[worst])
|
|
310
|
+
worst = result.status;
|
|
311
|
+
}
|
|
312
|
+
return worst;
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=business-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business-rules.js","sourceRoot":"","sources":["../../src/policy/business-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,OAAO,GAKR,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAkB,MAAM,uBAAuB,CAAC;AAG3E,kEAAkE;AAClE,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAExC,oEAAoE;AACpE,MAAM,sBAAsB,GAAG,cAAc,CAAC;AA2G9C;;;;;;GAMG;AACH,SAAS,aAAa,CACpB,KAA2B,EAC3B,UAA6B,EAC7B,IAAY;IAEZ,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,QA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,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CACnF,CAAC;IACF,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AACjC,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CACnC,MAA8B;IAE9B,OAAO,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;AACjC,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,uBAAuB,CAAC,OAA0C;IAChF,IAAI,KAAK,GAA2B,WAAW,CAAC;IAChD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC;YAAE,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IACrF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -112,6 +112,10 @@ export declare const BlockingEntrySchema: z.ZodObject<{
|
|
|
112
112
|
RESOURCE_SINGLETON_PER_TENANT: "RESOURCE_SINGLETON_PER_TENANT";
|
|
113
113
|
RESPONSE_FIELD_MISSING_FROM_MODEL: "RESPONSE_FIELD_MISSING_FROM_MODEL";
|
|
114
114
|
TWIN_PATH_DIVERGENT: "TWIN_PATH_DIVERGENT";
|
|
115
|
+
BUSINESS_RULE_TEST_MISSING: "BUSINESS_RULE_TEST_MISSING";
|
|
116
|
+
BUSINESS_RULE_TEST_TYPE_MISMATCH: "BUSINESS_RULE_TEST_TYPE_MISMATCH";
|
|
117
|
+
BUSINESS_RULE_TEST_UNPROVEN: "BUSINESS_RULE_TEST_UNPROVEN";
|
|
118
|
+
BUSINESS_RULE_TEST_FAILING: "BUSINESS_RULE_TEST_FAILING";
|
|
115
119
|
}>>>;
|
|
116
120
|
nextAction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
121
|
}, z.core.$strict>;
|
|
@@ -249,6 +253,10 @@ export declare const PolicyEvaluationResultSchema: z.ZodObject<{
|
|
|
249
253
|
RESOURCE_SINGLETON_PER_TENANT: "RESOURCE_SINGLETON_PER_TENANT";
|
|
250
254
|
RESPONSE_FIELD_MISSING_FROM_MODEL: "RESPONSE_FIELD_MISSING_FROM_MODEL";
|
|
251
255
|
TWIN_PATH_DIVERGENT: "TWIN_PATH_DIVERGENT";
|
|
256
|
+
BUSINESS_RULE_TEST_MISSING: "BUSINESS_RULE_TEST_MISSING";
|
|
257
|
+
BUSINESS_RULE_TEST_TYPE_MISMATCH: "BUSINESS_RULE_TEST_TYPE_MISMATCH";
|
|
258
|
+
BUSINESS_RULE_TEST_UNPROVEN: "BUSINESS_RULE_TEST_UNPROVEN";
|
|
259
|
+
BUSINESS_RULE_TEST_FAILING: "BUSINESS_RULE_TEST_FAILING";
|
|
252
260
|
}>>>;
|
|
253
261
|
nextAction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
262
|
}, z.core.$strict>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/policy/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,KAAK,YAAY,EAAiB,MAAM,sBAAsB,CAAC;AAG5G,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAmD,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGzG,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAK1D;;;;GAIG;AACH,qB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AAsE;AACtE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAcrC,CAAC;AAEL,+CAA+C;AAC/C,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE;IACT,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAC3D,GACA,OAAO,CAaT;AAED,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,KAAK,EAAE,aAAa,CAAC;IACrB,iEAAiE;IACjE,QAAQ,EAAE,UAAU,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,sBAAsB,CAwErF"}
|
package/dist/policy/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export { CRUD_CONTRACT_PREFIX, PERSISTENCE_CONTRACT_PREFIX, BlockingEntrySchema, ClaimAssessmentSchema, PolicyEvaluationError, PolicyEvaluationResultSchema, classificationBlockedIdentity, evaluatePolicies, lifecycleAllowsContract, } from './evaluate.js';
|
|
12
12
|
export type { BlockingEntry, ClaimAssessment, PolicyEvaluationInput, PolicyEvaluationResult, } from './evaluate.js';
|
|
13
13
|
export { evaluateCoveragePolicy, type CoverageInventoryTable, type MappedCoverage, type CoverageConfigError, type CoverageBlockingFinding, type CoveragePolicyResult, } from './coverage.js';
|
|
14
|
+
export { evaluateBusinessRules, isBusinessRuleFinding, worstBusinessRuleStatus, type BusinessRuleBinding, type BusinessRuleRunFacts, type BusinessRuleTestFact, type BusinessRuleConfigError, type BusinessRuleFinding, type BusinessRuleCaseResult, type BusinessRuleEvaluation, type EvaluateBusinessRulesInput, } from './business-rules.js';
|
|
14
15
|
export { TRUSTED_POLICY_DOMAIN, trustedPolicyDigest, policyWeakenedCandidate, type TrustedPolicyInput, type PolicyWeakeningCheck, } from './trusted.js';
|
|
15
16
|
export { BEHAVIOR_POLICY_ID, EMPTY_BEHAVIOR_CATALOG_DIGEST, compileBehaviorPolicy, parseBehaviorPolicy, type CompileBehaviorPolicyInput, type CompileBehaviorPolicyResult, } from './behavior.js';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAC"}
|
package/dist/policy/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export { CRUD_CONTRACT_PREFIX, PERSISTENCE_CONTRACT_PREFIX, BlockingEntrySchema, ClaimAssessmentSchema, PolicyEvaluationError, PolicyEvaluationResultSchema, classificationBlockedIdentity, evaluatePolicies, lifecycleAllowsContract, } from './evaluate.js';
|
|
12
12
|
export { evaluateCoveragePolicy, } from './coverage.js';
|
|
13
|
+
export { evaluateBusinessRules, isBusinessRuleFinding, worstBusinessRuleStatus, } from './business-rules.js';
|
|
13
14
|
export { TRUSTED_POLICY_DOMAIN, trustedPolicyDigest, policyWeakenedCandidate, } from './trusted.js';
|
|
14
15
|
export { BEHAVIOR_POLICY_ID, EMPTY_BEHAVIOR_CATALOG_DIGEST, compileBehaviorPolicy, parseBehaviorPolicy, } from './behavior.js';
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/policy/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,sBAAsB,GAMvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,GAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,sBAAsB,GAMvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GASxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,GAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,eAAe,CAAC"}
|