@mossbear/protocol 0.1.0-alpha.28 → 0.1.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schemas.d.ts CHANGED
@@ -270,6 +270,72 @@ export declare const RawGuideFileDeletionSchema: v.ObjectSchema<{
270
270
  }, undefined>;
271
271
  /** Max number of deletions accepted in a single `POST /api/rules/deletions` request. */
272
272
  export declare const MAX_RULE_DELETIONS_BATCH = 500;
273
+ /**
274
+ * One guide to stop delivering, addressed the way the **import** route already
275
+ * resolves an existing guide: `(root, path)` plus the envelope's checkout and
276
+ * project identity.
277
+ *
278
+ * **Deliberately not `origin`.** `file:{format}:{path}` is not unique — every
279
+ * repo has an `AGENTS.md`, so an origin-keyed request disables the matching
280
+ * guide in every repo in the workspace. That is the defect that sank the first
281
+ * implementation of this verb. `(root, path)` scoped by `repoId`/`projectId`
282
+ * is the key the import route reconciles on, so unlink addresses exactly the
283
+ * row link created and no other.
284
+ */
285
+ export declare const RawGuideUnlinkSchema: v.ObjectSchema<{
286
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
287
+ /**
288
+ * The canonical guide-path validator, not a fresh `v.string()`: it already
289
+ * rejects absolute paths, control characters and `..` traversal, and a second
290
+ * hand-rolled constraint here would be a place for the two to disagree.
291
+ */
292
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
293
+ }, undefined>;
294
+ export type RawGuideUnlink = v.InferOutput<typeof RawGuideUnlinkSchema>;
295
+ /** Max guides accepted in a single `POST /api/rules/unlink` request. */
296
+ export declare const MAX_RULE_UNLINK_BATCH = 500;
297
+ export declare const RuleUnlinkRequestSchema: v.ObjectSchema<{
298
+ readonly unlinks: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
299
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
300
+ /**
301
+ * The canonical guide-path validator, not a fresh `v.string()`: it already
302
+ * rejects absolute paths, control characters and `..` traversal, and a second
303
+ * hand-rolled constraint here would be a place for the two to disagree.
304
+ */
305
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
306
+ }, undefined>, undefined>, v.MaxLengthAction<{
307
+ root: "project" | "global";
308
+ path: string;
309
+ }[], 500, undefined>]>;
310
+ /** Same envelope identity the import route carries, and for the same reason. */
311
+ readonly repoId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
312
+ readonly projectId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
313
+ }, undefined>;
314
+ export type RuleUnlinkRequest = v.InferOutput<typeof RuleUnlinkRequestSchema>;
315
+ /**
316
+ * `unlinked` counts guides removed from the default bundle; `skipped` counts
317
+ * requested paths that resolved to nothing, or were already out of it.
318
+ *
319
+ * `stillDelivered` names guides that remain in *other* bundles the user owns.
320
+ * Unlink is the exact inverse of what link does — it removes the default-bundle
321
+ * membership link created — so a guide someone deliberately added to a curated
322
+ * bundle stays there, and saying so is the difference between a true report and
323
+ * a reassuring one.
324
+ */
325
+ export declare const RuleUnlinkResponseSchema: v.ObjectSchema<{
326
+ readonly unlinked: v.NumberSchema<undefined>;
327
+ readonly skipped: v.NumberSchema<undefined>;
328
+ readonly stillDelivered: v.ArraySchema<v.StringSchema<undefined>, undefined>;
329
+ }, undefined>;
330
+ export type RuleUnlinkResponse = v.InferOutput<typeof RuleUnlinkResponseSchema>;
331
+ export declare function parseRuleUnlinkRequest(data: unknown): {
332
+ unlinks: {
333
+ root: "project" | "global";
334
+ path: string;
335
+ }[];
336
+ repoId?: string | undefined;
337
+ projectId?: string | undefined;
338
+ };
273
339
  export declare const RuleDeletionsRequestSchema: v.ObjectSchema<{
274
340
  readonly deletions: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnknownSchema, undefined>, v.MaxLengthAction<unknown[], 500, undefined>]>;
275
341
  }, undefined>;
@@ -278,26 +344,6 @@ export declare const BundleSchema: v.ObjectSchema<{
278
344
  readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
279
345
  readonly name: v.StringSchema<undefined>;
280
346
  readonly createdAt: v.StringSchema<undefined>;
281
- /**
282
- * True when the authenticated caller owns this bundle, false when a
283
- * workspace-mate does.
284
- *
285
- * **A slug identifies a bundle only within one user's account**
286
- * (`bundles_user_slug_idx` is `(user_id, slug)`), but the listing is scoped by
287
- * *workspace membership* — so two members of one workspace both surface their
288
- * own `my-guides`, and a client matching on slug alone cannot tell which is
289
- * its own. That is not hypothetical: the server already answers an ambiguous
290
- * slug with a 409 on every other bundle route (`ambiguousBundleResponse`).
291
- * Without this flag `mossbear sync` picked whichever row the database happened
292
- * to return first and wrote its id into the repo's committed subscription.
293
- *
294
- * Optional because it is an addition: a CLI parsing a response from an older
295
- * deployment must not fail, so `undefined` means "this server does not say"
296
- * and callers fall back to refusing to guess. Only `GET /api/v1/context/bundles`
297
- * sets it — it is the one route that returns bundles the caller may not own
298
- * beside ones they do.
299
- */
300
- readonly ownedByCaller: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
301
347
  }, undefined>;
302
348
  export declare const BundleListResponseSchema: v.ObjectSchema<{
303
349
  readonly bundles: v.ArraySchema<v.ObjectSchema<{
@@ -305,26 +351,64 @@ export declare const BundleListResponseSchema: v.ObjectSchema<{
305
351
  readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
306
352
  readonly name: v.StringSchema<undefined>;
307
353
  readonly createdAt: v.StringSchema<undefined>;
308
- /**
309
- * True when the authenticated caller owns this bundle, false when a
310
- * workspace-mate does.
311
- *
312
- * **A slug identifies a bundle only within one user's account**
313
- * (`bundles_user_slug_idx` is `(user_id, slug)`), but the listing is scoped by
314
- * *workspace membership* — so two members of one workspace both surface their
315
- * own `my-guides`, and a client matching on slug alone cannot tell which is
316
- * its own. That is not hypothetical: the server already answers an ambiguous
317
- * slug with a 409 on every other bundle route (`ambiguousBundleResponse`).
318
- * Without this flag `mossbear sync` picked whichever row the database happened
319
- * to return first and wrote its id into the repo's committed subscription.
320
- *
321
- * Optional because it is an addition: a CLI parsing a response from an older
322
- * deployment must not fail, so `undefined` means "this server does not say"
323
- * and callers fall back to refusing to guess. Only `GET /api/v1/context/bundles`
324
- * sets it — it is the one route that returns bundles the caller may not own
325
- * beside ones they do.
326
- */
327
- readonly ownedByCaller: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
354
+ }, undefined>, undefined>;
355
+ }, undefined>;
356
+ /**
357
+ * How a bundle reaches a repo. Two scopes and no third
358
+ * (`docs/plans/bundle-identity-collapse-plan.md` → Slice A2):
359
+ *
360
+ * - `repo` — named by the committed `.mossbear/config.json`, shared with
361
+ * teammates by `git clone`.
362
+ * - `user` — recorded against the account, private, and on every machine.
363
+ *
364
+ * A bundle both scopes name carries **both** labels. An earlier shape reported a
365
+ * single winning `scope`, which made `status` and `doctor` — both of which count
366
+ * the account's subscriptions by filtering for `user` — report zero for a bundle
367
+ * that is genuinely subscribed at the account level and will keep delivering to
368
+ * every other repo. The scopes are not mutually exclusive, so the wire shape
369
+ * must not say they are. Raised by Codex on #735.
370
+ */
371
+ export declare const SubscriptionScopeSchema: v.PicklistSchema<["repo", "user"], undefined>;
372
+ export declare const ResolvedSubscriptionSchema: v.ObjectSchema<{
373
+ readonly id: v.StringSchema<undefined>;
374
+ readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
375
+ readonly name: v.StringSchema<undefined>;
376
+ /** Every scope that names this bundle. Never empty; may hold both. */
377
+ readonly scopes: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["repo", "user"], undefined>, undefined>, v.MinLengthAction<("repo" | "user")[], 1, undefined>]>;
378
+ }, undefined>;
379
+ /**
380
+ * The ids a repo's committed config names. Sent rather than looked up, because
381
+ * the committed file is on the caller's disk and the server has no way to read
382
+ * it — that asymmetry is the whole reason delivery used to be written back into
383
+ * the repo.
384
+ */
385
+ /**
386
+ * Capped, like the other batch endpoints. The route expands this into
387
+ * `inArray(bundles.id, …)`, one Postgres bind parameter per id, and the wire
388
+ * protocol tops out at 65,535 of them — so an uncapped array lets a body well
389
+ * under the request-size limit reach the database and fail as a 500 rather than
390
+ * being refused as bad input. Raised by Codex on #735.
391
+ */
392
+ export declare const MAX_REPO_BUNDLE_IDS = 500;
393
+ export declare const ResolveSubscriptionsRequestSchema: v.ObjectSchema<{
394
+ readonly repoBundleIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MaxLengthAction<string[], 500, undefined>]>;
395
+ }, undefined>;
396
+ export declare const ResolveSubscriptionsResponseSchema: v.ObjectSchema<{
397
+ /** The effective delivery set, de-duplicated by bundle id. */
398
+ readonly bundles: v.ArraySchema<v.ObjectSchema<{
399
+ readonly id: v.StringSchema<undefined>;
400
+ readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
401
+ readonly name: v.StringSchema<undefined>;
402
+ /** Every scope that names this bundle. Never empty; may hold both. */
403
+ readonly scopes: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["repo", "user"], undefined>, undefined>, v.MinLengthAction<("repo" | "user")[], 1, undefined>]>;
404
+ }, undefined>, undefined>;
405
+ /**
406
+ * Committed ids the caller cannot see. **Reported, never dropped** — the line
407
+ * was put in the config deliberately by whoever owns the repo, so a non-member
408
+ * gets a named failure rather than deletion advice.
409
+ */
410
+ readonly unresolved: v.ArraySchema<v.ObjectSchema<{
411
+ readonly id: v.StringSchema<undefined>;
328
412
  }, undefined>, undefined>;
