@mossbear/protocol 0.1.0-alpha.29 → 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
@@ -423,10 +423,10 @@ export declare const CreateBundleResponseSchema: v.ObjectSchema<{
423
423
  readonly createdAt: v.StringSchema<undefined>;
424
424
  }, undefined>;
425
425
  }, undefined>;
426
- export declare const BundleMemberTypeSchema: v.PicklistSchema<["guide_file", "guide"], undefined>;
426
+ export declare const BundleMemberTypeSchema: v.PicklistSchema<readonly ["guide_file", "guide"], undefined>;
427
427
  export declare const AttachBundleMemberRequestSchema: v.ObjectSchema<{
428
428
  readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
429
- readonly itemType: v.OptionalSchema<v.PicklistSchema<["guide_file", "guide"], undefined>, undefined>;
429
+ readonly itemType: v.OptionalSchema<v.PicklistSchema<readonly ["guide_file", "guide"], undefined>, undefined>;
430
430
  }, undefined>;
431
431
  export declare const AttachBundleMemberResponseSchema: v.ObjectSchema<{
432
432
  readonly attached: v.BooleanSchema<undefined>;
@@ -448,14 +448,14 @@ export declare const RenameBundleResponseSchema: v.ObjectSchema<{
448
448
  export declare const DeleteBundleResponseSchema: v.ObjectSchema<{
449
449
  readonly deleted: v.BooleanSchema<undefined>;
450
450
  }, undefined>;
451
- export declare const ContextItemTypeSchema: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
452
- export declare const PushContentTypeSchema: v.PicklistSchema<["document", "reference", "asset"], undefined>;
453
- 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>;
454
454
  /** Max serialized size (UTF-8 bytes) of a pushed or captured item's content. */
455
455
  export declare const MAX_CONTEXT_CONTENT_BYTES: number;
456
456
  export declare const ContextItemSchema: v.ObjectSchema<{
457
457
  readonly id: v.StringSchema<undefined>;
458
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
458
+ readonly type: v.PicklistSchema<string[], undefined>;
459
459
  readonly name: v.StringSchema<undefined>;
460
460
  readonly contentType: v.StringSchema<undefined>;
461
461
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -468,7 +468,7 @@ export declare const ContextItemSchema: v.ObjectSchema<{
468
468
  export declare const ContextItemsResponseSchema: v.ObjectSchema<{
469
469
  readonly items: v.ArraySchema<v.ObjectSchema<{
470
470
  readonly id: v.StringSchema<undefined>;
471
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
471
+ readonly type: v.PicklistSchema<string[], undefined>;
472
472
  readonly name: v.StringSchema<undefined>;
473
473
  readonly contentType: v.StringSchema<undefined>;
474
474
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -491,7 +491,7 @@ export declare const SourceItemIdsSchema: v.SchemaWithPipe<readonly [v.ArraySche
491
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>]>;
492
492
  export declare const PushContextRequestSchema: v.ObjectSchema<{
493
493
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
494
- readonly contentType: v.PicklistSchema<["document", "reference", "asset"], undefined>;
494
+ readonly contentType: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
495
495
  readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
496
496
  readonly itemId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
497
497
  readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
@@ -501,7 +501,7 @@ export declare const PushContextRequestSchema: v.ObjectSchema<{
501
501
  export declare const PushContextResponseSchema: v.ObjectSchema<{
502
502
  readonly item: v.ObjectSchema<{
503
503
  readonly id: v.StringSchema<undefined>;
504
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
504
+ readonly type: v.PicklistSchema<string[], undefined>;
505
505
  readonly name: v.StringSchema<undefined>;
506
506
  readonly contentType: v.StringSchema<undefined>;
507
507
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -523,7 +523,7 @@ export declare const UpdateContextItemRequestSchema: v.ObjectSchema<{
523
523
  export declare const UpdateContextItemResponseSchema: v.ObjectSchema<{
524
524
  readonly item: v.ObjectSchema<{
525
525
  readonly id: v.StringSchema<undefined>;
526
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
526
+ readonly type: v.PicklistSchema<string[], undefined>;
527
527
  readonly name: v.StringSchema<undefined>;
528
528
  readonly contentType: v.StringSchema<undefined>;
529
529
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -541,7 +541,7 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
541
541
  readonly content: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>, undefined>;
542
542
  readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
543
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>;
544
- }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
544
+ }, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
545
545
  readonly entries: Omit<{
546
546
  readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
547
547
  readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
@@ -586,7 +586,7 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
586
586
  export declare const ContextItemResponseSchema: v.ObjectSchema<{
587
587
  readonly item: v.ObjectSchema<{
588
588
  readonly id: v.StringSchema<undefined>;
589
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
589
+ readonly type: v.PicklistSchema<string[], undefined>;
590
590
  readonly name: v.StringSchema<undefined>;
591
591
  readonly contentType: v.StringSchema<undefined>;
592
592
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -601,7 +601,7 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
601
601
  readonly archived: v.BooleanSchema<undefined>;
602
602
  readonly item: v.ObjectSchema<{
603
603
  readonly id: v.StringSchema<undefined>;
604
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
604
+ readonly type: v.PicklistSchema<string[], undefined>;
605
605
  readonly name: v.StringSchema<undefined>;
606
606
  readonly contentType: v.StringSchema<undefined>;
607
607
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -613,14 +613,14 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
613
613
  }, undefined>;
614
614
  }, undefined>;
615
615
  export declare const InboxCaptureRequestSchema: v.ObjectSchema<{
616
- readonly contentType: v.PicklistSchema<["document", "asset"], undefined>;
616
+ readonly contentType: v.PicklistSchema<("document" | "reference" | "asset")[], undefined>;
617
617
  readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
618
618
  readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
619
619
  readonly source: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
620
620
  }, undefined>;
621
621
  export declare const InboxItemSchema: v.ObjectSchema<{
622
622
  readonly id: v.StringSchema<undefined>;
623
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
623
+ readonly type: v.PicklistSchema<string[], undefined>;
624
624
  readonly name: v.StringSchema<undefined>;
625
625
  readonly contentType: v.StringSchema<undefined>;
626
626
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -632,7 +632,7 @@ export declare const InboxItemSchema: v.ObjectSchema<{
632
632
  export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
633
633
  readonly item: v.ObjectSchema<{
634
634
  readonly id: v.StringSchema<undefined>;
635
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
635
+ readonly type: v.PicklistSchema<string[], undefined>;
636
636
  readonly name: v.StringSchema<undefined>;
637
637
  readonly contentType: v.StringSchema<undefined>;
638
638
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -645,7 +645,7 @@ export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
645
645
  export declare const InboxListResponseSchema: v.ObjectSchema<{
646
646
  readonly items: v.ArraySchema<v.ObjectSchema<{
647
647
  readonly id: v.StringSchema<undefined>;
648
- readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
648
+ readonly type: v.PicklistSchema<string[], undefined>;
649
649
  readonly name: v.StringSchema<undefined>;
650
650
  readonly contentType: v.StringSchema<undefined>;
651
651
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -1048,6 +1048,95 @@ export declare const RuleFileManifestSchema: v.ObjectSchema<{
1048
1048
  */
1049
1049
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1050
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>;
1051
1140
  export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
1052
1141
  readonly actions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
1053
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>;
@@ -1296,6 +1385,62 @@ export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
1296
1385
  */
1297
1386
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1298
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>;
1299
1444
  }, undefined>;
1300
1445
  export declare const ExtractedGuideSuggestionSchema: v.ObjectSchema<{
1301
1446
  readonly id: v.StringSchema<undefined>;
@@ -1459,6 +1604,513 @@ declare const KNOWN_ACTION_TYPES: readonly ["file_edit", "file_read", "shell_com
1459
1604
  export type KnownActionType = (typeof KNOWN_ACTION_TYPES)[number];
1460
1605
  /** True when `value` is one of the action types the CLI produces on purpose. */
1461
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>;
1462
2114
  export declare function parseAgentConfig(data: unknown): {
1463
2115
  id: string;
1464
2116
  name: string;
@@ -1556,7 +2208,7 @@ export declare function parseCreateBundleResponse(data: unknown): {
1556
2208
  };
1557
2209
  export declare function parseAttachBundleMemberRequest(data: unknown): {
1558
2210
  itemId: string;
1559
- itemType?: "guide_file" | "guide" | undefined;
2211
+ itemType?: "guide" | "guide_file" | undefined;
1560
2212
  };
1561
2213
  export declare function parseAttachBundleMemberResponse(data: unknown): {
1562
2214
  attached: boolean;
@@ -1594,7 +2246,7 @@ export declare function parseDeleteBundleResponse(data: unknown): {
1594
2246
  };
1595
2247
  export declare function parseContextItem(data: unknown): {
1596
2248
  id: string;
1597
- type: "reference" | "guide" | "document" | "asset";
2249
+ type: string;
1598
2250
  name: string;
1599
2251
  contentType: string;
1600
2252
  content: string | null;
@@ -1607,7 +2259,7 @@ export declare function parseContextItem(data: unknown): {
1607
2259
  export declare function parseContextItemsResponse(data: unknown): {
1608
2260
  items: {
1609
2261
  id: string;
1610
- type: "reference" | "guide" | "document" | "asset";
2262
+ type: string;
1611
2263
  name: string;
1612
2264
  contentType: string;
1613
2265
  content: string | null;
@@ -1620,7 +2272,7 @@ export declare function parseContextItemsResponse(data: unknown): {
1620
2272
  };
1621
2273
  export declare function parsePushContextRequest(data: unknown): {
1622
2274
  name: string;
1623
- contentType: "reference" | "document" | "asset";
2275
+ contentType: "document" | "reference" | "asset";
1624
2276
  content: string;
1625
2277
  itemId?: string | undefined;
1626
2278
  origin?: string | null | undefined;
@@ -1630,7 +2282,7 @@ export declare function parsePushContextRequest(data: unknown): {
1630
2282
  export declare function parsePushContextResponse(data: unknown): {
1631
2283
  item: {
1632
2284
  id: string;
1633
- type: "reference" | "guide" | "document" | "asset";
2285
+ type: string;
1634
2286
  name: string;
1635
2287
  contentType: string;
1636
2288
  content: string | null;
@@ -1652,7 +2304,7 @@ export declare function parseUpdateContextItemRequest(data: unknown): {
1652
2304
  export declare function parseUpdateContextItemResponse(data: unknown): {
1653
2305
  item: {
1654
2306
  id: string;
1655
- type: "reference" | "guide" | "document" | "asset";
2307
+ type: string;
1656
2308
  name: string;
1657
2309
  contentType: string;
1658
2310
  content: string | null;
@@ -1673,7 +2325,7 @@ export declare function parseUpdateContextItemBody(data: unknown): {
1673
2325
  export declare function parseContextItemResponse(data: unknown): {
1674
2326
  item: {
1675
2327
  id: string;
1676
- type: "reference" | "guide" | "document" | "asset";
2328
+ type: string;
1677
2329
  name: string;
1678
2330
  contentType: string;
1679
2331
  content: string | null;
@@ -1688,7 +2340,7 @@ export declare function parseArchiveContextItemResponse(data: unknown): {
1688
2340
  archived: boolean;
1689
2341
  item: {
1690
2342
  id: string;
1691
- type: "reference" | "guide" | "document" | "asset";
2343
+ type: string;
1692
2344
  name: string;
1693
2345
  contentType: string;
1694
2346
  content: string | null;
@@ -1700,7 +2352,7 @@ export declare function parseArchiveContextItemResponse(data: unknown): {
1700
2352
  };
1701
2353
  };
1702
2354
  export declare function parseInboxCaptureRequest(data: unknown): {
1703
- contentType: "document" | "asset";
2355
+ contentType: "document" | "reference" | "asset";
1704
2356
  content: string;
1705
2357
  name?: string | undefined;
1706
2358
  source?: string | undefined;
@@ -1708,7 +2360,7 @@ export declare function parseInboxCaptureRequest(data: unknown): {
1708
2360
  export declare function parseInboxCaptureResponse(data: unknown): {
1709
2361
  item: {
1710
2362
  id: string;
1711
- type: "reference" | "guide" | "document" | "asset";
2363
+ type: string;
1712
2364
  name: string;
1713
2365
  contentType: string;
1714
2366
  content: string | null;
@@ -1721,7 +2373,7 @@ export declare function parseInboxCaptureResponse(data: unknown): {
1721
2373
  export declare function parseInboxListResponse(data: unknown): {
1722
2374
  items: {
1723
2375
  id: string;
1724
- type: "reference" | "guide" | "document" | "asset";
2376
+ type: string;
1725
2377
  name: string;
1726
2378
  contentType: string;
1727
2379
  content: string | null;
@@ -1839,6 +2491,14 @@ export declare function parseDashboardSyncRequest(data: unknown): {
1839
2491
  }[];
1840
2492
  truncated?: boolean | undefined;
1841
2493
  } | undefined;
2494
+ commitAnchor?: {
2495
+ headSha: string;
2496
+ branch: string | null;
2497
+ } | undefined;
2498
+ selfReport?: {
2499
+ sessionId: string;
2500
+ text: string;
2501
+ } | undefined;
1842
2502
  };
1843
2503
  export declare function parseProposalCitation(data: unknown): {
1844
2504
  sessionId: string;
@@ -1918,5 +2578,94 @@ export declare function parseActionEntry(data: unknown): {
1918
2578
  exitCode?: number | undefined;
1919
2579
  } | undefined;
1920
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
+ };
1921
2670
  export {};
1922
2671
  //# sourceMappingURL=schemas.d.ts.map