@dsh-ray/assistant-evaluation 0.0.1-seed.0 → 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 +309 -1
- 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 +235 -4
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
export declare const executionStatuses: readonly ["succeeded", "failed", "timed-out", "cancelled", "unknown"];
|
|
2
|
+
export type ExecutionStatus = typeof executionStatuses[number];
|
|
3
|
+
export declare const objectiveStatuses: readonly ["achieved", "partial", "not-achieved", "unknown"];
|
|
4
|
+
export type ObjectiveStatus = typeof objectiveStatuses[number];
|
|
5
|
+
export declare const deliveryStatuses: readonly ["delivered", "failed", "not-required", "unknown"];
|
|
6
|
+
export type DeliveryStatus = typeof deliveryStatuses[number];
|
|
7
|
+
export declare const outcomeSourceKinds: readonly ["automation", "foreground", "delivery", "user-feedback", "system", "evaluator", "import"];
|
|
8
|
+
export type OutcomeSourceKind = typeof outcomeSourceKinds[number];
|
|
9
|
+
export declare const outcomeTrustLevels: readonly ["trusted", "self-reported", "external"];
|
|
10
|
+
export type OutcomeTrust = typeof outcomeTrustLevels[number];
|
|
11
|
+
export type EvaluationJson = null | boolean | number | string | readonly EvaluationJson[] | {
|
|
12
|
+
readonly [key: string]: EvaluationJson;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resource measurements are data, never instructions. The standard keys use
|
|
16
|
+
* integer units so independent producers can aggregate them without rounding.
|
|
17
|
+
* Additional JSON keys are allowed, but the store applies byte/depth/node limits.
|
|
18
|
+
*/
|
|
19
|
+
export type EvaluationMetrics = Readonly<{
|
|
20
|
+
costUsdMicros?: number;
|
|
21
|
+
latencyMs?: number;
|
|
22
|
+
inputTokens?: number;
|
|
23
|
+
outputTokens?: number;
|
|
24
|
+
toolCalls?: number;
|
|
25
|
+
retries?: number;
|
|
26
|
+
[key: string]: EvaluationJson | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export interface EvaluationScope {
|
|
29
|
+
/** Absolute workspace path. Exact workspace + preset is the isolation key. */
|
|
30
|
+
workspace: string;
|
|
31
|
+
preset: string;
|
|
32
|
+
}
|
|
33
|
+
export interface OutcomeSource {
|
|
34
|
+
kind: OutcomeSourceKind;
|
|
35
|
+
/** Stable Host-owned producer identifier, not model prose. */
|
|
36
|
+
id: string;
|
|
37
|
+
}
|
|
38
|
+
export interface OutcomeEvaluator {
|
|
39
|
+
/** Evaluator implementation or assertion suite. */
|
|
40
|
+
id: string;
|
|
41
|
+
/** Version of the logic that assigned the three statuses. */
|
|
42
|
+
version: string;
|
|
43
|
+
}
|
|
44
|
+
export interface EvaluationEvidenceRef {
|
|
45
|
+
/** Bounded evidence class such as `run`, `receipt`, `assertion` or `feedback`. */
|
|
46
|
+
kind: string;
|
|
47
|
+
/** Opaque durable reference. Raw evidence is not copied into this ledger. */
|
|
48
|
+
ref: string;
|
|
49
|
+
/** Optional content digest supplied by the trusted producer. */
|
|
50
|
+
digest?: string;
|
|
51
|
+
}
|
|
52
|
+
/** One append-only assessment. Execution success never implies objective success or delivery. */
|
|
53
|
+
export interface OutcomeEnvelope {
|
|
54
|
+
scope: EvaluationScope;
|
|
55
|
+
situation: string;
|
|
56
|
+
executionStatus: ExecutionStatus;
|
|
57
|
+
objectiveStatus: ObjectiveStatus;
|
|
58
|
+
deliveryStatus: DeliveryStatus;
|
|
59
|
+
source: OutcomeSource;
|
|
60
|
+
trust: OutcomeTrust;
|
|
61
|
+
evidence: readonly EvaluationEvidenceRef[];
|
|
62
|
+
metrics: EvaluationMetrics;
|
|
63
|
+
occurredAt: number;
|
|
64
|
+
idempotencyKey: string;
|
|
65
|
+
evaluator: OutcomeEvaluator;
|
|
66
|
+
}
|
|
67
|
+
export interface StoredOutcome extends OutcomeEnvelope {
|
|
68
|
+
ownerFeedbackState?: Readonly<OwnerObjectiveState>;
|
|
69
|
+
id: string;
|
|
70
|
+
/** Canonical JSON tuple of normalized absolute workspace and preset. */
|
|
71
|
+
scopeKey: string;
|
|
72
|
+
recordedAt: number;
|
|
73
|
+
}
|
|
74
|
+
export interface EvaluationTaskProjection {
|
|
75
|
+
/** Stable scope-bound task identity. Automation outcomes share the exact run reference. */
|
|
76
|
+
subjectKind: 'automation-run' | 'foreground-turn' | 'goal-step' | 'goal-outcome' | 'work-item' | 'outcome';
|
|
77
|
+
subjectRef: string;
|
|
78
|
+
/** Conflicting trusted owner judgements are quarantined instead of resolved by arrival order. */
|
|
79
|
+
status: 'ready' | 'objective-conflict';
|
|
80
|
+
primaryOutcomeId: string;
|
|
81
|
+
executionOutcomeId?: string;
|
|
82
|
+
objectiveOutcomeId?: string;
|
|
83
|
+
deliveryOutcomeId?: string;
|
|
84
|
+
/** Monotonic semantic revision consumed by downstream learning ledgers. */
|
|
85
|
+
learningVersion: number;
|
|
86
|
+
/** SHA-256 of the complete canonical learning projection at this revision. */
|
|
87
|
+
learningDigest: string;
|
|
88
|
+
/** `retract` removes any older eligible vote for this task. */
|
|
89
|
+
learningDisposition: 'upsert' | 'retract';
|
|
90
|
+
}
|
|
91
|
+
/** One task-level projection assembled from immutable append-only outcome records. */
|
|
92
|
+
export interface ProjectedOutcome extends StoredOutcome {
|
|
93
|
+
projection: Readonly<EvaluationTaskProjection>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Minimal immutable proof returned to another trusted Host service. Metrics,
|
|
97
|
+
* producer idempotency keys and record timestamps stay private to the ledger.
|
|
98
|
+
*/
|
|
99
|
+
export interface TrustedOutcomeReceipt {
|
|
100
|
+
id: string;
|
|
101
|
+
scope: Readonly<EvaluationScope>;
|
|
102
|
+
/** Canonical JSON tuple of normalized absolute workspace and preset. */
|
|
103
|
+
scopeKey: string;
|
|
104
|
+
situation: string;
|
|
105
|
+
executionStatus: ExecutionStatus;
|
|
106
|
+
objectiveStatus: ObjectiveStatus;
|
|
107
|
+
deliveryStatus: DeliveryStatus;
|
|
108
|
+
source: Readonly<OutcomeSource>;
|
|
109
|
+
trust: 'trusted';
|
|
110
|
+
evidence: readonly Readonly<EvaluationEvidenceRef>[];
|
|
111
|
+
occurredAt: number;
|
|
112
|
+
evaluator: Readonly<OutcomeEvaluator>;
|
|
113
|
+
}
|
|
114
|
+
export interface TrustedTaskExecutionComponent {
|
|
115
|
+
outcomeId: string;
|
|
116
|
+
status: ExecutionStatus;
|
|
117
|
+
source: Readonly<OutcomeSource>;
|
|
118
|
+
evidence: readonly Readonly<EvaluationEvidenceRef>[];
|
|
119
|
+
occurredAt: number;
|
|
120
|
+
evaluator: Readonly<OutcomeEvaluator>;
|
|
121
|
+
}
|
|
122
|
+
export interface TrustedTaskObjectiveComponent {
|
|
123
|
+
outcomeId: string;
|
|
124
|
+
status: ObjectiveStatus;
|
|
125
|
+
source: Readonly<OutcomeSource>;
|
|
126
|
+
evidence: readonly Readonly<EvaluationEvidenceRef>[];
|
|
127
|
+
occurredAt: number;
|
|
128
|
+
evaluator: Readonly<OutcomeEvaluator>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Canonical, versioned task state exported to Evolution. `triggerOutcomeId` is
|
|
132
|
+
* merely the append-only outbox row that caused reconciliation; every retry
|
|
133
|
+
* resolves the current task projection represented by `projection`.
|
|
134
|
+
*
|
|
135
|
+
* Execution and objective provenance are deliberately separate. For an
|
|
136
|
+
* Automation task, execution comes from its immutable production receipt while
|
|
137
|
+
* the objective may come from a later authenticated owner judgement. A flat
|
|
138
|
+
* source/evidence tuple cannot truthfully represent both authorities.
|
|
139
|
+
*/
|
|
140
|
+
export interface TrustedTaskLearningProjectionReceipt {
|
|
141
|
+
triggerOutcomeId: string;
|
|
142
|
+
scope: Readonly<EvaluationScope>;
|
|
143
|
+
scopeKey: string;
|
|
144
|
+
/**
|
|
145
|
+
* Monotonic canonical-learning revision for the complete scope. It advances
|
|
146
|
+
* in the same Evaluation writer transaction that changes a task projection
|
|
147
|
+
* and queues its durable projection outbox row.
|
|
148
|
+
*/
|
|
149
|
+
scopeWatermark: number;
|
|
150
|
+
situation: string;
|
|
151
|
+
execution?: Readonly<TrustedTaskExecutionComponent>;
|
|
152
|
+
objective?: Readonly<TrustedTaskObjectiveComponent>;
|
|
153
|
+
projection: Readonly<{
|
|
154
|
+
subjectKind: 'automation-run' | 'foreground-turn' | 'goal-step' | 'goal-outcome' | 'work-item' | 'outcome';
|
|
155
|
+
subjectRef: string;
|
|
156
|
+
version: number;
|
|
157
|
+
digest: string;
|
|
158
|
+
disposition: 'upsert' | 'retract';
|
|
159
|
+
/** Exact trusted objective row selected by canonical precedence. */
|
|
160
|
+
evidenceOutcomeId?: string;
|
|
161
|
+
}>;
|
|
162
|
+
}
|
|
163
|
+
/** A restart-safe incremental view of current trusted canonical task heads. */
|
|
164
|
+
export interface TrustedTaskLearningProjectionFeedPage {
|
|
165
|
+
items: readonly Readonly<{
|
|
166
|
+
watermark: number;
|
|
167
|
+
receipt: TrustedTaskLearningProjectionReceipt;
|
|
168
|
+
}>[];
|
|
169
|
+
nextCursor: Readonly<{
|
|
170
|
+
scopeKey: string;
|
|
171
|
+
watermark: number;
|
|
172
|
+
}>;
|
|
173
|
+
scopeWatermark: number;
|
|
174
|
+
hasMore: boolean;
|
|
175
|
+
}
|
|
176
|
+
/** Exact current task identity frozen into an Evolution evidence window. */
|
|
177
|
+
export interface EvaluationLearningEvidenceTuple {
|
|
178
|
+
subjectKind: 'automation-run' | 'foreground-turn' | 'goal-step' | 'goal-outcome' | 'work-item' | 'outcome';
|
|
179
|
+
subjectRef: string;
|
|
180
|
+
version: number;
|
|
181
|
+
digest: string;
|
|
182
|
+
disposition: 'upsert';
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Exact current canonical task identity. Unlike promotion evidence, a Host
|
|
186
|
+
* reconciliation may need to fence a retraction so stale downstream state can
|
|
187
|
+
* be invalidated under the same Evaluation writer lock.
|
|
188
|
+
*/
|
|
189
|
+
export interface EvaluationCanonicalLearningEvidenceTuple {
|
|
190
|
+
subjectKind: 'automation-run' | 'foreground-turn' | 'goal-step' | 'goal-outcome' | 'work-item' | 'outcome';
|
|
191
|
+
subjectRef: string;
|
|
192
|
+
version: number;
|
|
193
|
+
digest: string;
|
|
194
|
+
disposition: 'upsert' | 'retract';
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A complete scope-level fence snapshot. The callback-capability accepting
|
|
198
|
+
* this type is synchronous: it holds Evaluation's writer lock for its entire
|
|
199
|
+
* execution, and callers must acquire any downstream lock only afterwards.
|
|
200
|
+
*/
|
|
201
|
+
export interface EvaluationLearningWriterFence {
|
|
202
|
+
scopeWatermark: number;
|
|
203
|
+
evidence: readonly Readonly<EvaluationLearningEvidenceTuple>[];
|
|
204
|
+
}
|
|
205
|
+
/** A scope-level fence for exact canonical reconciliation, including retracts. */
|
|
206
|
+
export interface EvaluationCanonicalLearningWriterFence {
|
|
207
|
+
scopeWatermark: number;
|
|
208
|
+
evidence: readonly Readonly<EvaluationCanonicalLearningEvidenceTuple>[];
|
|
209
|
+
}
|
|
210
|
+
export type EvaluationLearningWriterFenceFailure = 'evidence-changed' | 'projection-pending' | 'watermark-changed';
|
|
211
|
+
export type EvaluationLearningWriterFenceResult<T> = Readonly<{
|
|
212
|
+
matched: true;
|
|
213
|
+
value: T;
|
|
214
|
+
}> | Readonly<{
|
|
215
|
+
matched: false;
|
|
216
|
+
reason: EvaluationLearningWriterFenceFailure;
|
|
217
|
+
}>;
|
|
218
|
+
export declare const TRUSTED_EVALUATION_PRODUCER_PROTOCOL: "assistant-evaluation/trusted-producer/v1";
|
|
219
|
+
export interface TrustedAutomationEvaluationClaims {
|
|
220
|
+
scope: Readonly<EvaluationScope>;
|
|
221
|
+
automationId: string;
|
|
222
|
+
situation: string;
|
|
223
|
+
runId: string;
|
|
224
|
+
executionMode: 'production';
|
|
225
|
+
executionStatus: ExecutionStatus;
|
|
226
|
+
objectiveStatus: Extract<ObjectiveStatus, 'achieved' | 'not-achieved' | 'unknown'>;
|
|
227
|
+
deliveryStatus: Extract<DeliveryStatus, 'not-required' | 'unknown'>;
|
|
228
|
+
metrics: EvaluationMetrics;
|
|
229
|
+
occurredAt: number;
|
|
230
|
+
idempotencyKey: string;
|
|
231
|
+
evaluatorVersion: `terminal-v${number}` | `host-runbook-v${number}`;
|
|
232
|
+
}
|
|
233
|
+
export interface TrustedAutomationEvaluationAppendInput {
|
|
234
|
+
capabilityReceipt: unknown;
|
|
235
|
+
automationId: string;
|
|
236
|
+
runId: string;
|
|
237
|
+
idempotencyKey: string;
|
|
238
|
+
}
|
|
239
|
+
/** Process-local owner carried by a registration across Cordis sibling scopes. */
|
|
240
|
+
export interface TrustedEvaluationRegistrationOwner {
|
|
241
|
+
ownsTrustedAutomationEvaluationRegistration(registration: Readonly<TrustedAutomationEvaluationRegistration>): boolean;
|
|
242
|
+
ownsTrustedDeliveryEvaluationRegistration(registration: Readonly<TrustedDeliveryEvaluationRegistration>): boolean;
|
|
243
|
+
ownsTrustedVerifierEvaluationRegistration(registration: Readonly<TrustedVerifierEvaluationRegistration>): boolean;
|
|
244
|
+
ownsTrustedWorkItemEvaluationRegistration(registration: Readonly<TrustedWorkItemEvaluationRegistration>): boolean;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Settled work-item claims one trusted Evaluation revision.
|
|
248
|
+
*
|
|
249
|
+
* The producer may state only facts it durably observed: the item, the outcome
|
|
250
|
+
* revision, how it settled, the evidence state and the deterministic identity.
|
|
251
|
+
* Objective and delivery status are literal `'unknown'` and there is no
|
|
252
|
+
* execution-status field at all, so this capability is type-level incapable of
|
|
253
|
+
* claiming that a work item achieved an objective.
|
|
254
|
+
*/
|
|
255
|
+
export interface TrustedWorkItemEvaluationClaims {
|
|
256
|
+
scope: Readonly<EvaluationScope>;
|
|
257
|
+
itemId: string;
|
|
258
|
+
outcomeRevision: number;
|
|
259
|
+
settledBy: WorkItemSettledBy;
|
|
260
|
+
evidenceState: Extract<WorkItemEvaluationEvidenceState, 'observed' | 'unverified' | 'not-applicable'>;
|
|
261
|
+
situation: string;
|
|
262
|
+
occurredAt: number;
|
|
263
|
+
idempotencyKey: string;
|
|
264
|
+
/** Digest of the immutable outcome revision this claim exports. */
|
|
265
|
+
digest: string;
|
|
266
|
+
metrics: EvaluationMetrics;
|
|
267
|
+
objectiveStatus: 'unknown';
|
|
268
|
+
deliveryStatus: 'unknown';
|
|
269
|
+
}
|
|
270
|
+
/** Work-item outcome vocabulary mirrored structurally; no runtime package dependency. */
|
|
271
|
+
export type WorkItemSettledBy = 'report-ready' | 'report-blocked' | 'report-failed' | 'withdrawn' | 'retry-exhausted' | 'observed-evidence' | 'window-expired'
|
|
272
|
+
/**
|
|
273
|
+
* Every followed external thread closed, so the bounded settlement wait ended
|
|
274
|
+
* before its deadline without in-window delivery evidence. The value is
|
|
275
|
+
* exported verbatim: it is still an unverified settlement and still cannot
|
|
276
|
+
* assert an objective.
|
|
277
|
+
*/
|
|
278
|
+
| 'closed-by-thread';
|
|
279
|
+
/** Work-item evidence vocabulary mirrored structurally. */
|
|
280
|
+
export type WorkItemEvaluationEvidenceState = 'pending' | 'observed' | 'unverified' | 'not-applicable';
|
|
281
|
+
/** Private work-items-to-ledger capability; append is idempotent on the claims identity. */
|
|
282
|
+
export interface TrustedWorkItemEvaluationRegistration {
|
|
283
|
+
protocol: 'assistant-work-items/evaluation/v1';
|
|
284
|
+
generation: string;
|
|
285
|
+
owner: TrustedEvaluationRegistrationOwner;
|
|
286
|
+
append(claims: Readonly<TrustedWorkItemEvaluationClaims>): Promise<void>;
|
|
287
|
+
}
|
|
288
|
+
/** Private verifier-to-ledger capability. It carries the immutable acceptance
|
|
289
|
+
* pair and the Host re-read execution, never a caller supplied verdict. */
|
|
290
|
+
export interface TrustedVerifierEvaluationRegistration {
|
|
291
|
+
protocol: 'assistant-verifier/evaluation/v1';
|
|
292
|
+
generation: string;
|
|
293
|
+
owner: TrustedEvaluationRegistrationOwner;
|
|
294
|
+
append(input: Readonly<{
|
|
295
|
+
contract: unknown;
|
|
296
|
+
receipt: unknown;
|
|
297
|
+
execution: unknown;
|
|
298
|
+
}>): Promise<void>;
|
|
299
|
+
}
|
|
300
|
+
export interface TrustedAutomationEvaluationRegistration {
|
|
301
|
+
protocol: typeof TRUSTED_EVALUATION_PRODUCER_PROTOCOL;
|
|
302
|
+
producer: 'assistant-automations';
|
|
303
|
+
generation: string;
|
|
304
|
+
owner: TrustedEvaluationRegistrationOwner;
|
|
305
|
+
issueCapability(claims: TrustedAutomationEvaluationClaims): unknown;
|
|
306
|
+
append(input: TrustedAutomationEvaluationAppendInput): StoredOutcome;
|
|
307
|
+
}
|
|
308
|
+
/** Host-attested owner command. The previous version and label are a CAS precondition. */
|
|
309
|
+
export interface OwnerObjectiveCommand {
|
|
310
|
+
operationId: string;
|
|
311
|
+
principalRecordId: string;
|
|
312
|
+
principalVersion: number;
|
|
313
|
+
action: 'initial' | 'correct' | 'withdraw';
|
|
314
|
+
expectedVersion?: number;
|
|
315
|
+
previousStatus?: ObjectiveStatus;
|
|
316
|
+
}
|
|
317
|
+
export interface OwnerObjectiveState {
|
|
318
|
+
version: number;
|
|
319
|
+
objectiveStatus: ObjectiveStatus;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Structural view of the process-local Goals proof used to authorize owner
|
|
323
|
+
* feedback for one terminal whole-goal assessment. Evaluation deliberately
|
|
324
|
+
* does not import the optional Goals package at runtime.
|
|
325
|
+
*/
|
|
326
|
+
export interface TrustedGoalOutcomeOwnerProof {
|
|
327
|
+
protocol: 'assistant-goals/owner-goal-outcome-feedback/v1';
|
|
328
|
+
locator: Readonly<{
|
|
329
|
+
protocol: 'assistant-goals/owner-goal-outcome-locator/v1';
|
|
330
|
+
ownerRouteId: string;
|
|
331
|
+
principalId: string;
|
|
332
|
+
principalRecordId: string;
|
|
333
|
+
principalVersion: number;
|
|
334
|
+
workspace: string;
|
|
335
|
+
preset: string;
|
|
336
|
+
bindingId: string;
|
|
337
|
+
bindingVersion: number;
|
|
338
|
+
bindingGeneration: number;
|
|
339
|
+
sessionId: string;
|
|
340
|
+
goalId: string;
|
|
341
|
+
assessmentId: string;
|
|
342
|
+
}>;
|
|
343
|
+
goal: Readonly<{
|
|
344
|
+
definitionVersion: number;
|
|
345
|
+
definitionDigest: string;
|
|
346
|
+
nativeGoalId: string;
|
|
347
|
+
phase: 'complete' | 'blocked';
|
|
348
|
+
}>;
|
|
349
|
+
runId: string;
|
|
350
|
+
profile: Readonly<{
|
|
351
|
+
id: string;
|
|
352
|
+
version: number;
|
|
353
|
+
digest: string;
|
|
354
|
+
}>;
|
|
355
|
+
contract: Readonly<{
|
|
356
|
+
id: string;
|
|
357
|
+
digest: string;
|
|
358
|
+
}>;
|
|
359
|
+
receipt: Readonly<{
|
|
360
|
+
id: string;
|
|
361
|
+
digest: string;
|
|
362
|
+
objectiveStatus: Extract<ObjectiveStatus, 'achieved' | 'not-achieved'>;
|
|
363
|
+
completedAt: number;
|
|
364
|
+
validUntil: number;
|
|
365
|
+
}>;
|
|
366
|
+
proofDigest: string;
|
|
367
|
+
}
|
|
368
|
+
/** Current WorkItems-generation proof for an exact durable terminal report. */
|
|
369
|
+
export interface TrustedWorkItemOwnerFeedbackProof {
|
|
370
|
+
protocol: 'assistant-work-items/owner-report-feedback/v1';
|
|
371
|
+
itemId: string;
|
|
372
|
+
reportRevision: number;
|
|
373
|
+
reportDigest: string;
|
|
374
|
+
sourceId: string;
|
|
375
|
+
itemKind: string;
|
|
376
|
+
scope: Readonly<EvaluationScope>;
|
|
377
|
+
owner: Readonly<{
|
|
378
|
+
ownerRouteId: string;
|
|
379
|
+
principalId: string;
|
|
380
|
+
principalRecordId: string;
|
|
381
|
+
principalVersion: number;
|
|
382
|
+
}>;
|
|
383
|
+
originBindingId: string;
|
|
384
|
+
production: Readonly<{
|
|
385
|
+
automationId: string;
|
|
386
|
+
occurrenceId: string;
|
|
387
|
+
runId: string;
|
|
388
|
+
definitionHash: string;
|
|
389
|
+
definitionVersion: number;
|
|
390
|
+
executionStatus: Exclude<ExecutionStatus, 'unknown'>;
|
|
391
|
+
completedAt: number;
|
|
392
|
+
quiescent: true;
|
|
393
|
+
budgetSettlementState: 'finalized';
|
|
394
|
+
}>;
|
|
395
|
+
supplier: Readonly<{
|
|
396
|
+
provider: string;
|
|
397
|
+
model: string;
|
|
398
|
+
reasoningEffort?: string;
|
|
399
|
+
}>;
|
|
400
|
+
planDigest: string;
|
|
401
|
+
task: Readonly<{
|
|
402
|
+
brief: string;
|
|
403
|
+
briefTruncated: boolean;
|
|
404
|
+
}>;
|
|
405
|
+
report: Readonly<{
|
|
406
|
+
status: 'ready' | 'blocked' | 'failed';
|
|
407
|
+
text: string;
|
|
408
|
+
truncated: boolean;
|
|
409
|
+
recordedAt: number;
|
|
410
|
+
}>;
|
|
411
|
+
proofDigest: string;
|
|
412
|
+
}
|
|
413
|
+
interface TrustedDeliveryEvaluationClaimsBase {
|
|
414
|
+
scope: Readonly<EvaluationScope>;
|
|
415
|
+
situation: string;
|
|
416
|
+
/** Legacy Automation subject reference retained for rolling producer compatibility. */
|
|
417
|
+
runId: string;
|
|
418
|
+
outboxId: string;
|
|
419
|
+
chatId: string;
|
|
420
|
+
principalId: string;
|
|
421
|
+
bindingId: string;
|
|
422
|
+
objectiveStatus: ObjectiveStatus;
|
|
423
|
+
ownerCommand?: Readonly<OwnerObjectiveCommand>;
|
|
424
|
+
initialIdempotencyKey?: string;
|
|
425
|
+
occurredAt: number;
|
|
426
|
+
idempotencyKey: string;
|
|
427
|
+
}
|
|
428
|
+
export type TrustedDeliveryEvaluationClaims = TrustedDeliveryEvaluationClaimsBase & (Readonly<{
|
|
429
|
+
/** Defaults to the legacy Automation subject when omitted by an older Delivery producer. */
|
|
430
|
+
subjectKind?: 'automation-run' | 'foreground-turn';
|
|
431
|
+
/** Defaults to `runId` for legacy Automation feedback. */
|
|
432
|
+
subjectRef?: string;
|
|
433
|
+
goalOutcomeCapability?: never;
|
|
434
|
+
workItemOutcomeCapability?: never;
|
|
435
|
+
}> | Readonly<{
|
|
436
|
+
subjectKind: 'goal-outcome';
|
|
437
|
+
subjectRef: string;
|
|
438
|
+
/** Opaque process-local capability minted by the current Goals generation. */
|
|
439
|
+
goalOutcomeCapability: unknown;
|
|
440
|
+
workItemOutcomeCapability?: never;
|
|
441
|
+
}> | Readonly<{
|
|
442
|
+
subjectKind: 'work-item';
|
|
443
|
+
subjectRef: string;
|
|
444
|
+
/** Opaque process-local capability minted by the current WorkItems generation. */
|
|
445
|
+
workItemOutcomeCapability: unknown;
|
|
446
|
+
goalOutcomeCapability?: never;
|
|
447
|
+
}>);
|
|
448
|
+
export interface TrustedDeliveryEvaluationAppendInput {
|
|
449
|
+
capabilityReceipt: unknown;
|
|
450
|
+
runId: string;
|
|
451
|
+
outboxId: string;
|
|
452
|
+
chatId: string;
|
|
453
|
+
principalId: string;
|
|
454
|
+
bindingId: string;
|
|
455
|
+
idempotencyKey: string;
|
|
456
|
+
}
|
|
457
|
+
export interface TrustedDeliveryEvaluationRegistration {
|
|
458
|
+
ownerRevisionProtocol?: 'owner-objective-revision/v1' | 'owner-objective-revision/v2';
|
|
459
|
+
protocol: typeof TRUSTED_EVALUATION_PRODUCER_PROTOCOL;
|
|
460
|
+
producer: 'assistant-delivery';
|
|
461
|
+
generation: string;
|
|
462
|
+
owner: TrustedEvaluationRegistrationOwner;
|
|
463
|
+
issueCapability(claims: TrustedDeliveryEvaluationClaims): unknown;
|
|
464
|
+
inspect?(capabilityReceipt: unknown): OwnerObjectiveState | undefined;
|
|
465
|
+
append(input: TrustedDeliveryEvaluationAppendInput): StoredOutcome;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A model/evaluator judgement linked to an existing Host outcome. It is kept in
|
|
469
|
+
* a separate table so a later self-assessment cannot double-count task volume or
|
|
470
|
+
* silently upgrade its own trust.
|
|
471
|
+
*/
|
|
472
|
+
export interface SelfAssessmentInput {
|
|
473
|
+
outcomeId: string;
|
|
474
|
+
scope: EvaluationScope;
|
|
475
|
+
objectiveStatus: ObjectiveStatus;
|
|
476
|
+
evidence: readonly EvaluationEvidenceRef[];
|
|
477
|
+
occurredAt: number;
|
|
478
|
+
idempotencyKey: string;
|
|
479
|
+
evaluator: OutcomeEvaluator;
|
|
480
|
+
}
|
|
481
|
+
export interface StoredSelfAssessment extends SelfAssessmentInput {
|
|
482
|
+
id: string;
|
|
483
|
+
scopeKey: string;
|
|
484
|
+
situation: string;
|
|
485
|
+
/** Immutable terminal statuses inherited from the referenced Host outcome. */
|
|
486
|
+
executionStatus: ExecutionStatus;
|
|
487
|
+
deliveryStatus: DeliveryStatus;
|
|
488
|
+
trust: 'self-reported';
|
|
489
|
+
recordedAt: number;
|
|
490
|
+
}
|
|
491
|
+
export interface OutcomeQuery {
|
|
492
|
+
/** Mandatory exact scope: cross-workspace scans are not part of the API. */
|
|
493
|
+
scope: EvaluationScope;
|
|
494
|
+
situation?: string;
|
|
495
|
+
executionStatus?: ExecutionStatus;
|
|
496
|
+
objectiveStatus?: ObjectiveStatus;
|
|
497
|
+
deliveryStatus?: DeliveryStatus;
|
|
498
|
+
sourceKind?: OutcomeSourceKind;
|
|
499
|
+
trust?: OutcomeTrust;
|
|
500
|
+
/** Host-owned maintenance filter; exact prefix semantics, not a glob. */
|
|
501
|
+
excludeSituationPrefix?: string;
|
|
502
|
+
fromOccurredAt?: number;
|
|
503
|
+
toOccurredAt?: number;
|
|
504
|
+
/** Required to be a positive integer no greater than the configured hard cap. */
|
|
505
|
+
limit?: number;
|
|
506
|
+
}
|
|
507
|
+
export interface OutcomeSummaryQuery {
|
|
508
|
+
scope: EvaluationScope;
|
|
509
|
+
situation?: string;
|
|
510
|
+
/** Host-owned maintenance filter; exact prefix semantics, not a glob. */
|
|
511
|
+
excludeSituationPrefix?: string;
|
|
512
|
+
fromOccurredAt?: number;
|
|
513
|
+
toOccurredAt?: number;
|
|
514
|
+
}
|
|
515
|
+
export interface OutcomeSummary {
|
|
516
|
+
scope: EvaluationScope;
|
|
517
|
+
scopeKey: string;
|
|
518
|
+
situation?: string;
|
|
519
|
+
fromOccurredAt: number;
|
|
520
|
+
toOccurredAt: number;
|
|
521
|
+
total: number;
|
|
522
|
+
execution: Readonly<{
|
|
523
|
+
succeeded: number;
|
|
524
|
+
failed: number;
|
|
525
|
+
timedOut: number;
|
|
526
|
+
cancelled: number;
|
|
527
|
+
unknown: number;
|
|
528
|
+
}>;
|
|
529
|
+
objective: Readonly<{
|
|
530
|
+
achieved: number;
|
|
531
|
+
partial: number;
|
|
532
|
+
notAchieved: number;
|
|
533
|
+
unknown: number;
|
|
534
|
+
}>;
|
|
535
|
+
delivery: Readonly<{
|
|
536
|
+
delivered: number;
|
|
537
|
+
failed: number;
|
|
538
|
+
notRequired: number;
|
|
539
|
+
unknown: number;
|
|
540
|
+
}>;
|
|
541
|
+
trust: Readonly<{
|
|
542
|
+
trusted: number;
|
|
543
|
+
selfReported: number;
|
|
544
|
+
external: number;
|
|
545
|
+
}>;
|
|
546
|
+
metrics: Readonly<{
|
|
547
|
+
costUsdMicros: number;
|
|
548
|
+
inputTokens: number;
|
|
549
|
+
outputTokens: number;
|
|
550
|
+
toolCalls: number;
|
|
551
|
+
averageLatencyMs?: number;
|
|
552
|
+
}>;
|
|
553
|
+
}
|
|
554
|
+
export interface EvaluationHealth {
|
|
555
|
+
ready: true;
|
|
556
|
+
schemaVersion: number;
|
|
557
|
+
outcomes: number;
|
|
558
|
+
trustedOutcomes: number;
|
|
559
|
+
selfReportedOutcomes: number;
|
|
560
|
+
externalOutcomes: number;
|
|
561
|
+
selfAssessments: number;
|
|
562
|
+
taskProjections: number;
|
|
563
|
+
conflictedTaskProjections: number;
|
|
564
|
+
/** Append-only triggers still waiting to project their current canonical task state. */
|
|
565
|
+
pendingProjections: number;
|
|
566
|
+
retryingProjections: number;
|
|
567
|
+
projectionAttempts: number;
|
|
568
|
+
/** WP22 notification heads and their append-only revisions. */
|
|
569
|
+
notificationOutcomes: number;
|
|
570
|
+
notificationOutcomeRevisions: number;
|
|
571
|
+
/** WP22 synced WP20 `would-accept` intake evaluation heads. */
|
|
572
|
+
intakeEvaluations: number;
|
|
573
|
+
oldestPendingProjectionAt?: number;
|
|
574
|
+
latestOccurredAt?: number;
|
|
575
|
+
}
|
|
576
|
+
/** Durable Evaluation-owned work item for the optional Evolution sink. */
|
|
577
|
+
export interface EvaluationProjectionOutboxEntry {
|
|
578
|
+
evaluationId: string;
|
|
579
|
+
scope: Readonly<EvaluationScope>;
|
|
580
|
+
status: 'pending';
|
|
581
|
+
attemptCount: number;
|
|
582
|
+
nextAttemptAt: number;
|
|
583
|
+
lastFailureCode?: string;
|
|
584
|
+
createdAt: number;
|
|
585
|
+
updatedAt: number;
|
|
586
|
+
}
|
|
587
|
+
export interface EvaluationProjectionState {
|
|
588
|
+
evaluationId: string;
|
|
589
|
+
scope: Readonly<EvaluationScope>;
|
|
590
|
+
/** not-required means this subject is unsupported by the optional Evolution sink. */
|
|
591
|
+
status: 'pending' | 'recorded' | 'not-required';
|
|
592
|
+
attemptCount: number;
|
|
593
|
+
nextAttemptAt: number;
|
|
594
|
+
lastFailureCode?: string;
|
|
595
|
+
createdAt: number;
|
|
596
|
+
updatedAt: number;
|
|
597
|
+
}
|
|
598
|
+
/** Runtime limits exposed to Host producers before they build a durable append intent. */
|
|
599
|
+
export interface EvaluationLimits {
|
|
600
|
+
maxQueryLimit: number;
|
|
601
|
+
maxReviewOutcomes: number;
|
|
602
|
+
maxSituationBytes: number;
|
|
603
|
+
maxMetricsBytes: number;
|
|
604
|
+
maxEvidenceRefs: number;
|
|
605
|
+
defaultSummaryWindowMs: number;
|
|
606
|
+
maxSummaryWindowMs: number;
|
|
607
|
+
}
|
|
608
|
+
export interface EvaluationReviewRequest {
|
|
609
|
+
situation?: string;
|
|
610
|
+
lookbackDays?: number;
|
|
611
|
+
limit?: number;
|
|
612
|
+
}
|
|
613
|
+
export interface EvaluationSelfAssessRequest {
|
|
614
|
+
outcomeId: string;
|
|
615
|
+
objectiveStatus: ObjectiveStatus;
|
|
616
|
+
/** IDs returned by memory_search_confirmed. They remain claimed references, not trusted evidence. */
|
|
617
|
+
memoryIds?: readonly string[];
|
|
618
|
+
}
|
|
619
|
+
export interface EvaluationReview {
|
|
620
|
+
summary: OutcomeSummary;
|
|
621
|
+
outcomes: readonly ProjectedOutcome[];
|
|
622
|
+
/** Latest self-report per reviewed outcome; it never changes the parent summary. */
|
|
623
|
+
selfAssessments: readonly StoredSelfAssessment[];
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* WP22 per-notification outcome vocabulary. `accepted`/`rejected` require a
|
|
627
|
+
* current Host-recorded owner judgement; `reacted` is an owner reply (or a
|
|
628
|
+
* partial judgement); `expired-unhandled` is a sent notification without any
|
|
629
|
+
* reaction once the configured response window elapsed.
|
|
630
|
+
*/
|
|
631
|
+
export declare const notificationOutcomes: readonly ["pending", "delivered", "reacted", "accepted", "rejected", "expired-unhandled", "failed"];
|
|
632
|
+
export type NotificationOutcome = typeof notificationOutcomes[number];
|
|
633
|
+
/**
|
|
634
|
+
* Optional delivery-state projection added by classifier v2 (E3a).
|
|
635
|
+
*
|
|
636
|
+
* It never replaces the frozen legacy 7-state `outcome`: E1 snapshots,
|
|
637
|
+
* owner-console schemas and old v1 digests stay untouched. `adopted` is a
|
|
638
|
+
* reserved value until a Host adoption fact source exists.
|
|
639
|
+
*/
|
|
640
|
+
export declare const notificationDeliveryStates: readonly ["read", "ignored", "missed", "adopted"];
|
|
641
|
+
export type NotificationDeliveryState = typeof notificationDeliveryStates[number];
|
|
642
|
+
/** Adapter-declared completeness of read receipts; only `complete` can prove a miss. */
|
|
643
|
+
export type NotificationReadReceipts = 'none' | 'best-effort' | 'complete';
|
|
644
|
+
export declare const NOTIFICATION_OUTCOME_RECORD_PROTOCOL: "assistant-evaluation/notification-outcome/v1";
|
|
645
|
+
export declare const NOTIFICATION_OUTCOME_FACTS_PROTOCOL: "assistant-delivery/notification-outcome-facts/v1";
|
|
646
|
+
/** Structural mirror of Delivery's text-free notification facts; no runtime package dependency. */
|
|
647
|
+
export interface NotificationOutcomeFactInput {
|
|
648
|
+
auditSequence: number;
|
|
649
|
+
outboxId: string;
|
|
650
|
+
bindingId: string;
|
|
651
|
+
scope: Readonly<EvaluationScope>;
|
|
652
|
+
lane: string;
|
|
653
|
+
sourceId: string;
|
|
654
|
+
purpose: 'result' | 'attention' | 'answer';
|
|
655
|
+
purposeSource: 'declared' | 'lane' | 'default';
|
|
656
|
+
workItemId?: string;
|
|
657
|
+
questionId?: string;
|
|
658
|
+
answersQuestionId?: string;
|
|
659
|
+
verdict: 'would-accept' | 'would-attach' | 'would-reject';
|
|
660
|
+
reasons: readonly string[];
|
|
661
|
+
auditedAt: number;
|
|
662
|
+
transport: Readonly<{
|
|
663
|
+
status: string;
|
|
664
|
+
acceptedAt?: number;
|
|
665
|
+
deliveredAt?: number;
|
|
666
|
+
readAt?: number;
|
|
667
|
+
}>;
|
|
668
|
+
/** Present only when the Delivery adapter explicitly declares read-receipt completeness. */
|
|
669
|
+
readReceipts?: NotificationReadReceipts;
|
|
670
|
+
reaction?: Readonly<{
|
|
671
|
+
firstAt: number;
|
|
672
|
+
count?: number;
|
|
673
|
+
}>;
|
|
674
|
+
judgement?: Readonly<{
|
|
675
|
+
source: 'owner-objective' | 'work-item-feedback';
|
|
676
|
+
version: number;
|
|
677
|
+
objectiveStatus: ObjectiveStatus;
|
|
678
|
+
}>;
|
|
679
|
+
/** Host-routed cross-channel fallback to a linked owner alias; absent means the notification's own binding. */
|
|
680
|
+
route?: Readonly<{
|
|
681
|
+
kind: 'linked';
|
|
682
|
+
originBindingId: string;
|
|
683
|
+
}>;
|
|
684
|
+
}
|
|
685
|
+
/** Canonical content of one notification-outcome revision; its SHA-256 is the revision digest. */
|
|
686
|
+
export interface NotificationOutcomeRecord {
|
|
687
|
+
protocol: typeof NOTIFICATION_OUTCOME_RECORD_PROTOCOL;
|
|
688
|
+
/**
|
|
689
|
+
* v1 is the frozen 7-state classifier; v2 adds an optional delivery-state
|
|
690
|
+
* projection when Delivery supplies `readReceipts`. Both are readable forever.
|
|
691
|
+
*/
|
|
692
|
+
classifier: Readonly<{
|
|
693
|
+
id: 'notification-outcome';
|
|
694
|
+
version: 1 | 2;
|
|
695
|
+
}>;
|
|
696
|
+
notificationId: string;
|
|
697
|
+
scope: Readonly<EvaluationScope>;
|
|
698
|
+
bindingId: string;
|
|
699
|
+
lane: string;
|
|
700
|
+
sourceId: string;
|
|
701
|
+
purpose: NotificationOutcomeFactInput['purpose'];
|
|
702
|
+
purposeSource: NotificationOutcomeFactInput['purposeSource'];
|
|
703
|
+
workItemId?: string;
|
|
704
|
+
questionId?: string;
|
|
705
|
+
answersQuestionId?: string;
|
|
706
|
+
verdict: NotificationOutcomeFactInput['verdict'];
|
|
707
|
+
reasons: readonly string[];
|
|
708
|
+
notifiedAt: number;
|
|
709
|
+
outcome: NotificationOutcome;
|
|
710
|
+
/** Classifier v2 projection only; absent on v1 records and when not derivable. */
|
|
711
|
+
deliveryState?: NotificationDeliveryState;
|
|
712
|
+
transport: Readonly<{
|
|
713
|
+
status: string;
|
|
714
|
+
acceptedAt?: number;
|
|
715
|
+
deliveredAt?: number;
|
|
716
|
+
readAt?: number;
|
|
717
|
+
}>;
|
|
718
|
+
reaction?: Readonly<{
|
|
719
|
+
firstAt: number;
|
|
720
|
+
}>;
|
|
721
|
+
judgement?: Readonly<{
|
|
722
|
+
source: 'owner-objective' | 'work-item-feedback';
|
|
723
|
+
version: number;
|
|
724
|
+
objectiveStatus: Exclude<ObjectiveStatus, 'unknown'>;
|
|
725
|
+
}>;
|
|
726
|
+
/**
|
|
727
|
+
* Linked-alias fallback route. Counted in summaries and the feed, excluded
|
|
728
|
+
* from attention-tuning cohorts. Absent (not `origin`) for ordinary
|
|
729
|
+
* notifications so pre-existing record digests are unchanged.
|
|
730
|
+
*/
|
|
731
|
+
route?: Readonly<{
|
|
732
|
+
kind: 'linked';
|
|
733
|
+
originBindingId: string;
|
|
734
|
+
}>;
|
|
735
|
+
/**
|
|
736
|
+
* Set only for `expired-unhandled`: the deterministic expiry boundary and the
|
|
737
|
+
* response window that produced it. The window is deliberately absent from
|
|
738
|
+
* every other record, so a window change only revises notifications whose
|
|
739
|
+
* expiry classification actually changes.
|
|
740
|
+
*/
|
|
741
|
+
expiry?: Readonly<{
|
|
742
|
+
at: number;
|
|
743
|
+
responseWindowMs: number;
|
|
744
|
+
}>;
|
|
745
|
+
}
|
|
746
|
+
export interface StoredNotificationOutcome {
|
|
747
|
+
notificationId: string;
|
|
748
|
+
scopeKey: string;
|
|
749
|
+
version: number;
|
|
750
|
+
digest: string;
|
|
751
|
+
/** Per-scope notification watermark of this revision (not the task-learning watermark). */
|
|
752
|
+
watermark: number;
|
|
753
|
+
recordedAt: number;
|
|
754
|
+
record: Readonly<NotificationOutcomeRecord>;
|
|
755
|
+
}
|
|
756
|
+
export interface NotificationOutcomeHistory {
|
|
757
|
+
head: Readonly<StoredNotificationOutcome>;
|
|
758
|
+
revisions: readonly Readonly<StoredNotificationOutcome>[];
|
|
759
|
+
}
|
|
760
|
+
/** Restart-safe page of current notification heads after a per-scope watermark. */
|
|
761
|
+
export interface NotificationOutcomeFeedPage {
|
|
762
|
+
items: readonly Readonly<StoredNotificationOutcome>[];
|
|
763
|
+
nextCursor: Readonly<{
|
|
764
|
+
scopeKey: string;
|
|
765
|
+
watermark: number;
|
|
766
|
+
}>;
|
|
767
|
+
scopeWatermark: number;
|
|
768
|
+
hasMore: boolean;
|
|
769
|
+
}
|
|
770
|
+
export interface NotificationOutcomeSummary {
|
|
771
|
+
scope: Readonly<EvaluationScope>;
|
|
772
|
+
scopeKey: string;
|
|
773
|
+
fromNotifiedAt: number;
|
|
774
|
+
toNotifiedAt: number;
|
|
775
|
+
total: number;
|
|
776
|
+
outcomes: Readonly<Record<NotificationOutcome, number>>;
|
|
777
|
+
/** Attention verdict x current outcome, for WP19 would-accept concordance. */
|
|
778
|
+
byVerdict: Readonly<Record<NotificationOutcomeFactInput['verdict'], Readonly<Record<NotificationOutcome, number>>>>;
|
|
779
|
+
}
|
|
780
|
+
export interface NotificationOutcomeSyncResult {
|
|
781
|
+
ingested: number;
|
|
782
|
+
refreshed: number;
|
|
783
|
+
revised: number;
|
|
784
|
+
invalid: number;
|
|
785
|
+
}
|
|
786
|
+
export {};
|
|
787
|
+
//# sourceMappingURL=types.d.ts.map
|