@dsh-enhanced/assistant-evaluation 0.1.65 → 0.1.67

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.
Files changed (89) hide show
  1. package/README.md +69 -1
  2. package/lib/attention-owner-questions.d.ts +104 -0
  3. package/lib/attention-owner-questions.d.ts.map +1 -0
  4. package/lib/attention-owner-questions.js +179 -0
  5. package/lib/attention-owner-questions.js.map +1 -0
  6. package/lib/attention-tuning.d.ts +492 -0
  7. package/lib/attention-tuning.d.ts.map +1 -0
  8. package/lib/attention-tuning.js +1044 -0
  9. package/lib/attention-tuning.js.map +1 -0
  10. package/lib/benchmark/cli.d.ts.map +1 -1
  11. package/lib/benchmark/cli.js +14 -11
  12. package/lib/benchmark/cli.js.map +1 -1
  13. package/lib/benchmark/corpus.d.ts +13 -2
  14. package/lib/benchmark/corpus.d.ts.map +1 -1
  15. package/lib/benchmark/corpus.js +19 -9
  16. package/lib/benchmark/corpus.js.map +1 -1
  17. package/lib/benchmark/families-corpus.d.ts +11 -0
  18. package/lib/benchmark/families-corpus.d.ts.map +1 -0
  19. package/lib/benchmark/families-corpus.js +133 -0
  20. package/lib/benchmark/families-corpus.js.map +1 -0
  21. package/lib/benchmark/holdout-isolation.d.ts +27 -0
  22. package/lib/benchmark/holdout-isolation.d.ts.map +1 -0
  23. package/lib/benchmark/holdout-isolation.js +66 -0
  24. package/lib/benchmark/holdout-isolation.js.map +1 -0
  25. package/lib/benchmark/holdout.d.ts.map +1 -1
  26. package/lib/benchmark/holdout.js +3 -0
  27. package/lib/benchmark/holdout.js.map +1 -1
  28. package/lib/benchmark/index.d.ts +3 -0
  29. package/lib/benchmark/index.d.ts.map +1 -1
  30. package/lib/benchmark/index.js +2 -0
  31. package/lib/benchmark/index.js.map +1 -1
  32. package/lib/benchmark/native-skills.d.ts +12 -14
  33. package/lib/benchmark/native-skills.d.ts.map +1 -1
  34. package/lib/benchmark/native-skills.js +1 -3
  35. package/lib/benchmark/native-skills.js.map +1 -1
  36. package/lib/benchmark/native.d.ts +15 -2
  37. package/lib/benchmark/native.d.ts.map +1 -1
  38. package/lib/benchmark/native.js +67 -14
  39. package/lib/benchmark/native.js.map +1 -1
  40. package/lib/benchmark/report.d.ts.map +1 -1
  41. package/lib/benchmark/report.js +98 -8
  42. package/lib/benchmark/report.js.map +1 -1
  43. package/lib/benchmark/runner.d.ts.map +1 -1
  44. package/lib/benchmark/runner.js +5 -0
  45. package/lib/benchmark/runner.js.map +1 -1
  46. package/lib/benchmark/strategy-capabilities.d.ts.map +1 -1
  47. package/lib/benchmark/strategy-capabilities.js +0 -5
  48. package/lib/benchmark/strategy-capabilities.js.map +1 -1
  49. package/lib/benchmark/types.d.ts +64 -7
  50. package/lib/benchmark/types.d.ts.map +1 -1
  51. package/lib/index.d.ts +8 -1
  52. package/lib/index.d.ts.map +1 -1
  53. package/lib/index.js +4 -0
  54. package/lib/index.js.map +1 -1
  55. package/lib/intake-attention-agreement.d.ts +63 -0
  56. package/lib/intake-attention-agreement.d.ts.map +1 -0
  57. package/lib/intake-attention-agreement.js +146 -0
  58. package/lib/intake-attention-agreement.js.map +1 -0
  59. package/lib/notification-outcomes.d.ts +56 -0
  60. package/lib/notification-outcomes.d.ts.map +1 -0
  61. package/lib/notification-outcomes.js +348 -0
  62. package/lib/notification-outcomes.js.map +1 -0
  63. package/lib/service.d.ts +295 -2
  64. package/lib/service.d.ts.map +1 -1
  65. package/lib/service.js +965 -5
  66. package/lib/service.js.map +1 -1
  67. package/lib/sqlite.d.ts +8 -2
  68. package/lib/sqlite.d.ts.map +1 -1
  69. package/lib/sqlite.js +406 -17
  70. package/lib/sqlite.js.map +1 -1
  71. package/lib/store.d.ts +13 -2
  72. package/lib/store.d.ts.map +1 -1
  73. package/lib/store.js +122 -24
  74. package/lib/store.js.map +1 -1
  75. package/lib/types.d.ts +247 -5
  76. package/lib/types.d.ts.map +1 -1
  77. package/lib/types.js +11 -0
  78. package/lib/types.js.map +1 -1
  79. package/lib/version.d.ts +1 -1
  80. package/lib/version.js +1 -1
  81. package/lib/work-item-owner-proof.d.ts +4 -0
  82. package/lib/work-item-owner-proof.d.ts.map +1 -0
  83. package/lib/work-item-owner-proof.js +53 -0
  84. package/lib/work-item-owner-proof.js.map +1 -0
  85. package/package.json +29 -38
  86. package/lib/benchmark/super-relay.d.ts +0 -26
  87. package/lib/benchmark/super-relay.d.ts.map +0 -1
  88. package/lib/benchmark/super-relay.js +0 -173
  89. package/lib/benchmark/super-relay.js.map +0 -1
