@dsh-ray/assistant-evaluation 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +310 -2
- package/bin/dsh-benchmark.js +46 -0
- package/cordis.patch.yml +17 -0
- package/lib/attention-owner-questions.d.ts +104 -0
- package/lib/attention-owner-questions.d.ts.map +1 -0
- package/lib/attention-owner-questions.js +185 -0
- package/lib/attention-owner-questions.js.map +1 -0
- package/lib/attention-tuning.d.ts +513 -0
- package/lib/attention-tuning.d.ts.map +1 -0
- package/lib/attention-tuning.js +1242 -0
- package/lib/attention-tuning.js.map +1 -0
- package/lib/benchmark/cli.d.ts +6 -0
- package/lib/benchmark/cli.d.ts.map +1 -0
- package/lib/benchmark/cli.js +370 -0
- package/lib/benchmark/cli.js.map +1 -0
- package/lib/benchmark/corpus.d.ts +39 -0
- package/lib/benchmark/corpus.d.ts.map +1 -0
- package/lib/benchmark/corpus.js +183 -0
- package/lib/benchmark/corpus.js.map +1 -0
- package/lib/benchmark/deepseek.d.ts +15 -0
- package/lib/benchmark/deepseek.d.ts.map +1 -0
- package/lib/benchmark/deepseek.js +143 -0
- package/lib/benchmark/deepseek.js.map +1 -0
- package/lib/benchmark/families-corpus.d.ts +109 -0
- package/lib/benchmark/families-corpus.d.ts.map +1 -0
- package/lib/benchmark/families-corpus.js +587 -0
- package/lib/benchmark/families-corpus.js.map +1 -0
- package/lib/benchmark/families-runtime.d.ts +191 -0
- package/lib/benchmark/families-runtime.d.ts.map +1 -0
- package/lib/benchmark/families-runtime.js +1171 -0
- package/lib/benchmark/families-runtime.js.map +1 -0
- package/lib/benchmark/growth-runtime.d.ts +97 -0
- package/lib/benchmark/growth-runtime.d.ts.map +1 -0
- package/lib/benchmark/growth-runtime.js +437 -0
- package/lib/benchmark/growth-runtime.js.map +1 -0
- package/lib/benchmark/holdout-evidence.d.ts +126 -0
- package/lib/benchmark/holdout-evidence.d.ts.map +1 -0
- package/lib/benchmark/holdout-evidence.js +466 -0
- package/lib/benchmark/holdout-evidence.js.map +1 -0
- package/lib/benchmark/holdout-isolation.d.ts +27 -0
- package/lib/benchmark/holdout-isolation.d.ts.map +1 -0
- package/lib/benchmark/holdout-isolation.js +66 -0
- package/lib/benchmark/holdout-isolation.js.map +1 -0
- package/lib/benchmark/holdout-protocol.d.ts +68 -0
- package/lib/benchmark/holdout-protocol.d.ts.map +1 -0
- package/lib/benchmark/holdout-protocol.js +271 -0
- package/lib/benchmark/holdout-protocol.js.map +1 -0
- package/lib/benchmark/holdout-provider.d.ts +26 -0
- package/lib/benchmark/holdout-provider.d.ts.map +1 -0
- package/lib/benchmark/holdout-provider.js +382 -0
- package/lib/benchmark/holdout-provider.js.map +1 -0
- package/lib/benchmark/holdout.d.ts +83 -0
- package/lib/benchmark/holdout.d.ts.map +1 -0
- package/lib/benchmark/holdout.js +394 -0
- package/lib/benchmark/holdout.js.map +1 -0
- package/lib/benchmark/index.d.ts +12 -0
- package/lib/benchmark/index.d.ts.map +1 -0
- package/lib/benchmark/index.js +9 -0
- package/lib/benchmark/index.js.map +1 -0
- package/lib/benchmark/memory-corpus.d.ts +55 -0
- package/lib/benchmark/memory-corpus.d.ts.map +1 -0
- package/lib/benchmark/memory-corpus.js +153 -0
- package/lib/benchmark/memory-corpus.js.map +1 -0
- package/lib/benchmark/memory-runtime.d.ts +63 -0
- package/lib/benchmark/memory-runtime.d.ts.map +1 -0
- package/lib/benchmark/memory-runtime.js +75 -0
- package/lib/benchmark/memory-runtime.js.map +1 -0
- package/lib/benchmark/native-goal-services.d.ts +66 -0
- package/lib/benchmark/native-goal-services.d.ts.map +1 -0
- package/lib/benchmark/native-goal-services.js +52 -0
- package/lib/benchmark/native-goal-services.js.map +1 -0
- package/lib/benchmark/native-skills-runtime.d.ts +157 -0
- package/lib/benchmark/native-skills-runtime.d.ts.map +1 -0
- package/lib/benchmark/native-skills-runtime.js +337 -0
- package/lib/benchmark/native-skills-runtime.js.map +1 -0
- package/lib/benchmark/native-skills.d.ts +142 -0
- package/lib/benchmark/native-skills.d.ts.map +1 -0
- package/lib/benchmark/native-skills.js +259 -0
- package/lib/benchmark/native-skills.js.map +1 -0
- package/lib/benchmark/native.d.ts +77 -0
- package/lib/benchmark/native.d.ts.map +1 -0
- package/lib/benchmark/native.js +711 -0
- package/lib/benchmark/native.js.map +1 -0
- package/lib/benchmark/planning-runtime.d.ts +80 -0
- package/lib/benchmark/planning-runtime.d.ts.map +1 -0
- package/lib/benchmark/planning-runtime.js +313 -0
- package/lib/benchmark/planning-runtime.js.map +1 -0
- package/lib/benchmark/report.d.ts +4 -0
- package/lib/benchmark/report.d.ts.map +1 -0
- package/lib/benchmark/report.js +243 -0
- package/lib/benchmark/report.js.map +1 -0
- package/lib/benchmark/runner.d.ts +25 -0
- package/lib/benchmark/runner.d.ts.map +1 -0
- package/lib/benchmark/runner.js +124 -0
- package/lib/benchmark/runner.js.map +1 -0
- package/lib/benchmark/schema.d.ts +20 -0
- package/lib/benchmark/schema.d.ts.map +1 -0
- package/lib/benchmark/schema.js +183 -0
- package/lib/benchmark/schema.js.map +1 -0
- package/lib/benchmark/store.d.ts +18 -0
- package/lib/benchmark/store.d.ts.map +1 -0
- package/lib/benchmark/store.js +321 -0
- package/lib/benchmark/store.js.map +1 -0
- package/lib/benchmark/strategy-capabilities.d.ts +154 -0
- package/lib/benchmark/strategy-capabilities.d.ts.map +1 -0
- package/lib/benchmark/strategy-capabilities.js +304 -0
- package/lib/benchmark/strategy-capabilities.js.map +1 -0
- package/lib/benchmark/strategy-config.d.ts +29 -0
- package/lib/benchmark/strategy-config.d.ts.map +1 -0
- package/lib/benchmark/strategy-config.js +98 -0
- package/lib/benchmark/strategy-config.js.map +1 -0
- package/lib/benchmark/strategy-corpus-v2.d.ts +18 -0
- package/lib/benchmark/strategy-corpus-v2.d.ts.map +1 -0
- package/lib/benchmark/strategy-corpus-v2.js +143 -0
- package/lib/benchmark/strategy-corpus-v2.js.map +1 -0
- package/lib/benchmark/strategy-corpus.d.ts +30 -0
- package/lib/benchmark/strategy-corpus.d.ts.map +1 -0
- package/lib/benchmark/strategy-corpus.js +95 -0
- package/lib/benchmark/strategy-corpus.js.map +1 -0
- package/lib/benchmark/strategy-evidence.d.ts +161 -0
- package/lib/benchmark/strategy-evidence.d.ts.map +1 -0
- package/lib/benchmark/strategy-evidence.js +561 -0
- package/lib/benchmark/strategy-evidence.js.map +1 -0
- package/lib/benchmark/strategy-executor.d.ts +29 -0
- package/lib/benchmark/strategy-executor.d.ts.map +1 -0
- package/lib/benchmark/strategy-executor.js +180 -0
- package/lib/benchmark/strategy-executor.js.map +1 -0
- package/lib/benchmark/strategy-goal-runtime.d.ts +80 -0
- package/lib/benchmark/strategy-goal-runtime.d.ts.map +1 -0
- package/lib/benchmark/strategy-goal-runtime.js +283 -0
- package/lib/benchmark/strategy-goal-runtime.js.map +1 -0
- package/lib/benchmark/strategy-meter.d.ts +62 -0
- package/lib/benchmark/strategy-meter.d.ts.map +1 -0
- package/lib/benchmark/strategy-meter.js +330 -0
- package/lib/benchmark/strategy-meter.js.map +1 -0
- package/lib/benchmark/strategy-owner.d.ts +71 -0
- package/lib/benchmark/strategy-owner.d.ts.map +1 -0
- package/lib/benchmark/strategy-owner.js +282 -0
- package/lib/benchmark/strategy-owner.js.map +1 -0
- package/lib/benchmark/strategy-plan.d.ts +58 -0
- package/lib/benchmark/strategy-plan.d.ts.map +1 -0
- package/lib/benchmark/strategy-plan.js +81 -0
- package/lib/benchmark/strategy-plan.js.map +1 -0
- package/lib/benchmark/strategy-policy.d.ts +16 -0
- package/lib/benchmark/strategy-policy.d.ts.map +1 -0
- package/lib/benchmark/strategy-policy.js +77 -0
- package/lib/benchmark/strategy-policy.js.map +1 -0
- package/lib/benchmark/strategy-projection.d.ts +157 -0
- package/lib/benchmark/strategy-projection.d.ts.map +1 -0
- package/lib/benchmark/strategy-projection.js +171 -0
- package/lib/benchmark/strategy-projection.js.map +1 -0
- package/lib/benchmark/strategy.d.ts +17 -0
- package/lib/benchmark/strategy.d.ts.map +1 -0
- package/lib/benchmark/strategy.js +21 -0
- package/lib/benchmark/strategy.js.map +1 -0
- package/lib/benchmark/traex.d.ts +17 -0
- package/lib/benchmark/traex.d.ts.map +1 -0
- package/lib/benchmark/traex.js +139 -0
- package/lib/benchmark/traex.js.map +1 -0
- package/lib/benchmark/types.d.ts +190 -0
- package/lib/benchmark/types.d.ts.map +1 -0
- package/lib/benchmark/types.js +3 -0
- package/lib/benchmark/types.js.map +1 -0
- package/lib/benchmark/usage.d.ts +36 -0
- package/lib/benchmark/usage.d.ts.map +1 -0
- package/lib/benchmark/usage.js +84 -0
- package/lib/benchmark/usage.js.map +1 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/intake-attention-agreement-store.d.ts +33 -0
- package/lib/intake-attention-agreement-store.d.ts.map +1 -0
- package/lib/intake-attention-agreement-store.js +162 -0
- package/lib/intake-attention-agreement-store.js.map +1 -0
- package/lib/intake-attention-agreement.d.ts +126 -0
- package/lib/intake-attention-agreement.d.ts.map +1 -0
- package/lib/intake-attention-agreement.js +209 -0
- package/lib/intake-attention-agreement.js.map +1 -0
- package/lib/intake-evaluation-agreement.d.ts +204 -0
- package/lib/intake-evaluation-agreement.d.ts.map +1 -0
- package/lib/intake-evaluation-agreement.js +740 -0
- package/lib/intake-evaluation-agreement.js.map +1 -0
- package/lib/notification-outcomes.d.ts +63 -0
- package/lib/notification-outcomes.d.ts.map +1 -0
- package/lib/notification-outcomes.js +399 -0
- package/lib/notification-outcomes.js.map +1 -0
- package/lib/service.d.ts +694 -0
- package/lib/service.d.ts.map +1 -0
- package/lib/service.js +2992 -0
- package/lib/service.js.map +1 -0
- package/lib/sqlite.d.ts +15 -0
- package/lib/sqlite.d.ts.map +1 -0
- package/lib/sqlite.js +1247 -0
- package/lib/sqlite.js.map +1 -0
- package/lib/store.d.ts +175 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/store.js +1722 -0
- package/lib/store.js.map +1 -0
- package/lib/tools.d.ts +4 -0
- package/lib/tools.d.ts.map +1 -0
- package/lib/tools.js +212 -0
- package/lib/tools.js.map +1 -0
- package/lib/types.d.ts +787 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +28 -0
- package/lib/types.js.map +1 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +2 -0
- package/lib/version.js.map +1 -0
- package/lib/work-item-owner-proof.d.ts +4 -0
- package/lib/work-item-owner-proof.d.ts.map +1 -0
- package/lib/work-item-owner-proof.js +53 -0
- package/lib/work-item-owner-proof.js.map +1 -0
- package/package.json +242 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { NotificationOutcome, NotificationOutcomeRecord } from './types.js';
|
|
2
|
+
export declare const INTAKE_ATTENTION_AGREEMENT_PROTOCOL: "assistant-evaluation/intake-attention-agreement/v1";
|
|
3
|
+
/** Notifications with a work item scanned per call; more is reported as `truncated`. */
|
|
4
|
+
export declare const INTAKE_ATTENTION_AGREEMENT_SCAN_LIMIT = 1000;
|
|
5
|
+
/** Structural mirror of WorkItems' `inspectIntakeProvenance`; Evaluation keeps no runtime dependency on WorkItems. */
|
|
6
|
+
export interface IntakeProvenanceSource {
|
|
7
|
+
inspectIntakeProvenance(itemId: string): unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare function isIntakeProvenanceSource(value: unknown): value is IntakeProvenanceSource;
|
|
10
|
+
declare const LEVELS: readonly ["ignore", "digest", "notify", "accept"];
|
|
11
|
+
type IntakeLevel = typeof LEVELS[number];
|
|
12
|
+
export interface IntakeAttentionAgreementCell {
|
|
13
|
+
readonly notifications: number;
|
|
14
|
+
readonly items: number;
|
|
15
|
+
readonly outcomes: Readonly<Record<NotificationOutcome, number>>;
|
|
16
|
+
/** accepted + reacted */
|
|
17
|
+
readonly agreed: number;
|
|
18
|
+
/** rejected + expired-unhandled */
|
|
19
|
+
readonly disagreed: number;
|
|
20
|
+
/** agreed / (agreed + disagreed) in ppm; null without any decided notification. */
|
|
21
|
+
readonly agreementPpm: number | null;
|
|
22
|
+
}
|
|
23
|
+
export interface IntakeAttentionAgreement {
|
|
24
|
+
readonly protocol: typeof INTAKE_ATTENTION_AGREEMENT_PROTOCOL;
|
|
25
|
+
readonly causal: false;
|
|
26
|
+
readonly scope: Readonly<{
|
|
27
|
+
workspace: string;
|
|
28
|
+
preset: string;
|
|
29
|
+
}>;
|
|
30
|
+
readonly fromNotifiedAt: number;
|
|
31
|
+
readonly toNotifiedAt: number;
|
|
32
|
+
/** Current notification heads in the window that name a work item, at most the scan limit. */
|
|
33
|
+
readonly scanned: number;
|
|
34
|
+
readonly truncated: boolean;
|
|
35
|
+
/** No WorkItems peer exposes `inspectIntakeProvenance`: every item is unresolved. */
|
|
36
|
+
readonly provenanceAvailable: boolean;
|
|
37
|
+
/** Notifications whose item was not admitted from intake (explicit decisions, continuations). */
|
|
38
|
+
readonly notIntake: number;
|
|
39
|
+
/** Notifications whose provenance read threw (WorkItems unavailable or intake ledger off) or was malformed. */
|
|
40
|
+
readonly unresolved: number;
|
|
41
|
+
/** Notifications naming a work item of another owner scope; never attributed to this one. */
|
|
42
|
+
readonly foreign: number;
|
|
43
|
+
readonly intake: IntakeAttentionAgreementCell;
|
|
44
|
+
readonly byLevel: Readonly<Partial<Record<IntakeLevel, IntakeAttentionAgreementCell>>>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Aggregate `records` (current heads, each naming a work item) by the intake
|
|
48
|
+
* judgment behind its item. Provenance is read once per item; a throwing or
|
|
49
|
+
* malformed answer leaves that item unresolved.
|
|
50
|
+
*/
|
|
51
|
+
export declare function computeIntakeAttentionAgreement(input: Readonly<{
|
|
52
|
+
scope: Readonly<{
|
|
53
|
+
workspace: string;
|
|
54
|
+
preset: string;
|
|
55
|
+
}>;
|
|
56
|
+
fromNotifiedAt: number;
|
|
57
|
+
toNotifiedAt: number;
|
|
58
|
+
records: readonly NotificationOutcomeRecord[];
|
|
59
|
+
truncated: boolean;
|
|
60
|
+
source: IntakeProvenanceSource | undefined;
|
|
61
|
+
}>): IntakeAttentionAgreement;
|
|
62
|
+
/**
|
|
63
|
+
* WP22 E1: durable, append-only agreement snapshots.
|
|
64
|
+
*
|
|
65
|
+
* The persisted record is the same observational read as
|
|
66
|
+
* `computeIntakeAttentionAgreement`, plus the bucket it was computed for. It is
|
|
67
|
+
* never a causal claim and never an authorization input. The digest covers the
|
|
68
|
+
* scope, the exact window, the fixed configuration version and all counts, but
|
|
69
|
+
* not `computedAt`: repeated ticks inside one interval therefore replay the
|
|
70
|
+
* same digest instead of appending duplicates. A late outcome revision that
|
|
71
|
+
* changes the counts is appended as a new digest for the same window (immutable
|
|
72
|
+
* history), never as an update.
|
|
73
|
+
*/
|
|
74
|
+
export declare const INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_PROTOCOL: "assistant-evaluation/intake-attention-agreement-snapshot/v1";
|
|
75
|
+
export declare const INTAKE_ATTENTION_AGREEMENT_HISTORY_PROTOCOL: "assistant-evaluation/intake-attention-agreement-history/v1";
|
|
76
|
+
/** Fixed configuration generation mixed into the digest; bump only with a semantic change. */
|
|
77
|
+
export declare const INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_VERSION = 1;
|
|
78
|
+
export interface IntakeAttentionAgreementSnapshotInput {
|
|
79
|
+
readonly agreement: IntakeAttentionAgreement;
|
|
80
|
+
readonly computedAt: number;
|
|
81
|
+
/** Look-back used to select the notification window. */
|
|
82
|
+
readonly windowMs: number;
|
|
83
|
+
/** Fixed per-call notification scan limit. */
|
|
84
|
+
readonly scanLimit: number;
|
|
85
|
+
}
|
|
86
|
+
export interface IntakeAttentionAgreementSnapshot {
|
|
87
|
+
readonly protocol: typeof INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_PROTOCOL;
|
|
88
|
+
readonly snapshotVersion: typeof INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_VERSION;
|
|
89
|
+
readonly causal: false;
|
|
90
|
+
readonly scope: Readonly<{
|
|
91
|
+
workspace: string;
|
|
92
|
+
preset: string;
|
|
93
|
+
}>;
|
|
94
|
+
readonly fromNotifiedAt: number;
|
|
95
|
+
readonly toNotifiedAt: number;
|
|
96
|
+
readonly computedAt: number;
|
|
97
|
+
readonly windowMs: number;
|
|
98
|
+
readonly scanLimit: number;
|
|
99
|
+
readonly truncated: boolean;
|
|
100
|
+
readonly provenanceAvailable: boolean;
|
|
101
|
+
readonly notIntake: number;
|
|
102
|
+
readonly unresolved: number;
|
|
103
|
+
readonly foreign: number;
|
|
104
|
+
readonly intake: IntakeAttentionAgreementCell;
|
|
105
|
+
readonly byLevel: Readonly<Partial<Record<IntakeLevel, IntakeAttentionAgreementCell>>>;
|
|
106
|
+
/** sha256 over the immutable content below; excludes `computedAt` so a replay is stable. */
|
|
107
|
+
readonly digest: string;
|
|
108
|
+
}
|
|
109
|
+
export interface IntakeAttentionAgreementHistory {
|
|
110
|
+
readonly protocol: typeof INTAKE_ATTENTION_AGREEMENT_HISTORY_PROTOCOL;
|
|
111
|
+
readonly causal: false;
|
|
112
|
+
readonly scope: Readonly<{
|
|
113
|
+
workspace: string;
|
|
114
|
+
preset: string;
|
|
115
|
+
}>;
|
|
116
|
+
/** Newest first; immutable snapshots of earlier buckets are never rewritten. */
|
|
117
|
+
readonly snapshots: readonly IntakeAttentionAgreementSnapshot[];
|
|
118
|
+
}
|
|
119
|
+
/** The immutable content covered by the snapshot digest (no observation clock, no digest). */
|
|
120
|
+
export type IntakeAttentionAgreementSnapshotContent = Omit<IntakeAttentionAgreementSnapshot, 'digest' | 'computedAt'>;
|
|
121
|
+
/** Digest of one snapshot's immutable content; exported for restart validation. */
|
|
122
|
+
export declare function intakeAttentionAgreementSnapshotDigest(content: IntakeAttentionAgreementSnapshotContent): string;
|
|
123
|
+
/** One immutable snapshot from the current read model. */
|
|
124
|
+
export declare function createIntakeAttentionAgreementSnapshot(input: IntakeAttentionAgreementSnapshotInput): IntakeAttentionAgreementSnapshot;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=intake-attention-agreement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intake-attention-agreement.d.ts","sourceRoot":"","sources":["../src/intake-attention-agreement.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAGhF,eAAO,MAAM,mCAAmC,EAAG,oDAA6D,CAAA;AAChH,wFAAwF;AACxF,eAAO,MAAM,qCAAqC,OAAQ,CAAA;AAE1D,sHAAsH;AACtH,MAAM,WAAW,sBAAsB;IACrC,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CACjD;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAGxF;AAED,QAAA,MAAM,MAAM,mDAAoD,CAAA;AAChE,KAAK,WAAW,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;AA4BxC,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAA;IAChE,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,mCAAmC,CAAA;IAC7D,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAA;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,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,QAAQ,EAAE,OAAO,2CAA2C,CAAA;IACrE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC/D,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,SAAS,gCAAgC,EAAE,CAAA;CAChE;AAWD,8FAA8F;AAC9F,MAAM,MAAM,uCAAuC,GAAG,IAAI,CAAC,gCAAgC,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAA;AAErH,mFAAmF;AACnF,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,uCAAuC,GAAG,MAAM,CAE/G;AAED,0DAA0D;AAC1D,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,qCAAqC,GAAG,gCAAgC,CA2BrI"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WP22: read-only agreement between WP20 intake judgments and the attention
|
|
3
|
+
* outcome ledger.
|
|
4
|
+
*
|
|
5
|
+
* The only join that exists is intake admission → work item → result
|
|
6
|
+
* notification (`workItemId` on the outcome record) → owner outcome. An
|
|
7
|
+
* observe-mode `would-admit` never creates an item, so it never reaches a
|
|
8
|
+
* notification and cannot be measured here; only auto-admitted items are.
|
|
9
|
+
* Nothing is written, adopted or sent; the result is observational.
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from 'node:crypto';
|
|
12
|
+
import { canonicalEvaluationScope } from './store.js';
|
|
13
|
+
import { notificationOutcomes } from './types.js';
|
|
14
|
+
export const INTAKE_ATTENTION_AGREEMENT_PROTOCOL = 'assistant-evaluation/intake-attention-agreement/v1';
|
|
15
|
+
/** Notifications with a work item scanned per call; more is reported as `truncated`. */
|
|
16
|
+
export const INTAKE_ATTENTION_AGREEMENT_SCAN_LIMIT = 1_000;
|
|
17
|
+
export function isIntakeProvenanceSource(value) {
|
|
18
|
+
return typeof value === 'object' && value !== null
|
|
19
|
+
&& typeof value.inspectIntakeProvenance === 'function';
|
|
20
|
+
}
|
|
21
|
+
const LEVELS = ['ignore', 'digest', 'notify', 'accept'];
|
|
22
|
+
/**
|
|
23
|
+
* Validate one peer answer; anything malformed, or an item of another owner
|
|
24
|
+
* scope, counts as unresolved, never as a match. A notification sender may
|
|
25
|
+
* name any work item id, so the item's own scope must equal the metric's.
|
|
26
|
+
*/
|
|
27
|
+
function provenance(value, itemId, scopeKey) {
|
|
28
|
+
if (value === undefined)
|
|
29
|
+
return null;
|
|
30
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
31
|
+
return 'invalid';
|
|
32
|
+
const item = value;
|
|
33
|
+
if (item.protocol !== 'work-items/intake-provenance/v1' || item.itemId !== itemId || item.wouldAccept !== true
|
|
34
|
+
|| !LEVELS.includes(item.level) || (item.mode !== 'observe' && item.mode !== 'auto'))
|
|
35
|
+
return 'invalid';
|
|
36
|
+
const scope = item.scope;
|
|
37
|
+
let key;
|
|
38
|
+
try {
|
|
39
|
+
key = canonicalEvaluationScope({ workspace: scope?.workspace, preset: scope?.preset }).scopeKey;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return 'invalid';
|
|
43
|
+
}
|
|
44
|
+
if (key !== scopeKey)
|
|
45
|
+
return 'foreign';
|
|
46
|
+
return { itemId, level: item.level, mode: item.mode };
|
|
47
|
+
}
|
|
48
|
+
/** Owner outcomes that confirm the intake judgment, that contradict it, and that decide nothing yet. */
|
|
49
|
+
const POSITIVE = new Set(['accepted', 'reacted']);
|
|
50
|
+
const NEGATIVE = new Set(['rejected', 'expired-unhandled']);
|
|
51
|
+
class Cell {
|
|
52
|
+
notifications = 0;
|
|
53
|
+
items = new Set();
|
|
54
|
+
outcomes = Object.fromEntries(notificationOutcomes.map(outcome => [outcome, 0]));
|
|
55
|
+
add(itemId, outcome) {
|
|
56
|
+
this.notifications += 1;
|
|
57
|
+
this.items.add(itemId);
|
|
58
|
+
this.outcomes[outcome] += 1;
|
|
59
|
+
}
|
|
60
|
+
freeze() {
|
|
61
|
+
let agreed = 0, disagreed = 0;
|
|
62
|
+
for (const outcome of notificationOutcomes) {
|
|
63
|
+
if (POSITIVE.has(outcome))
|
|
64
|
+
agreed += this.outcomes[outcome];
|
|
65
|
+
if (NEGATIVE.has(outcome))
|
|
66
|
+
disagreed += this.outcomes[outcome];
|
|
67
|
+
}
|
|
68
|
+
const decided = agreed + disagreed;
|
|
69
|
+
return Object.freeze({
|
|
70
|
+
notifications: this.notifications,
|
|
71
|
+
items: this.items.size,
|
|
72
|
+
outcomes: Object.freeze({ ...this.outcomes }),
|
|
73
|
+
agreed,
|
|
74
|
+
disagreed,
|
|
75
|
+
agreementPpm: decided === 0 ? null : Math.round(agreed * 1_000_000 / decided),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Aggregate `records` (current heads, each naming a work item) by the intake
|
|
81
|
+
* judgment behind its item. Provenance is read once per item; a throwing or
|
|
82
|
+
* malformed answer leaves that item unresolved.
|
|
83
|
+
*/
|
|
84
|
+
export function computeIntakeAttentionAgreement(input) {
|
|
85
|
+
const { scopeKey } = canonicalEvaluationScope(input.scope);
|
|
86
|
+
const resolved = new Map();
|
|
87
|
+
const resolve = (itemId) => {
|
|
88
|
+
if (!resolved.has(itemId)) {
|
|
89
|
+
let value = 'invalid';
|
|
90
|
+
if (input.source !== undefined) {
|
|
91
|
+
try {
|
|
92
|
+
value = provenance(input.source.inspectIntakeProvenance(itemId), itemId, scopeKey);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
value = 'invalid';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
resolved.set(itemId, value);
|
|
99
|
+
}
|
|
100
|
+
return resolved.get(itemId);
|
|
101
|
+
};
|
|
102
|
+
const intake = new Cell();
|
|
103
|
+
const byLevel = new Map();
|
|
104
|
+
let notIntake = 0, unresolved = 0, foreign = 0;
|
|
105
|
+
for (const record of input.records) {
|
|
106
|
+
const itemId = record.workItemId;
|
|
107
|
+
if (itemId === undefined)
|
|
108
|
+
continue;
|
|
109
|
+
const found = resolve(itemId);
|
|
110
|
+
if (found === 'invalid') {
|
|
111
|
+
unresolved += 1;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (found === 'foreign') {
|
|
115
|
+
foreign += 1;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (found === null) {
|
|
119
|
+
notIntake += 1;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
intake.add(itemId, record.outcome);
|
|
123
|
+
let cell = byLevel.get(found.level);
|
|
124
|
+
if (cell === undefined)
|
|
125
|
+
byLevel.set(found.level, cell = new Cell());
|
|
126
|
+
cell.add(itemId, record.outcome);
|
|
127
|
+
}
|
|
128
|
+
return Object.freeze({
|
|
129
|
+
protocol: INTAKE_ATTENTION_AGREEMENT_PROTOCOL,
|
|
130
|
+
causal: false,
|
|
131
|
+
scope: Object.freeze({ workspace: input.scope.workspace, preset: input.scope.preset }),
|
|
132
|
+
fromNotifiedAt: input.fromNotifiedAt,
|
|
133
|
+
toNotifiedAt: input.toNotifiedAt,
|
|
134
|
+
scanned: input.records.length,
|
|
135
|
+
truncated: input.truncated,
|
|
136
|
+
provenanceAvailable: input.source !== undefined,
|
|
137
|
+
notIntake,
|
|
138
|
+
unresolved,
|
|
139
|
+
foreign,
|
|
140
|
+
intake: intake.freeze(),
|
|
141
|
+
byLevel: Object.freeze(Object.fromEntries(LEVELS.flatMap(level => {
|
|
142
|
+
const cell = byLevel.get(level);
|
|
143
|
+
return cell === undefined ? [] : [[level, cell.freeze()]];
|
|
144
|
+
}))),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* WP22 E1: durable, append-only agreement snapshots.
|
|
149
|
+
*
|
|
150
|
+
* The persisted record is the same observational read as
|
|
151
|
+
* `computeIntakeAttentionAgreement`, plus the bucket it was computed for. It is
|
|
152
|
+
* never a causal claim and never an authorization input. The digest covers the
|
|
153
|
+
* scope, the exact window, the fixed configuration version and all counts, but
|
|
154
|
+
* not `computedAt`: repeated ticks inside one interval therefore replay the
|
|
155
|
+
* same digest instead of appending duplicates. A late outcome revision that
|
|
156
|
+
* changes the counts is appended as a new digest for the same window (immutable
|
|
157
|
+
* history), never as an update.
|
|
158
|
+
*/
|
|
159
|
+
export const INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_PROTOCOL = 'assistant-evaluation/intake-attention-agreement-snapshot/v1';
|
|
160
|
+
export const INTAKE_ATTENTION_AGREEMENT_HISTORY_PROTOCOL = 'assistant-evaluation/intake-attention-agreement-history/v1';
|
|
161
|
+
/** Fixed configuration generation mixed into the digest; bump only with a semantic change. */
|
|
162
|
+
export const INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_VERSION = 1;
|
|
163
|
+
/** Deterministic JSON with sorted object keys; arrays keep their order. */
|
|
164
|
+
function canonical(value) {
|
|
165
|
+
if (value === null || typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string')
|
|
166
|
+
return JSON.stringify(value);
|
|
167
|
+
if (Array.isArray(value))
|
|
168
|
+
return `[${value.map(item => canonical(item)).join(',')}]`;
|
|
169
|
+
const record = value;
|
|
170
|
+
return `{${Object.keys(record).filter(key => record[key] !== undefined).sort()
|
|
171
|
+
.map(key => `${JSON.stringify(key)}:${canonical(record[key])}`).join(',')}}`;
|
|
172
|
+
}
|
|
173
|
+
/** Digest of one snapshot's immutable content; exported for restart validation. */
|
|
174
|
+
export function intakeAttentionAgreementSnapshotDigest(content) {
|
|
175
|
+
return createHash('sha256').update(canonical(content)).digest('hex');
|
|
176
|
+
}
|
|
177
|
+
/** One immutable snapshot from the current read model. */
|
|
178
|
+
export function createIntakeAttentionAgreementSnapshot(input) {
|
|
179
|
+
const { agreement } = input;
|
|
180
|
+
if (!Number.isSafeInteger(input.computedAt) || input.computedAt < 0)
|
|
181
|
+
throw new Error('agreement snapshot computedAt is invalid');
|
|
182
|
+
if (!Number.isSafeInteger(input.windowMs) || input.windowMs < 60_000)
|
|
183
|
+
throw new Error('agreement snapshot windowMs is invalid');
|
|
184
|
+
if (!Number.isSafeInteger(input.scanLimit) || input.scanLimit < 1)
|
|
185
|
+
throw new Error('agreement snapshot scanLimit is invalid');
|
|
186
|
+
const content = {
|
|
187
|
+
protocol: INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_PROTOCOL,
|
|
188
|
+
snapshotVersion: INTAKE_ATTENTION_AGREEMENT_SNAPSHOT_VERSION,
|
|
189
|
+
causal: false,
|
|
190
|
+
scope: agreement.scope,
|
|
191
|
+
fromNotifiedAt: agreement.fromNotifiedAt,
|
|
192
|
+
toNotifiedAt: agreement.toNotifiedAt,
|
|
193
|
+
windowMs: input.windowMs,
|
|
194
|
+
scanLimit: input.scanLimit,
|
|
195
|
+
truncated: agreement.truncated,
|
|
196
|
+
provenanceAvailable: agreement.provenanceAvailable,
|
|
197
|
+
notIntake: agreement.notIntake,
|
|
198
|
+
unresolved: agreement.unresolved,
|
|
199
|
+
foreign: agreement.foreign,
|
|
200
|
+
intake: agreement.intake,
|
|
201
|
+
byLevel: agreement.byLevel,
|
|
202
|
+
};
|
|
203
|
+
return Object.freeze({
|
|
204
|
+
...content,
|
|
205
|
+
computedAt: input.computedAt,
|
|
206
|
+
digest: intakeAttentionAgreementSnapshotDigest(content),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=intake-attention-agreement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intake-attention-agreement.js","sourceRoot":"","sources":["../src/intake-attention-agreement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EA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,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC7H,MAAM,OAAO,GAA4C;QACvD,QAAQ,EAAE,4CAA4C;QACtD,eAAe,EAAE,2CAA2C;QAC5D,MAAM,EAAE,KAAc;QACtB,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,mBAAmB,EAAE,SAAS,CAAC,mBAAmB;QAClD,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO;KAC3B,CAAA;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,OAAO;QACV,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,MAAM,EAAE,sCAAsC,CAAC,OAAO,CAAC;KACxD,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import type { EvaluationScope } from './types.js';
|
|
3
|
+
export declare const WORK_ITEM_INTAKE_EVALUATION_FEED_PROTOCOL: "work-items/intake-evaluation-feed/v1";
|
|
4
|
+
export declare const INTAKE_EVALUATION_AGREEMENT_PROTOCOL: "assistant-evaluation/intake-evaluation-agreement/v1";
|
|
5
|
+
export type IntakeEvaluationOutcomeKind = 'agreed' | 'disagreed' | 'pending';
|
|
6
|
+
export type IntakeEvaluationAgreementStatus = 'true-positive' | 'false-positive' | 'false-negative' | 'true-negative' | 'pending';
|
|
7
|
+
export type IntakeEvaluationOutcomeSource = 'none' | 'work-item-outcome' | 'work-item-verdict' | 'notification-outcome' | 'owner-feedback' | 'owner-withdrawal';
|
|
8
|
+
export interface IntakeEvaluationFeedCursor {
|
|
9
|
+
readonly afterSeq: number;
|
|
10
|
+
readonly afterRecordedAt: number;
|
|
11
|
+
readonly afterId: string;
|
|
12
|
+
}
|
|
13
|
+
/** Structural WorkItems WP22 feed adapter; Evaluation keeps no runtime dependency on WorkItems. */
|
|
14
|
+
export interface IntakeEvaluationFeedSource {
|
|
15
|
+
listIntakeEvaluationFeed(options?: Readonly<{
|
|
16
|
+
afterSeq?: number;
|
|
17
|
+
afterRecordedAt?: number;
|
|
18
|
+
afterId?: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
workspace?: string;
|
|
21
|
+
preset?: string;
|
|
22
|
+
onlyWithOutcome?: boolean;
|
|
23
|
+
}>): unknown;
|
|
24
|
+
}
|
|
25
|
+
export declare function isIntakeEvaluationFeedSource(value: unknown): value is IntakeEvaluationFeedSource;
|
|
26
|
+
export interface StoredIntakeEvaluationAgreement {
|
|
27
|
+
readonly evalId: string;
|
|
28
|
+
readonly source: string;
|
|
29
|
+
readonly sourceEventId: string;
|
|
30
|
+
readonly ruleId: string;
|
|
31
|
+
readonly policyVersion: string;
|
|
32
|
+
readonly scope: EvaluationScope | null;
|
|
33
|
+
readonly scopeKey: string | null;
|
|
34
|
+
readonly itemId: string | null;
|
|
35
|
+
readonly wouldAccept: boolean;
|
|
36
|
+
readonly evaluationLevel: 'ignore' | 'digest' | 'notify' | 'accept';
|
|
37
|
+
readonly mode: 'observe' | 'auto';
|
|
38
|
+
readonly outcomeKind: IntakeEvaluationOutcomeKind;
|
|
39
|
+
readonly agreementStatus: IntakeEvaluationAgreementStatus;
|
|
40
|
+
readonly outcomeSource: IntakeEvaluationOutcomeSource;
|
|
41
|
+
readonly evaluatedAt: number;
|
|
42
|
+
readonly feedRecordedAt: number;
|
|
43
|
+
readonly version: number;
|
|
44
|
+
readonly digest: string;
|
|
45
|
+
readonly updatedAt: number;
|
|
46
|
+
}
|
|
47
|
+
export interface IntakeEvaluationAgreementRevision {
|
|
48
|
+
readonly evalId: string;
|
|
49
|
+
readonly version: number;
|
|
50
|
+
readonly outcomeKind: IntakeEvaluationOutcomeKind;
|
|
51
|
+
readonly agreementStatus: IntakeEvaluationAgreementStatus;
|
|
52
|
+
readonly outcomeSource: IntakeEvaluationOutcomeSource;
|
|
53
|
+
readonly digest: string;
|
|
54
|
+
readonly recordedAt: number;
|
|
55
|
+
readonly feedSignals: Readonly<Record<string, unknown>>;
|
|
56
|
+
}
|
|
57
|
+
export interface IntakeEvaluationAgreementHistory {
|
|
58
|
+
readonly head: StoredIntakeEvaluationAgreement;
|
|
59
|
+
readonly revisions: readonly IntakeEvaluationAgreementRevision[];
|
|
60
|
+
}
|
|
61
|
+
export interface IntakeEvaluationAgreementSummary {
|
|
62
|
+
readonly protocol: typeof INTAKE_EVALUATION_AGREEMENT_PROTOCOL;
|
|
63
|
+
readonly scope: EvaluationScope | null;
|
|
64
|
+
readonly source: string | null;
|
|
65
|
+
readonly ruleId: string | null;
|
|
66
|
+
readonly fromEvaluatedAt: number;
|
|
67
|
+
readonly toEvaluatedAt: number;
|
|
68
|
+
readonly total: number;
|
|
69
|
+
readonly truePositive: number;
|
|
70
|
+
readonly falsePositive: number;
|
|
71
|
+
readonly falseNegative: number;
|
|
72
|
+
readonly trueNegative: number;
|
|
73
|
+
readonly pending: number;
|
|
74
|
+
readonly agreed: number;
|
|
75
|
+
readonly disagreed: number;
|
|
76
|
+
readonly decided: number;
|
|
77
|
+
/** agreed / decided in ppm; null when decided === 0. */
|
|
78
|
+
readonly agreementPpm: number | null;
|
|
79
|
+
/** falsePositive / (truePositive + falsePositive) in ppm; null when denominator === 0. */
|
|
80
|
+
readonly falsePositiveRatePpm: number | null;
|
|
81
|
+
/** falseNegative / (trueNegative + falseNegative) in ppm; null when denominator === 0. */
|
|
82
|
+
readonly falseNegativeRatePpm: number | null;
|
|
83
|
+
}
|
|
84
|
+
export interface IntakeEvaluationSyncResult {
|
|
85
|
+
readonly enabled: boolean;
|
|
86
|
+
readonly available: boolean;
|
|
87
|
+
readonly ingested: number;
|
|
88
|
+
readonly correlated: number;
|
|
89
|
+
readonly revised: number;
|
|
90
|
+
readonly invalid: number;
|
|
91
|
+
readonly cursor: IntakeEvaluationFeedCursor;
|
|
92
|
+
}
|
|
93
|
+
export declare function intakeEvaluationCanonicalId(source: string, sourceEventId: string, ruleId: string, policyVersion: string): string;
|
|
94
|
+
export interface NormalizedFeedItem {
|
|
95
|
+
readonly evalId: string;
|
|
96
|
+
readonly feedId: string;
|
|
97
|
+
readonly seq: number;
|
|
98
|
+
readonly recordedAt: number;
|
|
99
|
+
readonly evaluatedAt: number;
|
|
100
|
+
readonly source: string;
|
|
101
|
+
readonly sourceEventId: string;
|
|
102
|
+
readonly ruleId: string;
|
|
103
|
+
readonly policyVersion: string;
|
|
104
|
+
readonly mode: 'observe' | 'auto';
|
|
105
|
+
readonly evaluationLevel: 'ignore' | 'digest' | 'notify' | 'accept';
|
|
106
|
+
readonly wouldAccept: boolean;
|
|
107
|
+
readonly itemId: string | null;
|
|
108
|
+
readonly scope: EvaluationScope | null;
|
|
109
|
+
readonly scopeKey: string | null;
|
|
110
|
+
readonly feedSignals: Readonly<{
|
|
111
|
+
metadataDigest: string;
|
|
112
|
+
sourceDigest: string;
|
|
113
|
+
contentDigest: string | null;
|
|
114
|
+
outcome: Readonly<{
|
|
115
|
+
revision: number;
|
|
116
|
+
settledBy: string;
|
|
117
|
+
executionStatus: string;
|
|
118
|
+
objectiveStatus: string;
|
|
119
|
+
evidenceState: string;
|
|
120
|
+
settledAt: number;
|
|
121
|
+
recordedAt: number;
|
|
122
|
+
ownerWithdrawn: boolean;
|
|
123
|
+
}> | null;
|
|
124
|
+
acceptanceVerdict: Readonly<{
|
|
125
|
+
objectiveStatus: 'achieved' | 'not-achieved' | 'unknown';
|
|
126
|
+
receiptDigest: string;
|
|
127
|
+
completedAt: number;
|
|
128
|
+
recordedAt: number;
|
|
129
|
+
}> | null;
|
|
130
|
+
ownerCorrection: Readonly<{
|
|
131
|
+
kind: 'withdrawn';
|
|
132
|
+
stateReason: string | null;
|
|
133
|
+
recordedAt: number;
|
|
134
|
+
}> | null;
|
|
135
|
+
}>;
|
|
136
|
+
}
|
|
137
|
+
export declare function normalizeFeedCursor(raw: unknown): IntakeEvaluationFeedCursor | null;
|
|
138
|
+
export declare function normalizeFeedPage(raw: unknown): Readonly<{
|
|
139
|
+
items: readonly unknown[];
|
|
140
|
+
hasMore: boolean;
|
|
141
|
+
nextCursor: IntakeEvaluationFeedCursor | null;
|
|
142
|
+
}>;
|
|
143
|
+
/**
|
|
144
|
+
* Durable WP20 `would-accept` correlation ledger stored inside Evaluation SQLite
|
|
145
|
+
* (schema 19) alongside notification outcomes.
|
|
146
|
+
*/
|
|
147
|
+
export declare class IntakeEvaluationAgreementLedger {
|
|
148
|
+
#private;
|
|
149
|
+
constructor(database: DatabaseSync, now: () => number);
|
|
150
|
+
/** Durable incremental feed cursor (`{ afterSeq: 0, afterRecordedAt: 0, afterId: '' }` initially). */
|
|
151
|
+
syncCursor(): IntakeEvaluationFeedCursor;
|
|
152
|
+
/** Advance the durable cursor monotonically; identical or regressive writes are ignored/rejected. */
|
|
153
|
+
advanceSyncCursor(next: IntakeEvaluationFeedCursor): boolean;
|
|
154
|
+
/** Validate and apply one feed item against canonical state and local owner outcomes. */
|
|
155
|
+
applyFeedItem(rawItem: unknown): Readonly<{
|
|
156
|
+
head: StoredIntakeEvaluationAgreement;
|
|
157
|
+
revised: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* Re-evaluate correlations for already-ingested heads that name a `workItemId`
|
|
161
|
+
* so late local notification reactions or owner feedback revisions produce a
|
|
162
|
+
* new immutable agreement revision even without a new WorkItems feed row.
|
|
163
|
+
*/
|
|
164
|
+
reconcileLocalCorrelations(limit?: number): Readonly<{
|
|
165
|
+
checked: number;
|
|
166
|
+
revised: number;
|
|
167
|
+
}>;
|
|
168
|
+
/** Total distinct intake evaluation heads persisted. */
|
|
169
|
+
count(): number;
|
|
170
|
+
/** Full revision history for one intake evaluation key or evalId. */
|
|
171
|
+
history(input: {
|
|
172
|
+
evalId?: string;
|
|
173
|
+
source?: string;
|
|
174
|
+
sourceEventId?: string;
|
|
175
|
+
ruleId?: string;
|
|
176
|
+
policyVersion?: string;
|
|
177
|
+
}): IntakeEvaluationAgreementHistory | undefined;
|
|
178
|
+
/** Paginated list of stored canonical intake evaluation agreement heads. */
|
|
179
|
+
list(options?: {
|
|
180
|
+
scope?: EvaluationScope;
|
|
181
|
+
source?: string;
|
|
182
|
+
ruleId?: string;
|
|
183
|
+
agreementStatus?: IntakeEvaluationAgreementStatus;
|
|
184
|
+
afterEvaluatedAt?: number;
|
|
185
|
+
afterEvalId?: string;
|
|
186
|
+
limit?: number;
|
|
187
|
+
}): Readonly<{
|
|
188
|
+
items: readonly StoredIntakeEvaluationAgreement[];
|
|
189
|
+
hasMore: boolean;
|
|
190
|
+
nextCursor: Readonly<{
|
|
191
|
+
afterEvaluatedAt: number;
|
|
192
|
+
afterEvalId: string;
|
|
193
|
+
}> | null;
|
|
194
|
+
}>;
|
|
195
|
+
/** Summary metrics over persisted intake evaluations in canonical state. */
|
|
196
|
+
summary(options?: {
|
|
197
|
+
scope?: EvaluationScope;
|
|
198
|
+
source?: string;
|
|
199
|
+
ruleId?: string;
|
|
200
|
+
fromEvaluatedAt?: number;
|
|
201
|
+
toEvaluatedAt?: number;
|
|
202
|
+
}): IntakeEvaluationAgreementSummary;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=intake-evaluation-agreement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intake-evaluation-agreement.d.ts","sourceRoot":"","sources":["../src/intake-evaluation-agreement.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAu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