@mmnto/totem 1.77.0 → 1.79.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/artifacts/panel.d.ts +48 -48
- package/dist/artifacts/schema.d.ts +40 -40
- package/dist/compiler-schema.d.ts +1048 -7
- package/dist/compiler-schema.d.ts.map +1 -1
- package/dist/compiler-schema.js +129 -1
- package/dist/compiler-schema.js.map +1 -1
- package/dist/compiler-schema.test.js +92 -2
- package/dist/compiler-schema.test.js.map +1 -1
- package/dist/compiler.d.ts +2 -2
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +1 -1
- package/dist/compiler.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/parity-detect.d.ts +127 -0
- package/dist/parity-detect.d.ts.map +1 -1
- package/dist/parity-detect.js +425 -1
- package/dist/parity-detect.js.map +1 -1
- package/dist/parity-lock-content.test.d.ts +9 -0
- package/dist/parity-lock-content.test.d.ts.map +1 -0
- package/dist/parity-lock-content.test.js +432 -0
- package/dist/parity-lock-content.test.js.map +1 -0
- package/dist/parity-manifest.d.ts +1 -1
- package/dist/parity-manifest.d.ts.map +1 -1
- package/dist/parity-manifest.js +6 -0
- package/dist/parity-manifest.js.map +1 -1
- package/dist/spine/authored-rule.d.ts +360 -0
- package/dist/spine/authored-rule.d.ts.map +1 -0
- package/dist/spine/authored-rule.js +199 -0
- package/dist/spine/authored-rule.js.map +1 -0
- package/dist/spine/authored-rule.test.d.ts +2 -0
- package/dist/spine/authored-rule.test.d.ts.map +1 -0
- package/dist/spine/authored-rule.test.js +220 -0
- package/dist/spine/authored-rule.test.js.map +1 -0
- package/dist/spine/candidate-rule.d.ts +32 -0
- package/dist/spine/candidate-rule.d.ts.map +1 -1
- package/dist/spine/candidate-rule.js +2 -2
- package/dist/spine/candidate-rule.js.map +1 -1
- package/dist/spine/classify.d.ts +5 -5
- package/dist/spine/compile.d.ts +16 -4
- package/dist/spine/compile.d.ts.map +1 -1
- package/dist/spine/compile.js +23 -0
- package/dist/spine/compile.js.map +1 -1
- package/dist/spine/compile.test.js +69 -0
- package/dist/spine/compile.test.js.map +1 -1
- package/dist/spine/corpus-dispositions.d.ts +18 -18
- package/dist/spine/extract.d.ts +2 -2
- package/dist/spine/extract.d.ts.map +1 -1
- package/dist/spine/extract.js +5 -4
- package/dist/spine/extract.js.map +1 -1
- package/dist/spine/ledgers.d.ts +46 -21
- package/dist/spine/ledgers.d.ts.map +1 -1
- package/dist/spine/ledgers.js +16 -8
- package/dist/spine/ledgers.js.map +1 -1
- package/dist/spine/rule-policy.d.ts +27 -0
- package/dist/spine/rule-policy.d.ts.map +1 -0
- package/dist/spine/rule-policy.js +43 -0
- package/dist/spine/rule-policy.js.map +1 -0
- package/dist/spine/rule-policy.test.d.ts +2 -0
- package/dist/spine/rule-policy.test.d.ts.map +1 -0
- package/dist/spine/rule-policy.test.js +31 -0
- package/dist/spine/rule-policy.test.js.map +1 -0
- package/dist/spine/windtunnel-lock.d.ts +8 -8
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledgers.d.ts","sourceRoot":"","sources":["../../src/spine/ledgers.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,yGAAyG;AACzG,eAAO,MAAM,aAAa,oCAAkC,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"ledgers.d.ts","sourceRoot":"","sources":["../../src/spine/ledgers.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,yGAAyG;AACzG,eAAO,MAAM,aAAa,oCAAkC,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAapF,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/spine/ledgers.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// split → FM(d)/(g) cover + FM(e) split-disjointness
|
|
11
11
|
// apiUsage → FM(h) held-out-fetch count MUST be 0
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
-
import {
|
|
13
|
+
import { MinedProvenanceWireSchema } from '../compiler-schema.js';
|
|
14
14
|
import { ClassifierDispositionSchema } from './candidate-rule.js';
|
|
15
15
|
import { SplitArtifactSchema } from './split.js';
|
|
16
16
|
function nonEmpty(label) {
|
|
@@ -24,13 +24,21 @@ export const RoutingSchema = z.enum(['compile', 'rag-only']);
|
|
|
24
24
|
/**
|
|
25
25
|
* Provenance of a classifier-ledger disposition: a genuine classifier judgment
|
|
26
26
|
* (`classified`) vs a safe-default forced by classifier failure (`error-default`,
|
|
27
|
-
* always `behavioral`/RAG-only)
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* always `behavioral`/RAG-only) vs an authored rule's INDEPENDENT structural
|
|
28
|
+
* eligibility verdict (`authored-whitelist`, ADR-112 §3 — judged by the static
|
|
29
|
+
* decidable-class whitelist, NOT an LLM classifier; named distinctly so the
|
|
30
|
+
* classifier ledger never claims an LLM classified a human-authored rule —
|
|
31
|
+
* Tenet-20 honesty). Reported in the §8 done-criterion so a flaky classifier's
|
|
32
|
+
* error rate is a NAMED cause of behavioral-heavy output — never conflated with
|
|
33
|
+
* "lc structural signal is sparse" (a valid HONEST-NEGATIVE) or "the classifier
|
|
34
|
+
* mis-routed everything" (Tenet 19). It is NOT a falsifying condition (no FM
|
|
35
|
+
* clause) — a done-criterion diagnostic, like `stage4Confirmed`.
|
|
32
36
|
*/
|
|
33
|
-
export const DispositionSourceSchema = z.enum([
|
|
37
|
+
export const DispositionSourceSchema = z.enum([
|
|
38
|
+
'classified',
|
|
39
|
+
'error-default',
|
|
40
|
+
'authored-whitelist',
|
|
41
|
+
]);
|
|
34
42
|
/**
|
|
35
43
|
* Compile + Stage-4 disposition of a compile-routed (structural) candidate (slice 4).
|
|
36
44
|
* Recorded additively on the classifier ledger so the §8 done-criterion (which reads
|
|
@@ -67,7 +75,7 @@ export const DraftSourceKindSchema = z.enum(['human', 'bot', 'mixed']);
|
|
|
67
75
|
// ── 1. Emission ledger ──────────────────────────────────────────────────────
|
|
68
76
|
export const EmissionLedgerEntrySchema = z.object({
|
|
69
77
|
candidateRef: nonEmpty('candidateRef'),
|
|
70
|
-
provenance:
|
|
78
|
+
provenance: MinedProvenanceWireSchema,
|
|
71
79
|
classifierDisposition: ClassifierDispositionSchema,
|
|
72
80
|
routing: RoutingSchema,
|
|
73
81
|
classifierLedgerRef: nonEmpty('classifierLedgerRef'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledgers.js","sourceRoot":"","sources":["../../src/spine/ledgers.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,+DAA+D;AAC/D,4EAA4E;AAC5E,yDAAyD;AACzD,iDAAiD;AACjD,4DAA4D;AAC5D,sDAAsD;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ledgers.js","sourceRoot":"","sources":["../../src/spine/ledgers.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,+DAA+D;AAC/D,4EAA4E;AAC5E,yDAAyD;AACzD,iDAAiD;AACjD,4DAA4D;AAC5D,sDAAsD;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,y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;SAC7B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAGL,gFAAgF;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC;CACjC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;IAC3C,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CAClD,CAAC,CAAC;AAGH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,oBAAoB;IAC9B,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,sBAAsB;IAClC,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE,oBAAoB;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** ADR-112 — a rule's producer kind (the `provenance.kind` discriminator). */
|
|
2
|
+
export type ProducerKind = 'mined' | 'authored';
|
|
3
|
+
/**
|
|
4
|
+
* The producer-kind override config (ADR-112 §9). Each field is an upstream
|
|
5
|
+
* contract behaviour that authoring changes relative to mining:
|
|
6
|
+
* - `labelScope` — §9: mined labels the held-out slice only; authored
|
|
7
|
+
* must label EVERY non-control firing across BOTH
|
|
8
|
+
* slices, else a train-slice FP has no label and
|
|
9
|
+
* escapes the precision-1.0 FAIL.
|
|
10
|
+
* - `positiveControlSide` — §6: mined positive controls are held-out; authored
|
|
11
|
+
* positive controls are TRAIN-side (the rule is
|
|
12
|
+
* authored against the train slice).
|
|
13
|
+
* - `exposureControlSide` — §5.3: which slice `positiveControlsExercised`
|
|
14
|
+
* counts. Mirrors `positiveControlSide`.
|
|
15
|
+
*/
|
|
16
|
+
export interface RulePolicy {
|
|
17
|
+
readonly labelScope: 'held-out-only' | 'whole-window';
|
|
18
|
+
readonly positiveControlSide: 'held-out' | 'train';
|
|
19
|
+
readonly exposureControlSide: 'held-out' | 'train';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ADR-112 §9 — resolve the override config for a producer kind. Pure +
|
|
23
|
+
* exhaustive over the 2-value union. The MINED branch is the live, byte-identical
|
|
24
|
+
* path; the AUTHORED branch is defined for slice D's consumers (not yet wired).
|
|
25
|
+
*/
|
|
26
|
+
export declare function getRulePolicy(kind: ProducerKind): RulePolicy;
|
|
27
|
+
//# sourceMappingURL=rule-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-policy.d.ts","sourceRoot":"","sources":["../../src/spine/rule-policy.ts"],"names":[],"mappings":"AAgBA,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IAIzB,QAAQ,CAAC,UAAU,EAAE,eAAe,GAAG,cAAc,CAAC;IACtD,QAAQ,CAAC,mBAAmB,EAAE,UAAU,GAAG,OAAO,CAAC;IACnD,QAAQ,CAAC,mBAAmB,EAAE,UAAU,GAAG,OAAO,CAAC;CACpD;AAcD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAa5D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// ─── ADR-112 §9 — the producer-kind → override SINGLE HOME ───────────────────
|
|
2
|
+
//
|
|
3
|
+
// The one place behaviour switches on `provenance.kind`. ADR-112 §9 amends the
|
|
4
|
+
// upstream contracts (ADR-110/111) with a table of producer-kind overrides;
|
|
5
|
+
// rather than smear a `switch(kind)` across derive-labels / scorer / materializer
|
|
6
|
+
// (N scattered branches — the gemini break), every consumer asks THIS function
|
|
7
|
+
// "how do I handle a rule of this kind?" (Tenet 20 single-home).
|
|
8
|
+
//
|
|
9
|
+
// SLICE A scope: the home + the MINED policy are wired live (mined behaviour is
|
|
10
|
+
// byte-identical to pre-ADR-112). The AUTHORED policy is DEFINED here (so slice
|
|
11
|
+
// D extends one place, not many) but NO scorer/derive-labels/materializer
|
|
12
|
+
// consumer reads it yet — the operational window-wide label derivation, the
|
|
13
|
+
// train-side control materialization, and the held-out-activation metric are
|
|
14
|
+
// slice D. Until then a run is single-producer (`provenanceKind` on the lock,
|
|
15
|
+
// default `mined`); a mixed-kind corpus is out of scope for the first cert (§7).
|
|
16
|
+
const MINED_POLICY = Object.freeze({
|
|
17
|
+
labelScope: 'held-out-only',
|
|
18
|
+
positiveControlSide: 'held-out',
|
|
19
|
+
exposureControlSide: 'held-out',
|
|
20
|
+
});
|
|
21
|
+
const AUTHORED_POLICY = Object.freeze({
|
|
22
|
+
labelScope: 'whole-window',
|
|
23
|
+
positiveControlSide: 'train',
|
|
24
|
+
exposureControlSide: 'train',
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* ADR-112 §9 — resolve the override config for a producer kind. Pure +
|
|
28
|
+
* exhaustive over the 2-value union. The MINED branch is the live, byte-identical
|
|
29
|
+
* path; the AUTHORED branch is defined for slice D's consumers (not yet wired).
|
|
30
|
+
*/
|
|
31
|
+
export function getRulePolicy(kind) {
|
|
32
|
+
switch (kind) {
|
|
33
|
+
case 'mined':
|
|
34
|
+
return MINED_POLICY;
|
|
35
|
+
case 'authored':
|
|
36
|
+
return AUTHORED_POLICY;
|
|
37
|
+
default: {
|
|
38
|
+
const _exhaustive = kind;
|
|
39
|
+
throw new Error(`[Totem Error] getRulePolicy: unknown producer kind '${String(_exhaustive)}'`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=rule-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-policy.js","sourceRoot":"","sources":["../../src/spine/rule-policy.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,kFAAkF;AAClF,+EAA+E;AAC/E,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,iFAAiF;AA2BjF,MAAM,YAAY,GAAe,MAAM,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,eAAe;IAC3B,mBAAmB,EAAE,UAAU;IAC/B,mBAAmB,EAAE,UAAU;CAChC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAe,MAAM,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,cAAc;IAC1B,mBAAmB,EAAE,OAAO;IAC5B,mBAAmB,EAAE,OAAO;CAC7B,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAkB;IAC9C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,YAAY,CAAC;QACtB,KAAK,UAAU;YACb,OAAO,eAAe,CAAC;QACzB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,IAAI,CAAC;YAChC,MAAM,IAAI,KAAK,CACb,uDAAuD,MAAM,CAAC,WAAW,CAAC,GAAG,CAC9E,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-policy.test.d.ts","sourceRoot":"","sources":["../../src/spine/rule-policy.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { getRulePolicy } from './rule-policy.js';
|
|
3
|
+
describe('getRulePolicy (ADR-112 §9 single-home)', () => {
|
|
4
|
+
it('mined → held-out-only label scope + held-out controls (the LIVE, byte-identical path)', () => {
|
|
5
|
+
expect(getRulePolicy('mined')).toEqual({
|
|
6
|
+
labelScope: 'held-out-only',
|
|
7
|
+
positiveControlSide: 'held-out',
|
|
8
|
+
exposureControlSide: 'held-out',
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
it('authored → whole-window labels + train-side controls (DEFINED for slice D; not yet wired live)', () => {
|
|
12
|
+
expect(getRulePolicy('authored')).toEqual({
|
|
13
|
+
labelScope: 'whole-window',
|
|
14
|
+
positiveControlSide: 'train',
|
|
15
|
+
exposureControlSide: 'train',
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
it('mined and authored diverge on label scope (the §9 amendment the scorer reads in slice D)', () => {
|
|
19
|
+
expect(getRulePolicy('mined').labelScope).not.toBe(getRulePolicy('authored').labelScope);
|
|
20
|
+
});
|
|
21
|
+
it('returns a frozen singleton — a caller cannot mutate policy resolution process-wide (#2259)', () => {
|
|
22
|
+
const policy = getRulePolicy('mined');
|
|
23
|
+
// Frozen ⇒ any property write throws in strict mode (ESM), so policy resolution can't be
|
|
24
|
+
// mutated process-wide through the shared reference. `Object.assign` exercises that [[Set]].
|
|
25
|
+
expect(Object.isFrozen(policy)).toBe(true);
|
|
26
|
+
expect(() => Object.assign(policy, { labelScope: 'whole-window' })).toThrow();
|
|
27
|
+
// the next resolution is unaffected by the attempted mutation.
|
|
28
|
+
expect(getRulePolicy('mined').labelScope).toBe('held-out-only');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=rule-policy.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-policy.test.js","sourceRoot":"","sources":["../../src/spine/rule-policy.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE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U,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -88,14 +88,14 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
88
88
|
headSha: z.ZodString;
|
|
89
89
|
diffSha: z.ZodOptional<z.ZodString>;
|
|
90
90
|
}, "strip", z.ZodTypeAny, {
|
|
91
|
-
headSha: string;
|
|
92
91
|
pr: number;
|
|
92
|
+
headSha: string;
|
|
93
93
|
mergeCommit: string;
|
|
94
94
|
baseSha: string;
|
|
95
95
|
diffSha?: string | undefined;
|
|
96
96
|
}, {
|
|
97
|
-
headSha: string;
|
|
98
97
|
pr: number;
|
|
98
|
+
headSha: string;
|
|
99
99
|
mergeCommit: string;
|
|
100
100
|
baseSha: string;
|
|
101
101
|
diffSha?: string | undefined;
|
|
@@ -120,8 +120,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
120
120
|
} | undefined;
|
|
121
121
|
};
|
|
122
122
|
resolvedPrs: {
|
|
123
|
-
headSha: string;
|
|
124
123
|
pr: number;
|
|
124
|
+
headSha: string;
|
|
125
125
|
mergeCommit: string;
|
|
126
126
|
baseSha: string;
|
|
127
127
|
diffSha?: string | undefined;
|
|
@@ -146,8 +146,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
146
146
|
excludeBotPrs?: boolean | undefined;
|
|
147
147
|
};
|
|
148
148
|
resolvedPrs: {
|
|
149
|
-
headSha: string;
|
|
150
149
|
pr: number;
|
|
150
|
+
headSha: string;
|
|
151
151
|
mergeCommit: string;
|
|
152
152
|
baseSha: string;
|
|
153
153
|
diffSha?: string | undefined;
|
|
@@ -283,8 +283,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
283
283
|
} | undefined;
|
|
284
284
|
};
|
|
285
285
|
resolvedPrs: {
|
|
286
|
-
headSha: string;
|
|
287
286
|
pr: number;
|
|
287
|
+
headSha: string;
|
|
288
288
|
mergeCommit: string;
|
|
289
289
|
baseSha: string;
|
|
290
290
|
diffSha?: string | undefined;
|
|
@@ -349,8 +349,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
349
349
|
excludeBotPrs?: boolean | undefined;
|
|
350
350
|
};
|
|
351
351
|
resolvedPrs: {
|
|
352
|
-
headSha: string;
|
|
353
352
|
pr: number;
|
|
353
|
+
headSha: string;
|
|
354
354
|
mergeCommit: string;
|
|
355
355
|
baseSha: string;
|
|
356
356
|
diffSha?: string | undefined;
|
|
@@ -415,8 +415,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
415
415
|
} | undefined;
|
|
416
416
|
};
|
|
417
417
|
resolvedPrs: {
|
|
418
|
-
headSha: string;
|
|
419
418
|
pr: number;
|
|
419
|
+
headSha: string;
|
|
420
420
|
mergeCommit: string;
|
|
421
421
|
baseSha: string;
|
|
422
422
|
diffSha?: string | undefined;
|
|
@@ -481,8 +481,8 @@ export declare const WindtunnelLockSchema: z.ZodEffects<z.ZodObject<{
|
|
|
481
481
|
excludeBotPrs?: boolean | undefined;
|
|
482
482
|
};
|
|
483
483
|
resolvedPrs: {
|
|
484
|
-
headSha: string;
|
|
485
484
|
pr: number;
|
|
485
|
+
headSha: string;
|
|
486
486
|
mergeCommit: string;
|
|
487
487
|
baseSha: string;
|
|
488
488
|
diffSha?: string | undefined;
|