@@ -0,0 +1,492 @@
1
+ import type { DatabaseSync } from 'node:sqlite';
2
+ import type { AttentionOwnerQuestionChoice, AttentionOwnerQuestionReplyResult } from './attention-owner-questions.js';
3
+ import type { EvaluationScope, NotificationOutcome } from './types.js';
4
+ /**
5
+ * WP22 slice 2: bounded, tighten-only attention tuning with exact-version
6
+ * cohort rollback. A cohort is one notification `(lane, sourceId)` inside one
7
+ * Evaluation scope. Versions are immutable and bound to their exact parent.
8
+ *
9
+ * WP22 slice 3 (explicit opt-in): a loosening request is sealed against a
10
+ * hash-partitioned holdout the proposer never reads, replayed independently
11
+ * on a later tick, and adopted only inside an owner one-time grant; outside
12
+ * it a structured owner question is recorded instead. Without the opt-in,
13
+ * loosening is rejected exactly as in slice 2.
14
+ */
15
+ export declare const ATTENTION_TUNING_PROTOCOL: "assistant-evaluation/attention-tuning/v1";
16
+ export interface AttentionCohort {
17
+ readonly lane: string;
18
+ readonly sourceId: string;
19
+ }
20
+ /** Overlay deltas on a consumer's own profile. Every field only ever makes notifications rarer. */
21
+ export interface AttentionTuningParameters {
22
+ /** Added to the profile's interruption cost (lowers utility). */
23
+ readonly interruptionCostDelta: number;
24
+ /** Added to the profile's minimum utility threshold. */
25
+ readonly minimumUtilityDelta: number;
26
+ /** Minutes added on both sides of an existing quiet window. */
27
+ readonly quietExtensionMinutes: number;
28
+ /** Disables the noisy rule for this cohort entirely. */
29
+ readonly muted: boolean;
30
+ }
31
+ export type AttentionTuningNumericParameter = 'interruptionCostDelta' | 'minimumUtilityDelta' | 'quietExtensionMinutes';
32
+ export type AttentionTuningParameter = AttentionTuningNumericParameter | 'muted';
33
+ /** Fixed code constants; neither configuration nor a request can widen them. */
34
+ export declare const attentionTuningBounds: Readonly<Record<AttentionTuningNumericParameter, Readonly<{
35
+ min: number;
36
+ max: number;
37
+ step: number;
38
+ }>>>;
39
+ /** Fixed single-step order: cheapest reversible lever first, mute last. */
40
+ export declare const attentionTuningOrder: readonly AttentionTuningParameter[];
41
+ export declare const defaultAttentionTuningParameters: AttentionTuningParameters;
42
+ export interface AttentionCohortStats {
43
+ readonly fromNotifiedAt: number;
44
+ readonly toNotifiedAt: number;
45
+ readonly total: number;
46
+ readonly accepted: number;
47
+ readonly reacted: number;
48
+ readonly rejected: number;
49
+ readonly expiredUnhandled: number;
50
+ /** accepted + reacted + rejected + expired-unhandled; pending/delivered/failed are undecided. */
51
+ readonly decided: number;
52
+ /** rejected + expired-unhandled. */
53
+ readonly negative: number;
54
+ }
55
+ export interface AttentionTuningPolicy {
56
+ readonly minSample: number;
57
+ readonly negativeRatePpm: number;
58
+ readonly muteRatePpm: number;
59
+ readonly regressionMarginPpm: number;
60
+ }
61
+ export interface AttentionTuningChange {
62
+ readonly parameter: AttentionTuningParameter;
63
+ readonly from: number | boolean;
64
+ readonly to: number | boolean;
65
+ }
66
+ export type AttentionTuningProposal = Readonly<{
67
+ kind: 'tighten';
68
+ change: AttentionTuningChange;
69
+ parameters: AttentionTuningParameters;
70
+ }> | Readonly<{
71
+ kind: 'no-op';
72
+ reason: 'insufficient-sample' | 'below-threshold' | 'at-bound';
73
+ }>;
74
+ export type AttentionTuningRequestRejection = 'loosening-requires-holdout' | 'out-of-bounds' | 'no-change' | 'not-single-step' | 'auto-adoption-disabled' | 'observation-in-progress'
75
+ /** Slice 3 loosening (opt-in only): more than one parameter moved, or not on the grid. */
76
+ | 'not-single-parameter' | 'proposal-pending' | 'owner-question-pending';
77
+ /** Why a sealed loosening proposal was not adopted by the independent replay. */
78
+ export type AttentionLooseningRejection = 'proposal-unverifiable' | 'stale-parent' | 'holdout-drifted' | 'insufficient-basis' | 'era-unverifiable' | 'holdout-failed'
79
+ /** Slice 5 deferred state: the owner refused, or the notice TTL elapsed first. */
80
+ | 'owner-declined' | 'owner-question-expired'
81
+ /** The owner authorized exactly once, but that grant no longer permits this adoption. */
82
+ | 'owner-authorization-unusable';
83
+ export interface AttentionTuningVersion {
84
+ readonly protocol: typeof ATTENTION_TUNING_PROTOCOL;
85
+ readonly scopeKey: string;
86
+ readonly cohort: AttentionCohort;
87
+ readonly version: number;
88
+ readonly parentVersion: number;
89
+ readonly parentDigest: string | null;
90
+ readonly parameters: AttentionTuningParameters;
91
+ readonly basis: Readonly<{
92
+ stats: AttentionCohortStats;
93
+ scopeWatermark: number;
94
+ }>;
95
+ readonly change: AttentionTuningChange;
96
+ readonly origin: 'auto' | 'request';
97
+ readonly digest: string;
98
+ readonly createdAt: number;
99
+ }
100
+ export interface AttentionTuningCurrent {
101
+ readonly scopeKey: string;
102
+ readonly cohort: AttentionCohort;
103
+ /** 0 is the built-in default (no overlay). */
104
+ readonly version: number;
105
+ readonly digest: string | null;
106
+ readonly parameters: AttentionTuningParameters;
107
+ /** `parent-fallback`/`default` mean the active version was unreadable or failed digest verification. */
108
+ readonly source: 'active' | 'parent-fallback' | 'default';
109
+ }
110
+ export interface AttentionTuningEvent {
111
+ readonly sequence: number;
112
+ readonly kind: 'adopted' | 'rolled-back' | 'settled' | 'request-rejected';
113
+ readonly fromVersion: number;
114
+ readonly toVersion: number;
115
+ readonly reason: string;
116
+ readonly detail: Readonly<Record<string, unknown>>;
117
+ readonly occurredAt: number;
118
+ }
119
+ export interface AttentionTuningStatus {
120
+ readonly current: AttentionTuningCurrent;
121
+ readonly state: 'idle' | 'observing';
122
+ readonly observeFrom?: number;
123
+ readonly observeUntil?: number;
124
+ readonly versions: readonly AttentionTuningVersion[];
125
+ readonly events: readonly AttentionTuningEvent[];
126
+ }
127
+ export type AttentionTuningTickAction = Readonly<{
128
+ action: 'adopted';
129
+ version: number;
130
+ change: AttentionTuningChange;
131
+ }> | Readonly<{
132
+ action: 'rolled-back';
133
+ fromVersion: number;
134
+ toVersion: number;
135
+ }> | Readonly<{
136
+ action: 'settled';
137
+ version: number;
138
+ }> | Readonly<{
139
+ action: 'observing';
140
+ version: number;
141
+ }> | Readonly<{
142
+ action: 'no-op';
143
+ reason: 'insufficient-sample' | 'below-threshold' | 'at-bound';
144
+ }> | Readonly<{
145
+ action: 'loosening-adopted';
146
+ version: number;
147
+ change: AttentionTuningChange;
148
+ proposalId: string;
149
+ grantId: string;
150
+ }> | Readonly<{
151
+ action: 'loosening-rejected';
152
+ reason: AttentionLooseningRejection;
153
+ proposalId: string;
154
+ }> | Readonly<{
155
+ action: 'owner-question';
156
+ questionId: string;
157
+ proposalId: string;
158
+ exceeded: readonly AttentionGrantExceeded[];
159
+ }>;
160
+ export interface AttentionHoldoutSeal {
161
+ readonly protocol: typeof ATTENTION_HOLDOUT_PROTOCOL;
162
+ readonly modulus: number;
163
+ readonly count: number;
164
+ readonly digest: string;
165
+ }
166
+ export type AttentionTuningRequestResult = Readonly<{
167
+ status: 'adopted';
168
+ version: number;
169
+ change: AttentionTuningChange;
170
+ }> | Readonly<{
171
+ status: 'proposed';
172
+ proposalId: string;
173
+ holdout: AttentionHoldoutSeal;
174
+ }> | Readonly<{
175
+ status: 'rejected';
176
+ reason: AttentionTuningRequestRejection;
177
+ }>;
178
+ /** Sealed loosening proposal. It names holdout membership by digest only; holdout outcomes are never read to build it. */
179
+ export interface AttentionLooseningProposal {
180
+ readonly protocol: typeof ATTENTION_LOOSENING_PROTOCOL;
181
+ readonly scopeKey: string;
182
+ readonly cohort: AttentionCohort;
183
+ /** 1-based position among this cohort's proposals, so identical retries stay distinct. */
184
+ readonly ordinal: number;
185
+ readonly parentVersion: number;
186
+ readonly parentDigest: string | null;
187
+ readonly parent: AttentionTuningParameters;
188
+ readonly candidate: AttentionTuningParameters;
189
+ readonly change: AttentionTuningChange;
190
+ readonly steps: number;
191
+ readonly window: Readonly<{
192
+ fromNotifiedAt: number;
193
+ toNotifiedAt: number;
194
+ }>;
195
+ readonly holdout: AttentionHoldoutSeal;
196
+ /** Training-partition outcome summary; becomes the adopted version's regression basis. */
197
+ readonly basis: Readonly<{
198
+ stats: AttentionCohortStats;
199
+ scopeWatermark: number;
200
+ }>;
201
+ readonly createdAt: number;
202
+ }
203
+ export interface AttentionLooseningDecision {
204
+ readonly decision: 'adopted' | 'rejected' | 'owner-question';
205
+ readonly reason: string;
206
+ readonly grantId: string | null;
207
+ readonly version: number | null;
208
+ readonly replay: AttentionReplaySummary | null;
209
+ readonly decidedAt: number;
210
+ }
211
+ /**
212
+ * Structured owner question. The body is immutable and keeps `delivery:
213
+ * 'not-sent'` as recorded; the optional slice-4 delivery state lives in the
214
+ * separate `attention-owner-questions` ledger.
215
+ */
216
+ export interface AttentionOwnerQuestion {
217
+ readonly protocol: typeof ATTENTION_OWNER_QUESTION_PROTOCOL;
218
+ readonly kind: 'attention-loosening-authorization';
219
+ readonly scopeKey: string;
220
+ readonly cohort: AttentionCohort;
221
+ readonly proposalId: string;
222
+ readonly parentVersion: number;
223
+ readonly parentDigest: string | null;
224
+ readonly parent: AttentionTuningParameters;
225
+ readonly candidate: AttentionTuningParameters;
226
+ readonly change: AttentionTuningChange;
227
+ readonly steps: number;
228
+ readonly replay: AttentionReplaySummary;
229
+ readonly exceeded: readonly AttentionGrantExceeded[];
230
+ /** Latest grant row asked under (even if unverifiable); a different grant closes the question. */
231
+ readonly grantId: string | null;
232
+ readonly choices: readonly ['authorize-once', 'decline'];
233
+ readonly delivery: 'not-sent';
234
+ readonly createdAt: number;
235
+ }
236
+ export type AttentionLooseningGrantResult = Readonly<{
237
+ status: 'granted';
238
+ grantId: string;
239
+ digest: string;
240
+ }> | Readonly<{
241
+ status: 'rejected';
242
+ reason: 'loosening-disabled' | 'grant-conflict' | 'grant-expired';
243
+ }>;
244
+ export interface AttentionLooseningStatus {
245
+ readonly grant: Readonly<{
246
+ grant: AttentionLooseningGrant;
247
+ digest: string;
248
+ createdAt: number;
249
+ used: number;
250
+ remaining: number;
251
+ }> | null;
252
+ readonly proposals: readonly Readonly<{
253
+ proposalId: string;
254
+ proposal: AttentionLooseningProposal;
255
+ decision: AttentionLooseningDecision | null;
256
+ }>[];
257
+ readonly questions: readonly Readonly<{
258
+ questionId: string;
259
+ question: AttentionOwnerQuestion;
260
+ }>[];
261
+ }
262
+ /** Present only when the slice-3 opt-in is on; absent options keep slice-2 behaviour byte for byte. */
263
+ export interface AttentionLooseningOptions {
264
+ readonly replayWindowMs: number;
265
+ /**
266
+ * Slice 5 opt-in. When present, an out-of-grant proposal stays pending (no
267
+ * terminal decision) so an exact owner reply can create a one-time grant
268
+ * that the next tick independently replays and adopts, or a decline/expiry
269
+ * can close it. Absent keeps the slice-3/4 terminal owner-question decision.
270
+ */
271
+ readonly ownerQuestionReplyLoop?: Readonly<{
272
+ noticeTtlMs: number;
273
+ }>;
274
+ }
275
+ /**
276
+ * Outcome of applying one exact owner reply to the cohort's latest recorded
277
+ * question. `deferred` means the one-time grant exists and adoption is left
278
+ * to the next tuning tick's independent replay; `declined` means the
279
+ * proposal was closed without adoption; `proposal-terminal` means the
280
+ * proposal already had an immutable decision (a question recorded before the
281
+ * reply loop was enabled), so the reply is recorded but nothing can adopt.
282
+ */
283
+ export type AttentionOwnerQuestionApplyResult = Readonly<{
284
+ status: 'applied';
285
+ questionId: string;
286
+ choice: AttentionOwnerQuestionChoice;
287
+ proposalId: string;
288
+ grantId: string | null;
289
+ adoption: 'deferred' | 'declined' | 'proposal-terminal';
290
+ }> | Readonly<{
291
+ status: 'rejected';
292
+ reason: 'delivery-disabled' | 'unknown-question' | 'question-closed' | 'question-expired' | 'reply-conflict';
293
+ }>;
294
+ export declare function normalizeAttentionCohort(input: unknown): AttentionCohort;
295
+ /** Strict shape check only; bounds and step alignment are judged separately so a request can be recorded. */
296
+ export declare function normalizeAttentionTuningParameters(input: unknown): AttentionTuningParameters;
297
+ /** Clamp every numeric field into its fixed bound (snapped down to the step grid). */
298
+ export declare function clampAttentionTuning(input: AttentionTuningParameters): AttentionTuningParameters;
299
+ export declare function withinAttentionTuningBounds(input: AttentionTuningParameters): boolean;
300
+ /** True when any field would make notifications more frequent than `current`. */
301
+ export declare function isAttentionLoosening(current: AttentionTuningParameters, next: AttentionTuningParameters): boolean;
302
+ /**
303
+ * Pure tighten-only tuner. With at least `minSample` decided notifications and
304
+ * a negative (rejected + expired-unhandled) rate at or above the threshold, it
305
+ * proposes exactly one step on the first non-maxed parameter in fixed order;
306
+ * mute additionally requires `muteRatePpm`. Never proposes loosening.
307
+ */
308
+ export declare function proposeAttentionTuning(currentInput: AttentionTuningParameters, stats: AttentionCohortStats, policy: AttentionTuningPolicy): AttentionTuningProposal;
309
+ /**
310
+ * Regression test for an observing version: the post-adoption negative rate
311
+ * must exceed the basis (parent-era) rate by more than the margin. Cross
312
+ * multiplication keeps it exact; acceptances only lower the rate, so positive
313
+ * evidence can never satisfy it.
314
+ */
315
+ export declare function attentionRegressed(basis: AttentionCohortStats, post: AttentionCohortStats, policy: AttentionTuningPolicy): boolean;
316
+ /**
317
+ * WP22 slice 3: sealed holdout partition. Membership is a pure function of the
318
+ * notification id under a fixed protocol salt and modulus, so it is
319
+ * reproducible by any auditor and never chosen by the proposer.
320
+ */
321
+ export declare const ATTENTION_HOLDOUT_PROTOCOL: "assistant-evaluation/attention-holdout/v1";
322
+ export declare const attentionHoldoutModulus = 4;
323
+ export declare const ATTENTION_LOOSENING_PROTOCOL: "assistant-evaluation/attention-loosening/v1";
324
+ export declare const ATTENTION_LOOSENING_GRANT_PROTOCOL: "assistant-evaluation/attention-loosening-grant/v1";
325
+ export declare const ATTENTION_OWNER_QUESTION_PROTOCOL: "assistant-evaluation/attention-owner-question/v1";
326
+ export declare function attentionHoldoutMember(notificationId: string): boolean;
327
+ /** True when `a` suppresses at least everything `b` suppresses (every field at least as tight). */
328
+ export declare function attentionTighterOrEqual(a: AttentionTuningParameters, b: AttentionTuningParameters): boolean;
329
+ export interface AttentionLooseningChange extends AttentionTuningChange {
330
+ /** Grid steps moved toward the default; unmute counts as one. */
331
+ readonly steps: number;
332
+ }
333
+ /** One parameter moved toward the default by whole grid steps, or an unmute; anything else is undefined. */
334
+ export declare function attentionLooseningChange(current: AttentionTuningParameters, next: AttentionTuningParameters): AttentionLooseningChange | undefined;
335
+ export interface AttentionReplayRecord {
336
+ /** Parameters that were active when the notification was sent. */
337
+ readonly era: AttentionTuningParameters;
338
+ readonly outcome: NotificationOutcome;
339
+ }
340
+ export interface AttentionReplayTally {
341
+ readonly decided: number;
342
+ readonly positive: number;
343
+ readonly negative: number;
344
+ }
345
+ export type AttentionReplayFailure = 'insufficient-holdout' | 'extra-interruptions' | 'candidate-negative-rate' | 'no-net-benefit';
346
+ export interface AttentionReplaySummary {
347
+ readonly protocol: typeof ATTENTION_LOOSENING_PROTOCOL;
348
+ /** Sent under an era at least as tight as the parent: both parent and candidate send them. */
349
+ readonly shared: AttentionReplayTally;
350
+ /** Sent under an era the candidate admits but the parent may suppress: the loosening's extra traffic. */
351
+ readonly discriminating: AttentionReplayTally;
352
+ /** Sent under an era looser than the candidate; neither verdict is attributable, reported only. */
353
+ readonly unattributable: AttentionReplayTally;
354
+ /** False positives are delivered-and-rejected/ignored; misses are owner-accepted notifications suppressed. */
355
+ readonly parent: Readonly<{
356
+ falsePositives: number;
357
+ misses: number;
358
+ }>;
359
+ readonly candidate: Readonly<{
360
+ falsePositives: number;
361
+ misses: number;
362
+ }>;
363
+ readonly thresholds: Readonly<{
364
+ minSample: number;
365
+ maxDiscriminatingNegativeRatePpm: number;
366
+ maxCandidateNegativeRatePpm: number;
367
+ }>;
368
+ readonly verdict: 'pass' | 'fail';
369
+ readonly reason?: AttentionReplayFailure;
370
+ }
371
+ /**
372
+ * Deterministic counterfactual replay of a loosening on holdout records.
373
+ * Notifications carry no per-message utility, so each is attributed by the
374
+ * era it was sent under: an era at least as tight as a configuration proves
375
+ * that configuration would also have sent it. Passing requires enough
376
+ * discriminating evidence, an extra-interruption rate below the tuning
377
+ * threshold minus the regression margin, a candidate-wide negative rate below
378
+ * the tightening threshold (so it would not be immediately re-tightened), and
379
+ * more owner-valued notifications recovered than extra interruptions added.
380
+ */
381
+ export declare function replayAttentionLoosening(records: readonly AttentionReplayRecord[], parent: AttentionTuningParameters, candidate: AttentionTuningParameters, policy: AttentionTuningPolicy): AttentionReplaySummary;
382
+ /** Owner one-time pre-authorization for automatic loosening of one cohort. */
383
+ export interface AttentionLooseningGrant {
384
+ readonly grantId: string;
385
+ /** Loosest parameters a candidate may reach. */
386
+ readonly lowerBound: AttentionTuningParameters;
387
+ /** Tightest parameters a loosening may start from. */
388
+ readonly upperBound: AttentionTuningParameters;
389
+ readonly maxStepsPerAdoption: number;
390
+ readonly maxAdoptions: number;
391
+ readonly expiresAt: number;
392
+ }
393
+ export type AttentionGrantExceeded = 'no-grant' | 'grant-unverifiable' | 'grant-expired' | 'grant-exhausted' | 'outside-bounds' | 'step-too-large';
394
+ export declare function normalizeAttentionLooseningGrant(input: unknown): AttentionLooseningGrant;
395
+ /** Every way a holdout-accepted loosening falls outside the active grant; empty means adoptable. */
396
+ export declare function attentionGrantExceeded(grant: AttentionLooseningGrant | undefined, used: number, parent: AttentionTuningParameters, candidate: AttentionTuningParameters, steps: number, now: number): readonly AttentionGrantExceeded[];
397
+ /**
398
+ * Structural port to the slice-4 owner-question ledger. `AttentionTuningLedger`
399
+ * uses it only for the slice-5 reply loop: question openness and the atomic
400
+ * reply insert that must commit with the grant or proposal decision.
401
+ */
402
+ export interface AttentionOwnerQuestionLedgerPort {
403
+ reply(questionId: string): Readonly<{
404
+ choice: AttentionOwnerQuestionChoice;
405
+ repliedAt: number;
406
+ }> | undefined;
407
+ recordReplyInTransaction(scope: EvaluationScope, cohort: AttentionCohort, questionId: string, choiceInput: unknown, open: boolean, expired: boolean): AttentionOwnerQuestionReplyResult;
408
+ }
409
+ /**
410
+ * Durable ledger over the same Evaluation database as the notification canon.
411
+ * All decisions recompute inside BEGIN IMMEDIATE so concurrent ticks or a
412
+ * restart mid-observation converge on one head.
413
+ */
414
+ export declare class AttentionTuningLedger {
415
+ #private;
416
+ constructor(database: DatabaseSync, now: () => number, questions?: AttentionOwnerQuestionLedgerPort);
417
+ /**
418
+ * Current-head outcome counts for one cohort, notified in [from, to).
419
+ * `training` excludes the sealed holdout partition; every proposer uses it
420
+ * once the slice-3 opt-in is on, so no proposal is fitted to holdout data.
421
+ */
422
+ stats(scopeKey: string, cohort: AttentionCohort, fromNotifiedAt: number, toNotifiedAt: number, partition?: 'all' | 'training'): AttentionCohortStats;
423
+ /** Scopes that have at least one notification in the cohort, plus scopes with a tuning head. */
424
+ scopes(cohort: AttentionCohort): readonly EvaluationScope[];
425
+ /**
426
+ * Active parameters for a consumer. A version that cannot be read or fails
427
+ * digest verification falls back along its recorded parent chain, then to
428
+ * the built-in default; a consumer never sees an unverified overlay.
429
+ */
430
+ current(scopeInput: EvaluationScope, cohortInput: AttentionCohort): AttentionTuningCurrent;
431
+ status(scopeInput: EvaluationScope, cohortInput: AttentionCohort, eventLimit?: number): AttentionTuningStatus;
432
+ /**
433
+ * One deterministic step for one cohort: monitor an observing version
434
+ * (rollback to its exact parent on regression, settle at window end), or
435
+ * when idle propose and adopt a single bounded tightening step.
436
+ */
437
+ tick(scopeInput: EvaluationScope, cohortInput: AttentionCohort, policy: AttentionTuningPolicy, options: Readonly<{
438
+ observationMs: number;
439
+ evaluationWindowMs: number;
440
+ loosening?: AttentionLooseningOptions;
441
+ }>): AttentionTuningTickAction;
442
+ /**
443
+ * Explicit parameter request. Any loosening field is rejected with
444
+ * `loosening-requires-holdout` and recorded; so is every other rejection.
445
+ * A single in-bounds tightening step is adopted with an observation window.
446
+ */
447
+ request(scopeInput: EvaluationScope, cohortInput: AttentionCohort, parametersInput: unknown, options: Readonly<{
448
+ enabled: boolean;
449
+ observationMs: number;
450
+ evaluationWindowMs: number;
451
+ loosening?: AttentionLooseningOptions;
452
+ }>): AttentionTuningRequestResult;
453
+ /**
454
+ * WP22 slice 4: the latest owner question of a cohort, verified against its
455
+ * content id, and whether it is still open (same rule as `#openQuestion`,
456
+ * including the slice-5 rule that any recorded reply closes it). Older
457
+ * questions are always closed. A row whose body no longer hashes to its id
458
+ * is reported as `unverifiable` and must never be delivered.
459
+ */
460
+ latestOwnerQuestion(scopeInput: EvaluationScope, cohortInput: AttentionCohort): Readonly<{
461
+ questionId: string;
462
+ question: AttentionOwnerQuestion;
463
+ open: boolean;
464
+ }> | 'unverifiable' | undefined;
465
+ /**
466
+ * Slice 5 evidence-backed apply path for one exact owner reply. Inside one
467
+ * transaction it verifies the cohort's latest question against its content
468
+ * id, records the reply, and then:
469
+ * - `decline` writes the proposal's one terminal `owner-declined` decision;
470
+ * - `authorize-once` creates a bounded one-time grant whose bounds are
471
+ * exactly the questioned proposal's parent/candidate, charged once, and
472
+ * leaves adoption to the next tuning tick's independent holdout replay;
473
+ * - a proposal that already has a decision (a question recorded before the
474
+ * reply loop was enabled) returns `proposal-terminal` and changes nothing.
475
+ * Record-only callers keep using `AttentionOwnerQuestionLedger.recordReply`.
476
+ */
477
+ applyOwnerQuestionReply(scopeInput: EvaluationScope, cohortInput: AttentionCohort, questionIdInput: string, choiceInput: unknown, options: Readonly<{
478
+ noticeTtlMs: number;
479
+ }>): AttentionOwnerQuestionApplyResult;
480
+ /**
481
+ * Record an owner one-time pre-authorization. Grants are immutable; the
482
+ * latest one is active and its quota is never refunded. Re-sending the same
483
+ * grant is idempotent; reusing an id with different content is rejected.
484
+ */
485
+ grant(scopeInput: EvaluationScope, cohortInput: AttentionCohort, grantInput: unknown): AttentionLooseningGrantResult;
486
+ looseningStatus(scopeInput: EvaluationScope, cohortInput: AttentionCohort, limit?: number): AttentionLooseningStatus;
487
+ counts(): Readonly<{
488
+ versions: number;
489
+ events: number;
490
+ }>;
491
+ }
492
+ //# sourceMapp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