329
413
  }, undefined>;
330
414
  export declare const CreateBundleRequestSchema: v.ObjectSchema<{
@@ -337,32 +421,12 @@ export declare const CreateBundleResponseSchema: v.ObjectSchema<{
337
421
  readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
338
422
  readonly name: v.StringSchema<undefined>;
339
423
  readonly createdAt: v.StringSchema<undefined>;
340
- /**
341
- * True when the authenticated caller owns this bundle, false when a
342
- * workspace-mate does.
343
- *
344
- * **A slug identifies a bundle only within one user's account**
345
- * (`bundles_user_slug_idx` is `(user_id, slug)`), but the listing is scoped by
346
- * *workspace membership* — so two members of one workspace both surface their
347
- * own `my-guides`, and a client matching on slug alone cannot tell which is
348
- * its own. That is not hypothetical: the server already answers an ambiguous
349
- * slug with a 409 on every other bundle route (`ambiguousBundleResponse`).
350
- * Without this flag `mossbear sync` picked whichever row the database happened
351
- * to return first and wrote its id into the repo's committed subscription.
352
- *
353
- * Optional because it is an addition: a CLI parsing a response from an older
354
- * deployment must not fail, so `undefined` means "this server does not say"
355
- * and callers fall back to refusing to guess. Only `GET /api/v1/context/bundles`
356
- * sets it — it is the one route that returns bundles the caller may not own
357
- * beside ones they do.
358
- */
359
- readonly ownedByCaller: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
360
424
  }, undefined>;
361
425
  }, undefined>;
362
- export declare const BundleMemberTypeSchema: v.PicklistSchema<["guide_file", "guide"], undefined>;
426
+ export declare const BundleMemberTypeSchema: v.PicklistSchema<readonly ["guide_file", "guide"], undefined>;
363
427
  export declare const AttachBundleMemberRequestSchema: v.ObjectSchema<{
364
428
  readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
365
- readonly itemType: v.OptionalSchema<v.PicklistSchema<["guide_file", "guide"], undefined>, undefined>;
429
+ readonly itemType: v.OptionalSchema<v.PicklistSchema<readonly ["guide_file", "guide"], undefined>, undefined>;
366
430
  }, undefined>;
367
431
  export declare const AttachBundleMemberResponseSchema: v.ObjectSchema<{
368
432
  readonly attached: v.BooleanSchema<undefined>;
@@ -379,39 +443,19 @@ export declare const RenameBundleResponseSchema: v.ObjectSchema<{
379
443
  readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
380
444
  readonly name: v.StringSchema<undefined>;
381
445
  readonly createdAt: v.StringSchema<undefined>;
382
- /**
383
- * True when the authenticated caller owns this bundle, false when a
384
- * workspace-mate does.
385
- *
386
- * **A slug identifies a bundle only within one user's account**
387
- * (`bundles_user_slug_idx` is `(user_id, slug)`), but the listing is scoped by
388
- * *workspace membership* — so two members of one workspace both surface their
389
- * own `my-guides`, and a client matching on slug alone cannot tell which is
390
- * its own. That is not hypothetical: the server already answers an ambiguous
391
- * slug with a 409 on every other bundle route (`ambiguousBundleResponse`).
392
- * Without this flag `mossbear sync` picked whichever row the database happened
393
- * to return first and wrote its id into the repo's committed subscription.
394
- *
395
- * Optional because it is an addition: a CLI parsing a response from an older
396
- * deployment must not fail, so `undefined` means "this server does not say"
397
- * and callers fall back to refusing to guess. Only `GET /api/v1/context/bundles`
398
- * sets it — it is the one route that returns bundles the caller may not own
399
- * beside ones they do.
400
- */
401
- readonly ownedByCaller: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
402
446
  }, undefined>;
403
447
  }, undefined>;
404
448
  export declare const DeleteBundleResponseSchema: v.ObjectSchema<{
405
449
  readonly deleted: v.BooleanSchema<undefined>;
406
450
  }, undefined>;
407
- export declare const ContextItemTypeSchema: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
408
- export declare const PushContentTypeSchema: v.PicklistSchema<["document", "reference", "asset"], undefined>;
409
- export declare const InboxContentTypeSchema: v.PicklistSchema<["document", "asset"], undefined>;
451
+ export declare const ContextItemTypeSchema: v.PicklistSchema<string[], undefined>;
452
+ export declare const PushContentTypeSchema: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
453
+ export declare const InboxContentTypeSchema: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
410
454
  /** Max serialized size (UTF-8 bytes) of a pushed or captured item's content. */
411
455
  export declare const MAX_CONTEXT_CONTENT_BYTES: number;
412
456
  export declare const ContextItemSchema: v.ObjectSchema<{
413
457
  readonly id: v.StringSchema<undefined>;
414
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
458
+ readonly type: v.PicklistSchema<string[], undefined>;
415
459
  readonly name: v.StringSchema<undefined>;
416
460
  readonly contentType: v.StringSchema<undefined>;
417
461
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -424,7 +468,7 @@ export declare const ContextItemSchema: v.ObjectSchema<{
424
468
  export declare const ContextItemsResponseSchema: v.ObjectSchema<{
425
469
  readonly items: v.ArraySchema<v.ObjectSchema<{
426
470
  readonly id: v.StringSchema<undefined>;
427
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
471
+ readonly type: v.PicklistSchema<string[], undefined>;
428
472
  readonly name: v.StringSchema<undefined>;
429
473
  readonly contentType: v.StringSchema<undefined>;
430
474
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -447,7 +491,7 @@ export declare const SourceItemIdsSchema: v.SchemaWithPipe<readonly [v.ArraySche
447
491
  export declare const UpdatableSourceItemIdsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>;
448
492
  export declare const PushContextRequestSchema: v.ObjectSchema<{
449
493
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
450
- readonly contentType: v.PicklistSchema<["document", "reference", "asset"], undefined>;
494
+ readonly contentType: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
451
495
  readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
452
496
  readonly itemId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
453
497
  readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
@@ -457,7 +501,7 @@ export declare const PushContextRequestSchema: v.ObjectSchema<{
457
501
  export declare const PushContextResponseSchema: v.ObjectSchema<{
458
502
  readonly item: v.ObjectSchema<{
459
503
  readonly id: v.StringSchema<undefined>;
460
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
504
+ readonly type: v.PicklistSchema<string[], undefined>;
461
505
  readonly name: v.StringSchema<undefined>;
462
506
  readonly contentType: v.StringSchema<undefined>;
463
507
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -479,7 +523,7 @@ export declare const UpdateContextItemRequestSchema: v.ObjectSchema<{
479
523
  export declare const UpdateContextItemResponseSchema: v.ObjectSchema<{
480
524
  readonly item: v.ObjectSchema<{
481
525
  readonly id: v.StringSchema<undefined>;
482
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
526
+ readonly type: v.PicklistSchema<string[], undefined>;
483
527
  readonly name: v.StringSchema<undefined>;
484
528
  readonly contentType: v.StringSchema<undefined>;
485
529
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -497,7 +541,7 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
497
541
  readonly content: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>, undefined>;
498
542
  readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
499
543
  readonly sourceItemIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
500
- }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
544
+ }, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
501
545
  readonly entries: Omit<{
502
546
  readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
503
547
  readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
@@ -542,7 +586,7 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
542
586
  export declare const ContextItemResponseSchema: v.ObjectSchema<{
543
587
  readonly item: v.ObjectSchema<{
544
588
  readonly id: v.StringSchema<undefined>;
545
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
589
+ readonly type: v.PicklistSchema<string[], undefined>;
546
590
  readonly name: v.StringSchema<undefined>;
547
591
  readonly contentType: v.StringSchema<undefined>;
548
592
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -557,7 +601,7 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
557
601
  readonly archived: v.BooleanSchema<undefined>;
558
602
  readonly item: v.ObjectSchema<{
559
603
  readonly id: v.StringSchema<undefined>;
560
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
604
+ readonly type: v.PicklistSchema<string[], undefined>;
561
605
  readonly name: v.StringSchema<undefined>;
562
606
  readonly contentType: v.StringSchema<undefined>;
563
607
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -569,14 +613,14 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
569
613
  }, undefined>;
570
614
  }, undefined>;
571
615
  export declare const InboxCaptureRequestSchema: v.ObjectSchema<{
572
- readonly contentType: v.PicklistSchema<["document", "asset"], undefined>;
616
+ readonly contentType: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
573
617
  readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
574
618
  readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
575
619
  readonly source: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
576
620
  }, undefined>;
577
621
  export declare const InboxItemSchema: v.ObjectSchema<{
578
622
  readonly id: v.StringSchema<undefined>;
579
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
623
+ readonly type: v.PicklistSchema<string[], undefined>;
580
624
  readonly name: v.StringSchema<undefined>;
581
625
  readonly contentType: v.StringSchema<undefined>;
582
626
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -588,7 +632,7 @@ export declare const InboxItemSchema: v.ObjectSchema<{
588
632
  export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
589
633
  readonly item: v.ObjectSchema<{
590
634
  readonly id: v.StringSchema<undefined>;
591
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
635
+ readonly type: v.PicklistSchema<string[], undefined>;
592
636
  readonly name: v.StringSchema<undefined>;
593
637
  readonly contentType: v.StringSchema<undefined>;
594
638
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -601,7 +645,7 @@ export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
601
645
  export declare const InboxListResponseSchema: v.ObjectSchema<{
602
646
  readonly items: v.ArraySchema<v.ObjectSchema<{
603
647
  readonly id: v.StringSchema<undefined>;
604
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
648
+ readonly type: v.PicklistSchema<string[], undefined>;
605
649
  readonly name: v.StringSchema<undefined>;
606
650
  readonly contentType: v.StringSchema<undefined>;
607
651
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -1004,6 +1048,95 @@ export declare const RuleFileManifestSchema: v.ObjectSchema<{
1004
1048
  */
1005
1049
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1006
1050
  }, undefined>;
1051
+ /**
1052
+ * Where the checkout stood when a run closed — the git head the `SessionEnd`
1053
+ * hook observed, and the branch it was on.
1054
+ *
1055
+ * The join the ledger has never had. Every existing query walks run → what
1056
+ * happened; nothing walks commit → which run, because until this field no
1057
+ * commit, branch or PR identifier existed anywhere in the pipeline
1058
+ * (docs/plans/run-commit-anchor-plan.md). An anchor also cannot be backfilled:
1059
+ * a run that closes without one is unanchorable forever, which is why it is
1060
+ * captured before its first reader exists.
1061
+ *
1062
+ * Absence is an ordinary answer rather than a failure to report. A session runs
1063
+ * outside a git repo; git is missing, or slow enough that the capture's own
1064
+ * timeout fires — the field is then simply not sent, and the run's columns stay
1065
+ * null. A checkout on a detached head sends an anchor with a null `branch`.
1066
+ * None of it says anything to the user: a run that produced no identifiable
1067
+ * commit is a normal run, and the CLI has nothing to offer them about it.
1068
+ *
1069
+ * There is deliberately no `prNumber` here. It is the one part of the anchor
1070
+ * that is not free: no environment variable in a real cloud agent session names
1071
+ * a PR (checked 2026-08-22 — see the spec's Open questions), so a wire field
1072
+ * for it would be protocol surface no producer ever fills. `runs.pr_number`
1073
+ * exists as a reserved column; the wire waits for a mechanism.
1074
+ *
1075
+ * Not a per-action field and not a per-session map: it describes the machine
1076
+ * and the checkout at one instant, the way `RuleFileManifestSchema` does, and
1077
+ * applies to whichever runs the request closes.
1078
+ */
1079
+ export declare const CommitAnchorSchema: v.ObjectSchema<{
1080
+ /**
1081
+ * `git rev-parse HEAD`. Full 40-hex only — an abbreviated sha is ambiguous
1082
+ * across repos and would make the reverse index it feeds silently lossy.
1083
+ *
1084
+ * Required *within* the object, while the object itself is optional. The two
1085
+ * together say the one thing worth saying: an anchor exists exactly when a
1086
+ * head was observed. A nullable `headSha` would add a third state — "an
1087
+ * anchor, but of nothing" — that no caller can produce (the only checkout
1088
+ * with a branch and no head is one with no commits, where both probes fail)
1089
+ * and every reader would still have to handle.
1090
+ */
1091
+ readonly headSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
1092
+ /**
1093
+ * The branch name, or null on a detached head — which is a real state a
1094
+ * bisect or a CI checkout sits in, not an error. Capped so a pathological
1095
+ * ref name cannot widen the payload.
1096
+ */
1097
+ readonly branch: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
1098
+ }, undefined>;
1099
+ /**
1100
+ * The agent's closing account of the run — the prose of the session's final
1101
+ * assistant message (docs/plans/claim-vs-actual-discrepancy-plan.md, slice 1).
1102
+ *
1103
+ * **The same content class as narration, so it is literally the same schema**
1104
+ * rather than a twin of it: produced by the same client-side pipeline (text
1105
+ * blocks only → strip code structurally → redact prose → bound), carrying the
1106
+ * same guarantees, capped at the same `MAX_ACTION_NARRATION_CHARS`, and
1107
+ * rejected on the same line-initial fence. A separate declaration with the same
1108
+ * body would be two homes for one rule and would drift the first time either
1109
+ * moved. What differs is *which* prose and how much of it — the client's
1110
+ * concern, decided in `extractRunSelfReport`, not the wire's.
1111
+ *
1112
+ * `minLength(1)` because absence has exactly one representation here: a run
1113
+ * with nothing to report omits the field. An empty string would be a second
1114
+ * spelling of null that every reader would then have to handle.
1115
+ *
1116
+ * **It names its session, and that is not decoration.** This is where the
1117
+ * report parts company with `CommitAnchorSchema`, which carries no session id
1118
+ * and is right not to: an anchor describes the *checkout*, so it applies to
1119
+ * whichever runs a request closes. A self-report describes the work of exactly
1120
+ * one session. A request can close more than one — `buildSyncBatches` marks
1121
+ * every session in the upload's actions completed when `sessionComplete` is set
1122
+ * (`packages/cli/src/sync-batches.ts:118-126`), which a `SessionEnd` sync hits
1123
+ * whenever an earlier session's `Stop` sync failed and left a backlog. Without
1124
+ * the id the server would write one session's closing summary onto the other
1125
+ * session's run, and slice 2 would then grade a run's actions against a report
1126
+ * of different work: a confidently wrong finding, which this pipeline ranks
1127
+ * below having none at all (`packages/cli/src/transcript/narration.ts:1-20`).
1128
+ *
1129
+ * The id makes the server the enforcement point rather than the client. A CLI
1130
+ * that attaches the report to the wrong batch cannot misattribute it, because
1131
+ * the writer matches on this field instead of trusting placement.
1132
+ */
1133
+ export declare const RunSelfReportSchema: v.ObjectSchema<{
1134
+ /** The session whose closing message this is. Must be one the request closes. */
1135
+ readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1136
+ /** The report itself — same content class and cap as narration. */
1137
+ readonly text: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, v.MinLengthAction<string, 1, undefined>]>;
1138
+ }, undefined>;
1139
+ export type RunSelfReport = v.InferOutput<typeof RunSelfReportSchema>;
1007
1140
  export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
1008
1141
  readonly actions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
1009
1142
  readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must not contain whitespace or control characters">]>, undefined>;
@@ -1252,6 +1385,62 @@ export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
1252
1385
  */
1253
1386
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1254
1387
  }, undefined>, undefined>;
1388
+ /**
1389
+ * Where the checkout stood when this request's `completedSessionIds` closed —
1390
+ * see {@link CommitAnchorSchema}.
1391
+ *
1392
+ * Rides only the batches that name a completed session, which is the opposite
1393
+ * of `ruleManifest`'s placement rule and deliberately so. The ordinary
1394
+ * `SessionEnd` request carries **no actions at all** — the preceding `Stop`
1395
+ * hook synced and advanced the run-log cursor — so a field attached to
1396
+ * action-carrying batches would be absent from exactly the request that
1397
+ * exists to report the close.
1398
+ *
1399
+ * Optional, and an absent anchor is never an error: a CLI predating this
1400
+ * sends none, and the server must read its absence as "no head observed"
1401
+ * rather than refusing the close.
1402
+ */
1403
+ readonly commitAnchor: v.OptionalSchema<v.ObjectSchema<{
1404
+ /**
1405
+ * `git rev-parse HEAD`. Full 40-hex only — an abbreviated sha is ambiguous
1406
+ * across repos and would make the reverse index it feeds silently lossy.
1407
+ *
1408
+ * Required *within* the object, while the object itself is optional. The two
1409
+ * together say the one thing worth saying: an anchor exists exactly when a
1410
+ * head was observed. A nullable `headSha` would add a third state — "an
1411
+ * anchor, but of nothing" — that no caller can produce (the only checkout
1412
+ * with a branch and no head is one with no commits, where both probes fail)
1413
+ * and every reader would still have to handle.
1414
+ */
1415
+ readonly headSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
1416
+ /**
1417
+ * The branch name, or null on a detached head — which is a real state a
1418
+ * bisect or a CI checkout sits in, not an error. Capped so a pathological
1419
+ * ref name cannot widen the payload.
1420
+ */
1421
+ readonly branch: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
1422
+ }, undefined>, undefined>;
1423
+ /**
1424
+ * What the agent said it did, as its own closing message — see
1425
+ * {@link RunSelfReportSchema}.
1426
+ *
1427
+ * Rides the same batches as `commitAnchor` and for the same reason: it
1428
+ * describes the *session that just ended*, and the ordinary `SessionEnd`
1429
+ * request carries no actions to attach it to. The server writes it onto the
1430
+ * runs this request closes.
1431
+ *
1432
+ * Optional, and its absence is never an error or a finding. A CLI predating
1433
+ * this sends none; so does a session with no transcript, one whose repo has
1434
+ * narration switched off, and one that ended without the agent speaking. All
1435
+ * of them are ordinary runs, and nothing downstream distinguishes them —
1436
+ * "could not compare" is not a verdict and renders nothing.
1437
+ */
1438
+ readonly selfReport: v.OptionalSchema<v.ObjectSchema<{
1439
+ /** The session whose closing message this is. Must be one the request closes. */
1440
+ readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1441
+ /** The report itself — same content class and cap as narration. */
1442
+ readonly text: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, v.MinLengthAction<string, 1, undefined>]>;
1443
+ }, undefined>, undefined>;
1255
1444
  }, undefined>;
1256
1445
  export declare const ExtractedGuideSuggestionSchema: v.ObjectSchema<{
1257
1446
  readonly id: v.StringSchema<undefined>;
@@ -1415,6 +1604,513 @@ declare const KNOWN_ACTION_TYPES: readonly ["file_edit", "file_read", "shell_com
1415
1604
  export type KnownActionType = (typeof KNOWN_ACTION_TYPES)[number];
1416
1605
  /** True when `value` is one of the action types the CLI produces on purpose. */
1417
1606
  export declare function isKnownActionType(value: string): value is KnownActionType;
1607
+ /**
1608
+ * The read an agent makes of a guide's own grading record, so the improvement
1609
+ * loop the user already runs in-conversation ("what could be improved in this
1610
+ * skill?") has the evidence Mossbear holds and the agent does not.
1611
+ *
1612
+ * **Evidence out, never instructions out.** Nothing in this contract carries a
1613
+ * directive to change anything, and nothing on the server writes as a result of
1614
+ * it. It is a read, and the decision stays in the user's conversation
1615
+ * (`docs/plans/guide-history-for-agents-plan.md` → Boundaries).
1616
+ */
1617
+ /**
1618
+ * How the agent names the guide.
1619
+ *
1620
+ * Either a repo-relative path exactly as the guide file declares it
1621
+ * (`.claude/skills/reviewer/SKILL.md`, `AGENTS.md`), or the bare name of a
1622
+ * skill (`reviewer`), which the server expands to the skill layouts it knows.
1623
+ * Both resolve through the `(root, path)` identity import already reconciles
1624
+ * on, rather than a second one invented here.
1625
+ *
1626
+ * Bounded and shape-checked at the boundary rather than at the query string: it
1627
+ * reaches a SQL predicate, and an identifier is not free text.
1628
+ */
1629
+ export declare const GuideHistoryIdentifierSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "guide must not contain control characters">]>;
1630
+ /**
1631
+ * The request an agent sends.
1632
+ *
1633
+ * `root` is optional and is the disambiguator, not decoration: `.claude/skills`
1634
+ * is scanned under **both** discovery roots
1635
+ * (`packages/cli/src/rules/discover.ts:101,105`), so a project skill and its
1636
+ * `~/.claude/skills` twin declare the same path string. When the identifier
1637
+ * reaches guides under more than one root and no root was given, the server
1638
+ * refuses and names both rather than picking one — answering a question about
1639
+ * the wrong file's history is worse than not answering it.
1640
+ */
1641
+ export declare const GuideHistoryRequestSchema: v.ObjectSchema<{
1642
+ readonly guide: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "guide must not contain control characters">]>;
1643
+ readonly root: v.OptionalSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
1644
+ /**
1645
+ * Which repo's copy — **the axis import itself reconciles on**, and the one
1646
+ * that actually resolves the common collision.
1647
+ *
1648
+ * `root` alone does not, and assuming it did was the first version's defect:
1649
+ * import's resolution key is `(userId, repoId, root, path)` and two files at
1650
+ * one path under different repos deliberately stay two rows
1651
+ * (`apps/dashboard/app/api/rules/import+api.ts:170-171`, Decision 6). So any
1652
+ * user with two repos has two guides at `(project, AGENTS.md)`, and a refusal
1653
+ * telling them to pass `root` names the one field that cannot separate those.
1654
+ *
1655
+ * `projectId` is the portable identity a repo commits and every clone agrees
1656
+ * on; `repoId` is the machine-local digest. Both are optional and both are
1657
+ * what the caller already sends at import time, so an agent running inside a
1658
+ * repo supplies them without being asked.
1659
+ */
1660
+ readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
1661
+ readonly repoId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
1662
+ /**
1663
+ * The exact guide, when the caller has already been shown the candidates.
1664
+ *
1665
+ * The escape hatch that makes the refusal always satisfiable: two repos can
1666
+ * be indistinguishable to a caller that knows neither id (a guide imported
1667
+ * before repo identity was recorded carries neither), and an error whose
1668
+ * remedy cannot be carried out is worse than no remedy at all. The 409 names
1669
+ * this id for every candidate.
1670
+ */
1671
+ readonly guideId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
1672
+ }, undefined>;
1673
+ export type GuideHistoryRequest = v.InferOutput<typeof GuideHistoryRequestSchema>;
1674
+ /**
1675
+ * One revision of a guide's wording: the body file and the version it stood at.
1676
+ *
1677
+ * The pair, never a bare version number — `guide_files.version` restarts at 1
1678
+ * per row, so a number alone compares equal across two different files
1679
+ * (`apps/dashboard/src/lib/guides/guideRevision.ts`).
1680
+ */
1681
+ export declare const GuideHistoryRevisionSchema: v.ObjectSchema<{
1682
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1683
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1684
+ }, undefined>;
1685
+ export type GuideHistoryRevision = v.InferOutput<typeof GuideHistoryRevisionSchema>;
1686
+ /**
1687
+ * Which of three states the guide's record is in — a required field rather than
1688
+ * something a reader infers from empty arrays.
1689
+ *
1690
+ * The distinction is the whole point of returning it: `unevaluated` means no
1691
+ * graded run has ever produced a verdict, while `awaiting_current_revision`
1692
+ * means the guide has a real record that is entirely about wording the user has
1693
+ * since rewritten. Collapsing those two onto "no data" is exactly the claim the
1694
+ * dashboard stopped making (`guidePerformance.ts` → `isAwaitingCurrentRevision`),
1695
+ * and an agent reading an absence as a verdict is the same error one screen
1696
+ * further out.
1697
+ */
1698
+ export declare const GuideHistoryStateSchema: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
1699
+ export type GuideHistoryState = v.InferOutput<typeof GuideHistoryStateSchema>;
1700
+ /**
1701
+ * The verdict window, scoped to the revision named beside it.
1702
+ *
1703
+ * Both denominators travel: `applicable` is the rate's own denominator
1704
+ * (`aligned + misaligned`), `total` is the window's row count including the runs
1705
+ * that never engaged the guide. Rendering one as the other is the defect
1706
+ * `alignment-rate-sample-disclosure` was filed for, and a payload carrying only
1707
+ * one of them would hand an agent the same mistake.
1708
+ */
1709
+ export declare const GuideHistoryWindowSchema: v.ObjectSchema<{
1710
+ /** Rows summarized, after the revision narrow. */
1711
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1712
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1713
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1714
+ /** In context, never engaged. Neither a pass nor a failure. */
1715
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1716
+ /** `aligned + misaligned` — the rate's own denominator. */
1717
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1718
+ /** `aligned / applicable`, or **null when no run engaged the guide**. */
1719
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1720
+ /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
1721
+ readonly isWindowed: v.BooleanSchema<undefined>;
1722
+ /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
1723
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1724
+ /**
1725
+ * Verdicts fetched and then dropped by the revision narrow — about wording
1726
+ * that is no longer current, or citing no revision at all. A **floor** rather
1727
+ * than a total whenever `isWindowed`, because rows past the cap were never
1728
+ * fetched.
1729
+ */
1730
+ readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1731
+ /**
1732
+ * `applicable` is too small for the percentage to mean anything — threshold
1733
+ * `applicable < 3` (founder, 2026-08-22,
1734
+ * `docs/plans/alignment-rate-sample-disclosure-plan.md` → Resolved). Read the
1735
+ * counts, not the rate.
1736
+ */
1737
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
1738
+ }, undefined>;
1739
+ export type GuideHistoryWindow = v.InferOutput<typeof GuideHistoryWindowSchema>;
1740
+ /**
1741
+ * One side of a guide edit's before/after pair — the wording, and what the runs
1742
+ * that engaged it did.
1743
+ *
1744
+ * Structurally a window like `GuideHistoryWindow` and deliberately not that
1745
+ * schema: these two sides are bounded **per revision** by a different query
1746
+ * (`apps/dashboard/src/server/guides/revisionWindows.ts`), so `isSaturated` is
1747
+ * the server's own measurement of its partition rather than the client-side
1748
+ * `isWindowed` inference, and the span each side covers is part of what makes
1749
+ * the pair readable.
1750
+ *
1751
+ * Both denominators travel here for the same reason they travel on the window:
1752
+ * a delta between two undisclosed denominators is worse than no number at all.
1753
+ */
1754
+ export declare const GuideHistoryChangeSideSchema: v.ObjectSchema<{
1755
+ /** The wording this side judges. */
1756
+ readonly revision: v.ObjectSchema<{
1757
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1758
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1759
+ }, undefined>;
1760
+ /** Rows in this side's window, including the runs that never engaged it. */
1761
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1762
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1763
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1764
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1765
+ /** `aligned + misaligned` — this side's own denominator. */
1766
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1767
+ /** `aligned / applicable`, or null when no run engaged this wording. */
1768
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1769
+ /** This side is below the sample floor, so read its counts and not its rate. */
1770
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
1771
+ /**
1772
+ * This side is a bounded sample of its revision rather than the whole record.
1773
+ * A saturated side beside an unsaturated one is two different kinds of
1774
+ * number, and comparing them without saying so is the defect the flag exists
1775
+ * to stop.
1776
+ */
1777
+ readonly isSaturated: v.BooleanSchema<undefined>;
1778
+ /** The span this side covers, ISO. Both null on a side with no rows. */
1779
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1780
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1781
+ }, undefined>;
1782
+ export type GuideHistoryChangeSide = v.InferOutput<typeof GuideHistoryChangeSideSchema>;
1783
+ /**
1784
+ * Which side is too thin for a delta to mean anything.
1785
+ *
1786
+ * Named rather than a boolean because the two take different sentences: too few
1787
+ * runs *since* the change is the ordinary state right after an edit, while too
1788
+ * few *before* it means there was never a baseline to compare against.
1789
+ */
1790
+ export declare const GuideHistoryChangeSuppressionSchema: v.PicklistSchema<["since", "before", "both"], undefined>;
1791
+ /**
1792
+ * Which way the pair points, or null while the delta is withheld.
1793
+ *
1794
+ * A reading of a *set* of runs, never a verdict on one — the vocabulary
1795
+ * `aligned | misaligned | not_applicable` is untouched, and nothing derived
1796
+ * here is written back to a row.
1797
+ */
1798
+ export declare const GuideHistoryChangeDirectionSchema: v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>;
1799
+ /**
1800
+ * The guide's last edit, read as two windows
1801
+ * (`insight-to-proven-change` §A, surfaced by `guide-history-for-agents`
1802
+ * deliverable 3).
1803
+ *
1804
+ * > Changed 12 Aug. Before: misaligned in 6 of 8 runs that engaged it.
1805
+ * > Since: 0 of 11.
1806
+ *
1807
+ * **Null on the response is a state, not a missing field.** It means this guide
1808
+ * has no earlier wording that produced evidence — a guide on its first
1809
+ * revision, which is the normal state and not an error.
1810
+ *
1811
+ * **Paired, never merged**, and **never causal**: this states two windows and
1812
+ * their denominators and stops. The model changed, the task mix changed and the
1813
+ * codebase changed too, so "since" is the strongest word the evidence supports.
1814
+ */
1815
+ export declare const GuideHistoryChangeSchema: v.ObjectSchema<{
1816
+ /** The revision that preceded the change. */
1817
+ readonly before: v.ObjectSchema<{
1818
+ /** The wording this side judges. */
1819
+ readonly revision: v.ObjectSchema<{
1820
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1821
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1822
+ }, undefined>;
1823
+ /** Rows in this side's window, including the runs that never engaged it. */
1824
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1825
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1826
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1827
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1828
+ /** `aligned + misaligned` — this side's own denominator. */
1829
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1830
+ /** `aligned / applicable`, or null when no run engaged this wording. */
1831
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1832
+ /** This side is below the sample floor, so read its counts and not its rate. */
1833
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
1834
+ /**
1835
+ * This side is a bounded sample of its revision rather than the whole record.
1836
+ * A saturated side beside an unsaturated one is two different kinds of
1837
+ * number, and comparing them without saying so is the defect the flag exists
1838
+ * to stop.
1839
+ */
1840
+ readonly isSaturated: v.BooleanSchema<undefined>;
1841
+ /** The span this side covers, ISO. Both null on a side with no rows. */
1842
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1843
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1844
+ }, undefined>;
1845
+ /** The wording the guide stands at now. */
1846
+ readonly since: v.ObjectSchema<{
1847
+ /** The wording this side judges. */
1848
+ readonly revision: v.ObjectSchema<{
1849
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1850
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1851
+ }, undefined>;
1852
+ /** Rows in this side's window, including the runs that never engaged it. */
1853
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1854
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1855
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1856
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1857
+ /** `aligned + misaligned` — this side's own denominator. */
1858
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1859
+ /** `aligned / applicable`, or null when no run engaged this wording. */
1860
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1861
+ /** This side is below the sample floor, so read its counts and not its rate. */
1862
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
1863
+ /**
1864
+ * This side is a bounded sample of its revision rather than the whole record.
1865
+ * A saturated side beside an unsaturated one is two different kinds of
1866
+ * number, and comparing them without saying so is the defect the flag exists
1867
+ * to stop.
1868
+ */
1869
+ readonly isSaturated: v.BooleanSchema<undefined>;
1870
+ /** The span this side covers, ISO. Both null on a side with no rows. */
1871
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1872
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1873
+ }, undefined>;
1874
+ /**
1875
+ * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
1876
+ * suppressed** or either side never engaged the guide. Null is not zero: one
1877
+ * says the evidence does not support a number, the other would be a claim.
1878
+ */
1879
+ readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1880
+ /**
1881
+ * Which side is below the sample floor, or null when neither is and the delta
1882
+ * stands. `'since'` is the ordinary post-edit state — *not enough runs since
1883
+ * this change* — and is reported rather than omitted.
1884
+ */
1885
+ readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
1886
+ /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
1887
+ readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
1888
+ /** Either side is a bounded sample, so neither is a lifetime total. */
1889
+ readonly isWindowed: v.BooleanSchema<undefined>;
1890
+ /** The per-revision cap each side was bounded by, so "sample" has a size. */
1891
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1892
+ /**
1893
+ * When the current wording was recorded, ISO — the boundary between the two
1894
+ * windows, and null when no version row carries it.
1895
+ *
1896
+ * A date, never an attribution: it says when the window opened, not that the
1897
+ * edit caused what happened inside it.
1898
+ */
1899
+ readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1900
+ }, undefined>;
1901
+ export type GuideHistoryChange = v.InferOutput<typeof GuideHistoryChangeSchema>;
1902
+ /** Findings returned per response, and the character bound on each reasoning. */
1903
+ export declare const MAX_GUIDE_HISTORY_FINDINGS = 5;
1904
+ export declare const MAX_GUIDE_HISTORY_REASONING_CHARS = 1200;
1905
+ /**
1906
+ * One recorded finding: a run that judged this guide misaligned, and why.
1907
+ *
1908
+ * `reasoning` arrives **already wrapped in the response's untrusted markers**
1909
+ * rather than raw. It is model-authored text derived from a transcript, so the
1910
+ * discipline `runGradePrompt` applies to such text on the way in applies on the
1911
+ * way out (`apps/dashboard/src/lib/eval/promptSafety.ts` →
1912
+ * `deriveDelimiterToken`); wrapping it at the source is what makes the boundary
1913
+ * unforgeable, since a consumer handed raw text plus separate markers can
1914
+ * simply not use them.
1915
+ *
1916
+ * `isCurrentRevision` is not optional detail. A payload that scopes its *rate*
1917
+ * to the current wording and then hands over reasoning about deleted sentences,
1918
+ * unlabelled, reproduces inside one response the conflation
1919
+ * `pattern-evidence-guide-revision` removed from the dashboard.
1920
+ */
1921
+ export declare const GuideHistoryFindingSchema: v.ObjectSchema<{
1922
+ readonly runId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1923
+ readonly occurredAt: v.StringSchema<undefined>;
1924
+ readonly revision: v.NullableSchema<v.ObjectSchema<{
1925
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1926
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1927
+ }, undefined>, undefined>;
1928
+ readonly isCurrentRevision: v.BooleanSchema<undefined>;
1929
+ readonly reasoning: v.StringSchema<undefined>;
1930
+ }, undefined>;
1931
+ export type GuideHistoryFinding = v.InferOutput<typeof GuideHistoryFindingSchema>;
1932
+ /** The guide the identifier resolved to, echoed so the agent can check itself. */
1933
+ export declare const GuideHistoryGuideSchema: v.ObjectSchema<{
1934
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1935
+ readonly title: v.StringSchema<undefined>;
1936
+ readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
1937
+ readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
1938
+ }, undefined>;
1939
+ /**
1940
+ * The markers every `reasoning` block in this response is wrapped in, plus a
1941
+ * statement of what they mean.
1942
+ *
1943
+ * Generated per response from the content itself, so no marker-like text inside
1944
+ * a block can end it early — a property `deriveDelimiterToken` checks rather
1945
+ * than assumes.
1946
+ */
1947
+ export declare const GuideHistoryUntrustedSchema: v.ObjectSchema<{
1948
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1949
+ readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1950
+ readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1951
+ readonly note: v.StringSchema<undefined>;
1952
+ }, undefined>;
1953
+ export declare const GuideHistoryResponseSchema: v.ObjectSchema<{
1954
+ readonly guide: v.ObjectSchema<{
1955
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1956
+ readonly title: v.StringSchema<undefined>;
1957
+ readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
1958
+ readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
1959
+ }, undefined>;
1960
+ /** The wording the window is about, or null when the guide has no revision identity. */
1961
+ readonly currentRevision: v.NullableSchema<v.ObjectSchema<{
1962
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1963
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1964
+ }, undefined>, undefined>;
1965
+ readonly state: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
1966
+ readonly window: v.ObjectSchema<{
1967
+ /** Rows summarized, after the revision narrow. */
1968
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1969
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1970
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1971
+ /** In context, never engaged. Neither a pass nor a failure. */
1972
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1973
+ /** `aligned + misaligned` — the rate's own denominator. */
1974
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1975
+ /** `aligned / applicable`, or **null when no run engaged the guide**. */
1976
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1977
+ /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
1978
+ readonly isWindowed: v.BooleanSchema<undefined>;
1979
+ /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
1980
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1981
+ /**
1982
+ * Verdicts fetched and then dropped by the revision narrow — about wording
1983
+ * that is no longer current, or citing no revision at all. A **floor** rather
1984
+ * than a total whenever `isWindowed`, because rows past the cap were never
1985
+ * fetched.
1986
+ */
1987
+ readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
1988
+ /**
1989
+ * `applicable` is too small for the percentage to mean anything — threshold
1990
+ * `applicable < 3` (founder, 2026-08-22,
1991
+ * `docs/plans/alignment-rate-sample-disclosure-plan.md` → Resolved). Read the
1992
+ * counts, not the rate.
1993
+ */
1994
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
1995
+ }, undefined>;
1996
+ /**
1997
+ * The last edit's two windows, or **null when there is no earlier wording to
1998
+ * compare against**.
1999
+ *
2000
+ * Present-and-null rather than omitted: a guide on its first revision has no
2001
+ * delta, and that is an answer. An absent key would leave a reader unable to
2002
+ * tell "no edit to measure" from "this server does not report deltas".
2003
+ */
2004
+ readonly change: v.NullableSchema<v.ObjectSchema<{
2005
+ /** The revision that preceded the change. */
2006
+ readonly before: v.ObjectSchema<{
2007
+ /** The wording this side judges. */
2008
+ readonly revision: v.ObjectSchema<{
2009
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2010
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2011
+ }, undefined>;
2012
+ /** Rows in this side's window, including the runs that never engaged it. */
2013
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2014
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2015
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2016
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2017
+ /** `aligned + misaligned` — this side's own denominator. */
2018
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2019
+ /** `aligned / applicable`, or null when no run engaged this wording. */
2020
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
2021
+ /** This side is below the sample floor, so read its counts and not its rate. */
2022
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
2023
+ /**
2024
+ * This side is a bounded sample of its revision rather than the whole record.
2025
+ * A saturated side beside an unsaturated one is two different kinds of
2026
+ * number, and comparing them without saying so is the defect the flag exists
2027
+ * to stop.
2028
+ */
2029
+ readonly isSaturated: v.BooleanSchema<undefined>;
2030
+ /** The span this side covers, ISO. Both null on a side with no rows. */
2031
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2032
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2033
+ }, undefined>;
2034
+ /** The wording the guide stands at now. */
2035
+ readonly since: v.ObjectSchema<{
2036
+ /** The wording this side judges. */
2037
+ readonly revision: v.ObjectSchema<{
2038
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2039
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2040
+ }, undefined>;
2041
+ /** Rows in this side's window, including the runs that never engaged it. */
2042
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2043
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2044
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2045
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2046
+ /** `aligned + misaligned` — this side's own denominator. */
2047
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2048
+ /** `aligned / applicable`, or null when no run engaged this wording. */
2049
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
2050
+ /** This side is below the sample floor, so read its counts and not its rate. */
2051
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
2052
+ /**
2053
+ * This side is a bounded sample of its revision rather than the whole record.
2054
+ * A saturated side beside an unsaturated one is two different kinds of
2055
+ * number, and comparing them without saying so is the defect the flag exists
2056
+ * to stop.
2057
+ */
2058
+ readonly isSaturated: v.BooleanSchema<undefined>;
2059
+ /** The span this side covers, ISO. Both null on a side with no rows. */
2060
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2061
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2062
+ }, undefined>;
2063
+ /**
2064
+ * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
2065
+ * suppressed** or either side never engaged the guide. Null is not zero: one
2066
+ * says the evidence does not support a number, the other would be a claim.
2067
+ */
2068
+ readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
2069
+ /**
2070
+ * Which side is below the sample floor, or null when neither is and the delta
2071
+ * stands. `'since'` is the ordinary post-edit state — *not enough runs since
2072
+ * this change* — and is reported rather than omitted.
2073
+ */
2074
+ readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
2075
+ /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
2076
+ readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
2077
+ /** Either side is a bounded sample, so neither is a lifetime total. */
2078
+ readonly isWindowed: v.BooleanSchema<undefined>;
2079
+ /** The per-revision cap each side was bounded by, so "sample" has a size. */
2080
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2081
+ /**
2082
+ * When the current wording was recorded, ISO — the boundary between the two
2083
+ * windows, and null when no version row carries it.
2084
+ *
2085
+ * A date, never an attribution: it says when the window opened, not that the
2086
+ * edit caused what happened inside it.
2087
+ */
2088
+ readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2089
+ }, undefined>, undefined>;
2090
+ readonly findings: v.ArraySchema<v.ObjectSchema<{
2091
+ readonly runId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2092
+ readonly occurredAt: v.StringSchema<undefined>;
2093
+ readonly revision: v.NullableSchema<v.ObjectSchema<{
2094
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2095
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2096
+ }, undefined>, undefined>;
2097
+ readonly isCurrentRevision: v.BooleanSchema<undefined>;
2098
+ readonly reasoning: v.StringSchema<undefined>;
2099
+ }, undefined>, undefined>;
2100
+ /**
2101
+ * Misaligned rows in the window beyond the `MAX_GUIDE_HISTORY_FINDINGS`
2102
+ * returned. Reported rather than silently truncated: a caller reading five
2103
+ * findings has no other way to know it is reading five of forty.
2104
+ */
2105
+ readonly findingsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
2106
+ readonly untrusted: v.ObjectSchema<{
2107
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2108
+ readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2109
+ readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2110
+ readonly note: v.StringSchema<undefined>;
2111
+ }, undefined>;
2112
+ }, undefined>;
2113
+ export type GuideHistoryResponse = v.InferOutput<typeof GuideHistoryResponseSchema>;
1418
2114
  export declare function parseAgentConfig(data: unknown): {
1419
2115
  id: string;
1420
2116
  name: string;
@@ -1489,7 +2185,6 @@ export declare function parseBundle(data: unknown): {
1489
2185
  slug: string;
1490
2186
  name: string;
1491
2187
  createdAt: string;
1492
- ownedByCaller?: boolean | undefined;
1493
2188
  };
1494
2189
  export declare function parseBundleListResponse(data: unknown): {
1495
2190
  bundles: {
@@ -1497,7 +2192,6 @@ export declare function parseBundleListResponse(data: unknown): {
1497
2192
  slug: string;
1498
2193
  name: string;
1499
2194
  createdAt: string;
1500
- ownedByCaller?: boolean | undefined;
1501
2195
  }[];
1502
2196
  };
1503
2197
  export declare function parseCreateBundleRequest(data: unknown): {
@@ -1510,12 +2204,11 @@ export declare function parseCreateBundleResponse(data: unknown): {
1510
2204
  slug: string;
1511
2205
  name: string;
1512
2206
  createdAt: string;
1513
- ownedByCaller?: boolean | undefined;
1514
2207
  };
1515
2208
  };
1516
2209
  export declare function parseAttachBundleMemberRequest(data: unknown): {
1517
2210
  itemId: string;
1518
- itemType?: "guide_file" | "guide" | undefined;
2211
+ itemType?: "guide" | "guide_file" | undefined;
1519
2212
  };
1520
2213
  export declare function parseAttachBundleMemberResponse(data: unknown): {
1521
2214
  attached: boolean;
@@ -1523,6 +2216,20 @@ export declare function parseAttachBundleMemberResponse(data: unknown): {
1523
2216
  export declare function parseDetachBundleMemberResponse(data: unknown): {
1524
2217
  detached: boolean;
1525
2218
  };
2219
+ export declare function parseResolveSubscriptionsRequest(data: unknown): {
2220
+ repoBundleIds: string[];
2221
+ };
2222
+ export declare function parseResolveSubscriptionsResponse(data: unknown): {
2223
+ bundles: {
2224
+ id: string;
2225
+ slug: string;
2226
+ name: string;
2227
+ scopes: ("repo" | "user")[];
2228
+ }[];
2229
+ unresolved: {
2230
+ id: string;
2231
+ }[];
2232
+ };
1526
2233
  export declare function parseRenameBundleRequest(data: unknown): {
1527
2234
  name: string;
1528
2235
  };
@@ -1532,7 +2239,6 @@ export declare function parseRenameBundleResponse(data: unknown): {
1532
2239
  slug: string;
1533
2240
  name: string;
1534
2241
  createdAt: string;
1535
- ownedByCaller?: boolean | undefined;
1536
2242
  };
1537
2243
  };
1538
2244
  export declare function parseDeleteBundleResponse(data: unknown): {
@@ -1540,7 +2246,7 @@ export declare function parseDeleteBundleResponse(data: unknown): {
1540
2246
  };
1541
2247
  export declare function parseContextItem(data: unknown): {
1542
2248
  id: string;
1543
- type: "reference" | "guide" | "document" | "asset";
2249
+ type: string;
1544
2250
  name: string;
1545
2251
  contentType: string;
1546
2252
  content: string | null;
@@ -1553,7 +2259,7 @@ export declare function parseContextItem(data: unknown): {
1553
2259
  export declare function parseContextItemsResponse(data: unknown): {
1554
2260
  items: {
1555
2261
  id: string;
1556
- type: "reference" | "guide" | "document" | "asset";
2262
+ type: string;
1557
2263
  name: string;
1558
2264
  contentType: string;
1559
2265
  content: string | null;
@@ -1566,7 +2272,7 @@ export declare function parseContextItemsResponse(data: unknown): {
1566
2272
  };
1567
2273
  export declare function parsePushContextRequest(data: unknown): {
1568
2274
  name: string;
1569
- contentType: "reference" | "document" | "asset";
2275
+ contentType: "document" | "reference" | "asset";
1570
2276
  content: string;
1571
2277
  itemId?: string | undefined;
1572
2278
  origin?: string | null | undefined;
@@ -1576,7 +2282,7 @@ export declare function parsePushContextRequest(data: unknown): {
1576
2282
  export declare function parsePushContextResponse(data: unknown): {
1577
2283
  item: {
1578
2284
  id: string;
1579
- type: "reference" | "guide" | "document" | "asset";
2285
+ type: string;
1580
2286
  name: string;
1581
2287
  contentType: string;
1582
2288
  content: string | null;
@@ -1598,7 +2304,7 @@ export declare function parseUpdateContextItemRequest(data: unknown): {
1598
2304
  export declare function parseUpdateContextItemResponse(data: unknown): {
1599
2305
  item: {
1600
2306
  id: string;
1601
- type: "reference" | "guide" | "document" | "asset";
2307
+ type: string;
1602
2308
  name: string;
1603
2309
  contentType: string;
1604
2310
  content: string | null;
@@ -1619,7 +2325,7 @@ export declare function parseUpdateContextItemBody(data: unknown): {
1619
2325
  export declare function parseContextItemResponse(data: unknown): {
1620
2326
  item: {
1621
2327
  id: string;
1622
- type: "reference" | "guide" | "document" | "asset";
2328
+ type: string;
1623
2329
  name: string;
1624
2330
  contentType: string;
1625
2331
  content: string | null;
@@ -1634,7 +2340,7 @@ export declare function parseArchiveContextItemResponse(data: unknown): {
1634
2340
  archived: boolean;
1635
2341
  item: {
1636
2342
  id: string;
1637
- type: "reference" | "guide" | "document" | "asset";
2343
+ type: string;
1638
2344
  name: string;
1639
2345
  contentType: string;
1640
2346
  content: string | null;
@@ -1646,7 +2352,7 @@ export declare function parseArchiveContextItemResponse(data: unknown): {
1646
2352
  };
1647
2353
  };
1648
2354
  export declare function parseInboxCaptureRequest(data: unknown): {
1649
- contentType: "document" | "asset";
2355
+ contentType: "document" | "reference" | "asset";
1650
2356
  content: string;
1651
2357
  name?: string | undefined;
1652
2358
  source?: string | undefined;
@@ -1654,7 +2360,7 @@ export declare function parseInboxCaptureRequest(data: unknown): {
1654
2360
  export declare function parseInboxCaptureResponse(data: unknown): {
1655
2361
  item: {
1656
2362
  id: string;
1657
- type: "reference" | "guide" | "document" | "asset";
2363
+ type: string;
1658
2364
  name: string;
1659
2365
  contentType: string;
1660
2366
  content: string | null;
@@ -1667,7 +2373,7 @@ export declare function parseInboxCaptureResponse(data: unknown): {
1667
2373
  export declare function parseInboxListResponse(data: unknown): {
1668
2374
  items: {
1669
2375
  id: string;
1670
- type: "reference" | "guide" | "document" | "asset";
2376
+ type: string;
1671
2377
  name: string;
1672
2378
  contentType: string;
1673
2379
  content: string | null;
@@ -1785,6 +2491,14 @@ export declare function parseDashboardSyncRequest(data: unknown): {
1785
2491
  }[];
1786
2492
  truncated?: boolean | undefined;
1787
2493
  } | undefined;
2494
+ commitAnchor?: {
2495
+ headSha: string;
2496
+ branch: string | null;
2497
+ } | undefined;
2498
+ selfReport?: {
2499
+ sessionId: string;
2500
+ text: string;
2501
+ } | undefined;
1788
2502
  };
1789
2503
  export declare function parseProposalCitation(data: unknown): {
1790
2504
  sessionId: string;
@@ -1864,5 +2578,94 @@ export declare function parseActionEntry(data: unknown): {
1864
2578
  exitCode?: number | undefined;
1865
2579
  } | undefined;
1866
2580
  };
2581
+ export declare function parseGuideHistoryRequest(data: unknown): {
2582
+ guide: string;
2583
+ root?: "project" | "global" | undefined;
2584
+ projectId?: string | undefined;
2585
+ repoId?: string | undefined;
2586
+ guideId?: string | undefined;
2587
+ };
2588
+ export declare function parseGuideHistoryResponse(data: unknown): {
2589
+ guide: {
2590
+ id: string;
2591
+ title: string;
2592
+ path: string | null;
2593
+ root: "project" | "global" | null;
2594
+ };
2595
+ currentRevision: {
2596
+ bodyItemId: string;
2597
+ version: number;
2598
+ } | null;
2599
+ state: "evaluated" | "awaiting_current_revision" | "unevaluated";
2600
+ window: {
2601
+ total: number;
2602
+ aligned: number;
2603
+ misaligned: number;
2604
+ notApplicable: number;
2605
+ applicable: number;
2606
+ alignmentRate: number | null;
2607
+ isWindowed: boolean;
2608
+ windowSize: number;
2609
+ olderRevisionRows: number;
2610
+ isLowConfidence: boolean;
2611
+ };
2612
+ change: {
2613
+ before: {
2614
+ revision: {
2615
+ bodyItemId: string;
2616
+ version: number;
2617
+ };
2618
+ total: number;
2619
+ aligned: number;
2620
+ misaligned: number;
2621
+ notApplicable: number;
2622
+ applicable: number;
2623
+ alignmentRate: number | null;
2624
+ isLowConfidence: boolean;
2625
+ isSaturated: boolean;
2626
+ newestAt: string | null;
2627
+ oldestAt: string | null;
2628
+ };
2629
+ since: {
2630
+ revision: {
2631
+ bodyItemId: string;
2632
+ version: number;
2633
+ };
2634
+ total: number;
2635
+ aligned: number;
2636
+ misaligned: number;
2637
+ notApplicable: number;
2638
+ applicable: number;
2639
+ alignmentRate: number | null;
2640
+ isLowConfidence: boolean;
2641
+ isSaturated: boolean;
2642
+ newestAt: string | null;
2643
+ oldestAt: string | null;
2644
+ };
2645
+ alignmentRateDelta: number | null;
2646
+ suppressedBy: "since" | "before" | "both" | null;
2647
+ direction: "improved" | "regressed" | "unchanged" | null;
2648
+ isWindowed: boolean;
2649
+ windowSize: number;
2650
+ changedAt: string | null;
2651
+ } | null;
2652
+ findings: {
2653
+ runId: string;
2654
+ occurredAt: string;
2655
+ revision: {
2656
+ bodyItemId: string;
2657
+ version: number;
2658
+ } | null;
2659
+ isCurrentRevision: boolean;
2660
+ reasoning: string;
2661
+ }[];
2662
+ findingsOmitted: number;
2663
+ untrusted: {
2664
+ token: string;
2665
+ startMarker: string;
2666
+ endMarker: string;
2667
+ note: string;
2668
+ };
2669
+ };
1867
2670
  export {};
1868
2671
  //# sourceMappingURL=schemas.d.ts.map