@mossbear/protocol 0.1.0-alpha.81 → 0.1.0-alpha.82

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
@@ -4244,6 +4244,40 @@ export declare const CreateArtifactRequestSchema: v.StrictObjectSchema<{
4244
4244
  } | undefined;
4245
4245
  gitCommit?: string | undefined;
4246
4246
  }[], 50, undefined>]>, undefined>;
4247
+ /**
4248
+ * Where the artifact sits in the tree of the repo that declared it. Same
4249
+ * schema as the read side's `path`. The route refuses agent guidance,
4250
+ * Mossbear's state directory and git's, and requires `bundle` beside it.
4251
+ */
4252
+ readonly path: v.OptionalSchema<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>;
4253
+ /**
4254
+ * The writer's checkout, as the `project.id` it commits. Declaring it grants
4255
+ * nothing: a home-claiming bundle accepts a create only from its home, and it
4256
+ * is stored as the repo `path` is placed in. Same meaning and parsing as
4257
+ * `UpdateArtifactRequestSchema.projectId`.
4258
+ */
4259
+ readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4260
+ /**
4261
+ * The commit the bytes were read from, when this create is a publication from
4262
+ * a git home. Its presence makes the artifact git-owned. The route requires
4263
+ * `path` and `bundle` beside it.
4264
+ */
4265
+ readonly gitSource: v.OptionalSchema<v.ObjectSchema<{
4266
+ /**
4267
+ * The committed `project.id` of the source repository — the same id space as
4268
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4269
+ * says which repo an item is materialized into and is stamped onto
4270
+ * Mossbear-owned rows too, this one says who may edit it.
4271
+ */
4272
+ readonly projectId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "projectId must contain only letters, digits, underscore, dot or hyphen">]>;
4273
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4274
+ /**
4275
+ * The branch the publishing commit was on. **The one optional member**:
4276
+ * publication is not restricted by branch, so this is recorded so a subscriber
4277
+ * can see what they got, and a detached HEAD has none to record.
4278
+ */
4279
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4280
+ }, undefined>, undefined>;
4247
4281
  }, undefined>;
4248
4282
  /**
4249
4283
  * Update an existing artifact's content. The id is in the route. The version the
@@ -4296,7 +4330,10 @@ export declare const UpdateArtifactRequestSchema: v.StrictObjectSchema<{
4296
4330
  * The commit the new content was read from, for a git-owned artifact. Same
4297
4331
  * shape and meaning as `UpdateContextItemRequestSchema.gitSource`: it advances
4298
4332
  * the artifact's recorded provenance with its content. A git-owned artifact
4299
- * updated without one is refused (409); for any other artifact it is ignored.
4333
+ * updated without one is refused (409). For any other artifact it is a
4334
+ * publication claim: sent beside a path, it makes git the owner from that
4335
+ * revision on, exactly as the bundle-scoped update it replaces did; sent for
4336
+ * an artifact with no path it is refused (400).
4300
4337
  */
4301
4338
  readonly gitSource: v.OptionalSchema<v.ObjectSchema<{
4302
4339
  /**
@@ -4315,6 +4352,40 @@ export declare const UpdateArtifactRequestSchema: v.StrictObjectSchema<{
4315
4352
  readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4316
4353
  }, undefined>, undefined>;
4317
4354
  }, undefined>;
4355
+ /**
4356
+ * Tombstone an artifact: the commit that published it has since deleted the
4357
+ * file. The row and its history are kept, marked removed, and it is no longer
4358
+ * delivered. That is not archive, which takes the artifact out of every bundle.
4359
+ *
4360
+ * `gitSource` is required because a tombstone's whole claim is which revision
4361
+ * removed the file. `expectedVersion` is the optional precondition the caller
4362
+ * last read.
4363
+ */
4364
+ export declare const RemoveArtifactRequestSchema: v.StrictObjectSchema<{
4365
+ readonly gitSource: v.ObjectSchema<{
4366
+ /**
4367
+ * The committed `project.id` of the source repository — the same id space as
4368
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4369
+ * says which repo an item is materialized into and is stamped onto
4370
+ * Mossbear-owned rows too, this one says who may edit it.
4371
+ */
4372
+ readonly projectId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "projectId must contain only letters, digits, underscore, dot or hyphen">]>;
4373
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4374
+ /**
4375
+ * The branch the publishing commit was on. **The one optional member**:
4376
+ * publication is not restricted by branch, so this is recorded so a subscriber
4377
+ * can see what they got, and a detached HEAD has none to record.
4378
+ */
4379
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4380
+ }, undefined>;
4381
+ /**
4382
+ * The writer's checkout, as on update. Required: a git-owned artifact is
4383
+ * read-only outside its source repo, so a removal that does not say which
4384
+ * checkout it comes from is refused by name for every real target.
4385
+ */
4386
+ readonly projectId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
4387
+ readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
4388
+ }, undefined>;
4318
4389
  /** Archive an artifact. The body is optional; `projectId` is the same checkout claim as on update. */
4319
4390
  export declare const ArchiveArtifactRequestSchema: v.StrictObjectSchema<{
4320
4391
  readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
@@ -4831,6 +4902,165 @@ export declare const UpdateArtifactResponseSchema: v.ObjectSchema<{
4831
4902
  readonly updatedAt: v.StringSchema<undefined>;
4832
4903
  }, undefined>;
4833
4904
  }, undefined>;
4905
+ /** The tombstoned artifact, `state: 'removed'`. */
4906
+ export declare const RemoveArtifactResponseSchema: v.ObjectSchema<{
4907
+ readonly artifact: v.ObjectSchema<{
4908
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4909
+ readonly name: v.StringSchema<undefined>;
4910
+ readonly role: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
4911
+ readonly format: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
4912
+ /** Monotonic content version; echo it back as `expectedVersion` to update. */
4913
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4914
+ readonly state: v.PicklistSchema<["live", "archived", "removed"], undefined>;
4915
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4916
+ /** True for a deliberate capture (Inbox). Not derivable from filing state. */
4917
+ readonly capture: v.BooleanSchema<undefined>;
4918
+ /** Null for binary content, which is not served inline. */
4919
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4920
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4921
+ readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
4922
+ readonly path: v.OptionalSchema<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>, undefined>;
4923
+ readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4924
+ readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4925
+ readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4926
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
4927
+ 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">]>;
4928
+ }, undefined>, undefined>, v.MaxLengthAction<{
4929
+ root: "project" | "global";
4930
+ path: string;
4931
+ }[], 8, undefined>]>, undefined>;
4932
+ /** Present iff git owns this artifact. */
4933
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4934
+ /**
4935
+ * The committed `project.id` of the source repository — the same id space as
4936
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4937
+ * says which repo an item is materialized into and is stamped onto
4938
+ * Mossbear-owned rows too, this one says who may edit it.
4939
+ */
4940
+ readonly projectId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "projectId must contain only letters, digits, underscore, dot or hyphen">]>;
4941
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4942
+ /**
4943
+ * The branch the publishing commit was on. **The one optional member**:
4944
+ * publication is not restricted by branch, so this is recorded so a subscriber
4945
+ * can see what they got, and a detached HEAD has none to record.
4946
+ */
4947
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4948
+ }, undefined>, undefined>, undefined>;
4949
+ /** Absent, not empty, when there are none. Absence is not a verdict. */
4950
+ readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4951
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4952
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
4953
+ /** Current source location of an anchored passage, or its lost quote. */
4954
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
4955
+ readonly quote: v.StringSchema<undefined>;
4956
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
4957
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
4958
+ readonly start: v.NumberSchema<undefined>;
4959
+ readonly end: v.NumberSchema<undefined>;
4960
+ }, undefined>, undefined>;
4961
+ }, undefined>, undefined>;
4962
+ /** The comment's text, already wrapped in the response's untrusted markers. */
4963
+ readonly body: v.StringSchema<undefined>;
4964
+ /**
4965
+ * A suggested edit: the replacement for the passage at `passage.lines`,
4966
+ * already wrapped in the response's untrusted markers like `body`. An
4967
+ * insertion is the passage plus its new lines and an empty replacement is a
4968
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
4969
+ */
4970
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4971
+ /**
4972
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
4973
+ * Present only on a Mossbear comment. The comment's `body` begins with the
4974
+ * claim (what goes wrong); this carries what the claim rests on.
4975
+ */
4976
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
4977
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
4978
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
4979
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4980
+ /** What the drafter did not read, fixed per tier. */
4981
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4982
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
4983
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4984
+ }, undefined>, undefined>;
4985
+ /**
4986
+ * Whether the person approved a comment Mossbear drafted. Present on every
4987
+ * Mossbear comment and absent on a person's or an agent's, which are
4988
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
4989
+ * it to the user and acts only on their go-ahead. Only a client that reports
4990
+ * a version able to mark drafts is ever listed one, so an older reader that
4991
+ * strips this field never receives a draft it would print as a request.
4992
+ */
4993
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
4994
+ /** The author's display name as the workspace shows it, or null. Never an email. */
4995
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4996
+ /** ISO timestamp, machine format. */
4997
+ readonly createdAt: v.StringSchema<undefined>;
4998
+ /** The item's content version the comment was written against. */
4999
+ readonly itemVersion: v.NumberSchema<undefined>;
5000
+ /** True when the item's current version is greater than `itemVersion`. */
5001
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
5002
+ /**
5003
+ * How many agent reads were handed this comment **before** this one — so a
5004
+ * comment reaching an agent for the first time reports `0`.
5005
+ *
5006
+ * It is the stored count as it read at the moment the response was built;
5007
+ * the serve this response *is* has not been counted yet. Excluded rather
5008
+ * than included because the count is recorded best-effort: a response that
5009
+ * claimed to include itself would be wrong whenever that record failed, and
5010
+ * a number that is sometimes off by one is worse than one that is
5011
+ * consistently the prior total.
5012
+ *
5013
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
5014
+ * `0` means this read is the first. Neither says a model took it in — only
5015
+ * that the server handed it over.
5016
+ */
5017
+ readonly deliveredCount: v.NumberSchema<undefined>;
5018
+ /**
5019
+ * This comment's thread root — its own id for every delivered root. Resolution
5020
+ * replies remain on the dashboard thread and are not delivered to agents.
5021
+ * It is on the wire from the first response
5022
+ * because the wire contract is consumed by installed CLI versions: reshaping
5023
+ * a flat `comments` array into threads-of-comments later would be a breaking
5024
+ * change, while a field today's readers ignore costs them nothing.
5025
+ */
5026
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5027
+ /**
5028
+ * Always `null` for a delivered root. Present so an older reader meeting a
5029
+ * future response that carries real replies degrades to
5030
+ * "a flat list of comments" rather than failing to parse.
5031
+ */
5032
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
5033
+ }, undefined>, undefined>, v.MaxLengthAction<{
5034
+ id: string;
5035
+ state?: "open" | "resolved" | undefined;
5036
+ passage?: {
5037
+ quote: string;
5038
+ status: "located" | "changed" | "orphaned";
5039
+ lines: {
5040
+ start: number;
5041
+ end: number;
5042
+ } | null;
5043
+ } | undefined;
5044
+ body: string;
5045
+ suggestion?: string | undefined;
5046
+ finding?: {
5047
+ tier: "observed" | "usage" | "practice";
5048
+ tierLine: string;
5049
+ blindSpot: string;
5050
+ prediction: string | null;
5051
+ } | undefined;
5052
+ approved?: boolean | undefined;
5053
+ authorName: string | null;
5054
+ createdAt: string;
5055
+ itemVersion: number;
5056
+ itemChangedSince: boolean;
5057
+ deliveredCount: number;
5058
+ threadId: string;
5059
+ replyToId: string | null;
5060
+ }[], 20, undefined>]>, undefined>;
5061
+ readonly updatedAt: v.StringSchema<undefined>;
5062
+ }, undefined>;
5063
+ }, undefined>;
4834
5064
  /**
4835
5065
  * A saved revision: the shared version summary plus the sources it was derived
4836
5066
  * from, when any were recorded.
@@ -6431,6 +6661,326 @@ export declare const GuideHistoryResponseSchema: v.ObjectSchema<{
6431
6661
  }, undefined>;
6432
6662
  }, undefined>;
6433
6663
  export type GuideHistoryResponse = v.InferOutput<typeof GuideHistoryResponseSchema>;
6664
+ /**
6665
+ * `GET .../feedback` query. `cursor` is the `nextCursor` of the previous page,
6666
+ * opaque to callers; a malformed one is a 400, never a restart from page one.
6667
+ */
6668
+ export declare const ArtifactFeedbackQuerySchema: v.ObjectSchema<{
6669
+ readonly cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "cursor is not a feedback cursor">]>, undefined>;
6670
+ /**
6671
+ * The reader's checkout, as its committed `project.id`. Without it, a Mossbear
6672
+ * correction drafted for one repo is withheld, as on the comments read.
6673
+ */
6674
+ readonly project: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
6675
+ }, undefined>;
6676
+ export type ArtifactFeedbackQuery = v.InferOutput<typeof ArtifactFeedbackQuerySchema>;
6677
+ /**
6678
+ * Why `grading` is null. Closed vocabulary, so a reader branches on `code`
6679
+ * rather than on wording.
6680
+ *
6681
+ * - `not-graded`: this artifact is not a guide, so nothing grades it.
6682
+ * - `not-available-to-credential`: the credential is limited to bundles, and
6683
+ * grading is not offered to those. It is the only reason a limited credential
6684
+ * ever sees, whatever the artifact is, so it says nothing about whether
6685
+ * grading data exists.
6686
+ */
6687
+ export declare const ArtifactGradingUnavailableSchema: v.ObjectSchema<{
6688
+ readonly code: v.PicklistSchema<["not-graded", "not-available-to-credential"], undefined>;
6689
+ readonly reason: v.StringSchema<undefined>;
6690
+ }, undefined>;
6691
+ export type ArtifactGradingUnavailable = v.InferOutput<typeof ArtifactGradingUnavailableSchema>;
6692
+ /**
6693
+ * What people, agents and grading have said about one artifact.
6694
+ *
6695
+ * `grading` is the `guide_history` payload for the same guide and caller, or
6696
+ * null with `gradingUnavailable` saying why. It is never a zeroed record:
6697
+ * absence is not a verdict. Comment evidence is never inlined.
6698
+ */
6699
+ export declare const ArtifactFeedbackResponseSchema: v.ObjectSchema<{
6700
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6701
+ /** The artifact's current version, as `read` reports it. */
6702
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
6703
+ /** Open comments, oldest first by `(createdAt, id)`. */
6704
+ readonly comments: v.ArraySchema<v.ObjectSchema<{
6705
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6706
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
6707
+ /** Current source location of an anchored passage, or its lost quote. */
6708
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
6709
+ readonly quote: v.StringSchema<undefined>;
6710
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
6711
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
6712
+ readonly start: v.NumberSchema<undefined>;
6713
+ readonly end: v.NumberSchema<undefined>;
6714
+ }, undefined>, undefined>;
6715
+ }, undefined>, undefined>;
6716
+ /** The comment's text, already wrapped in the response's untrusted markers. */
6717
+ readonly body: v.StringSchema<undefined>;
6718
+ /**
6719
+ * A suggested edit: the replacement for the passage at `passage.lines`,
6720
+ * already wrapped in the response's untrusted markers like `body`. An
6721
+ * insertion is the passage plus its new lines and an empty replacement is a
6722
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
6723
+ */
6724
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6725
+ /**
6726
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
6727
+ * Present only on a Mossbear comment. The comment's `body` begins with the
6728
+ * claim (what goes wrong); this carries what the claim rests on.
6729
+ */
6730
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
6731
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
6732
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
6733
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
6734
+ /** What the drafter did not read, fixed per tier. */
6735
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
6736
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
6737
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6738
+ }, undefined>, undefined>;
6739
+ /**
6740
+ * Whether the person approved a comment Mossbear drafted. Present on every
6741
+ * Mossbear comment and absent on a person's or an agent's, which are
6742
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
6743
+ * it to the user and acts only on their go-ahead. Only a client that reports
6744
+ * a version able to mark drafts is ever listed one, so an older reader that
6745
+ * strips this field never receives a draft it would print as a request.
6746
+ */
6747
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
6748
+ /** The author's display name as the workspace shows it, or null. Never an email. */
6749
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6750
+ /** ISO timestamp, machine format. */
6751
+ readonly createdAt: v.StringSchema<undefined>;
6752
+ /** The item's content version the comment was written against. */
6753
+ readonly itemVersion: v.NumberSchema<undefined>;
6754
+ /** True when the item's current version is greater than `itemVersion`. */
6755
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
6756
+ /**
6757
+ * How many agent reads were handed this comment **before** this one — so a
6758
+ * comment reaching an agent for the first time reports `0`.
6759
+ *
6760
+ * It is the stored count as it read at the moment the response was built;
6761
+ * the serve this response *is* has not been counted yet. Excluded rather
6762
+ * than included because the count is recorded best-effort: a response that
6763
+ * claimed to include itself would be wrong whenever that record failed, and
6764
+ * a number that is sometimes off by one is worse than one that is
6765
+ * consistently the prior total.
6766
+ *
6767
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
6768
+ * `0` means this read is the first. Neither says a model took it in — only
6769
+ * that the server handed it over.
6770
+ */
6771
+ readonly deliveredCount: v.NumberSchema<undefined>;
6772
+ /**
6773
+ * This comment's thread root — its own id for every delivered root. Resolution
6774
+ * replies remain on the dashboard thread and are not delivered to agents.
6775
+ * It is on the wire from the first response
6776
+ * because the wire contract is consumed by installed CLI versions: reshaping
6777
+ * a flat `comments` array into threads-of-comments later would be a breaking
6778
+ * change, while a field today's readers ignore costs them nothing.
6779
+ */
6780
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6781
+ /**
6782
+ * Always `null` for a delivered root. Present so an older reader meeting a
6783
+ * future response that carries real replies degrades to
6784
+ * "a flat list of comments" rather than failing to parse.
6785
+ */
6786
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
6787
+ }, undefined>, undefined>;
6788
+ /** Absent on the last page; pass it back as `cursor` for the next. */
6789
+ readonly nextCursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6790
+ /** The markers every comment `body` is wrapped in; present when any comment came back. */
6791
+ readonly untrusted: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
6792
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6793
+ readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6794
+ readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6795
+ readonly note: v.StringSchema<undefined>;
6796
+ }, undefined>, undefined>, undefined>;
6797
+ readonly grading: v.NullableSchema<v.ObjectSchema<{
6798
+ readonly guide: v.ObjectSchema<{
6799
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6800
+ readonly title: v.StringSchema<undefined>;
6801
+ 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>;
6802
+ readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
6803
+ }, undefined>;
6804
+ /** The wording the window is about, or null when the guide has no revision identity. */
6805
+ readonly currentRevision: v.NullableSchema<v.ObjectSchema<{
6806
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6807
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6808
+ }, undefined>, undefined>;
6809
+ readonly state: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
6810
+ readonly window: v.ObjectSchema<{
6811
+ /** Rows summarized, after the revision narrow. */
6812
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6813
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6814
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6815
+ /** In context, never engaged. Neither a pass nor a failure. */
6816
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6817
+ /** `aligned + misaligned` — the rate's own denominator. */
6818
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6819
+ /** `aligned / applicable`, or **null when no run engaged the guide**. */
6820
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
6821
+ /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
6822
+ readonly isWindowed: v.BooleanSchema<undefined>;
6823
+ /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
6824
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6825
+ /**
6826
+ * Verdicts fetched and then dropped by the revision narrow — about wording
6827
+ * that is no longer current, or citing no revision at all. A **floor** rather
6828
+ * than a total whenever `isWindowed`, because rows past the cap were never
6829
+ * fetched.
6830
+ */
6831
+ readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6832
+ /**
6833
+ * `applicable` is too small for the percentage to mean anything — threshold
6834
+ * `applicable < 3` (founder, 2026-08-22). Read the counts, not the rate.
6835
+ */
6836
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
6837
+ }, undefined>;
6838
+ /**
6839
+ * The last edit's two windows, or **null when there is no earlier wording to
6840
+ * compare against**.
6841
+ *
6842
+ * Present-and-null rather than omitted: a guide on its first revision has no
6843
+ * delta, and that is an answer. An absent key would leave a reader unable to
6844
+ * tell "no edit to measure" from "this server does not report deltas".
6845
+ */
6846
+ readonly change: v.NullableSchema<v.ObjectSchema<{
6847
+ /** The revision that preceded the change. */
6848
+ readonly before: v.ObjectSchema<{
6849
+ /** The wording this side judges. */
6850
+ readonly revision: v.ObjectSchema<{
6851
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6852
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6853
+ }, undefined>;
6854
+ /** Rows in this side's window, including the runs that never engaged it. */
6855
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6856
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6857
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6858
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6859
+ /** `aligned + misaligned` — this side's own denominator. */
6860
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6861
+ /** `aligned / applicable`, or null when no run engaged this wording. */
6862
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
6863
+ /** This side is below the sample floor, so read its counts and not its rate. */
6864
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
6865
+ /**
6866
+ * This side is a bounded sample of its revision rather than the whole record.
6867
+ * A saturated side beside an unsaturated one is two different kinds of
6868
+ * number, and comparing them without saying so is the defect the flag exists
6869
+ * to stop.
6870
+ */
6871
+ readonly isSaturated: v.BooleanSchema<undefined>;
6872
+ /** The span this side covers, ISO. Both null on a side with no rows. */
6873
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6874
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6875
+ }, undefined>;
6876
+ /** The wording the guide stands at now. */
6877
+ readonly since: v.ObjectSchema<{
6878
+ /** The wording this side judges. */
6879
+ readonly revision: v.ObjectSchema<{
6880
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6881
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6882
+ }, undefined>;
6883
+ /** Rows in this side's window, including the runs that never engaged it. */
6884
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6885
+ readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6886
+ readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6887
+ readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6888
+ /** `aligned + misaligned` — this side's own denominator. */
6889
+ readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6890
+ /** `aligned / applicable`, or null when no run engaged this wording. */
6891
+ readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
6892
+ /** This side is below the sample floor, so read its counts and not its rate. */
6893
+ readonly isLowConfidence: v.BooleanSchema<undefined>;
6894
+ /**
6895
+ * This side is a bounded sample of its revision rather than the whole record.
6896
+ * A saturated side beside an unsaturated one is two different kinds of
6897
+ * number, and comparing them without saying so is the defect the flag exists
6898
+ * to stop.
6899
+ */
6900
+ readonly isSaturated: v.BooleanSchema<undefined>;
6901
+ /** The span this side covers, ISO. Both null on a side with no rows. */
6902
+ readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6903
+ readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6904
+ }, undefined>;
6905
+ /**
6906
+ * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
6907
+ * suppressed** or either side never engaged the guide. Null is not zero: one
6908
+ * says the evidence does not support a number, the other would be a claim.
6909
+ */
6910
+ readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
6911
+ /**
6912
+ * Which side is below the sample floor, or null when neither is and the delta
6913
+ * stands. `'since'` is the ordinary post-edit state — *not enough runs since
6914
+ * this change* — and is reported rather than omitted.
6915
+ */
6916
+ readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
6917
+ /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
6918
+ readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
6919
+ /** Either side is a bounded sample, so neither is a lifetime total. */
6920
+ readonly isWindowed: v.BooleanSchema<undefined>;
6921
+ /** The per-revision cap each side was bounded by, so "sample" has a size. */
6922
+ readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6923
+ /**
6924
+ * When the current wording was recorded, ISO — the boundary between the two
6925
+ * windows, and null when no version row carries it.
6926
+ *
6927
+ * A date, never an attribution: it says when the window opened, not that the
6928
+ * edit caused what happened inside it.
6929
+ */
6930
+ readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6931
+ }, undefined>, undefined>;
6932
+ readonly findings: v.ArraySchema<v.ObjectSchema<{
6933
+ readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6934
+ readonly occurredAt: v.StringSchema<undefined>;
6935
+ readonly revision: v.NullableSchema<v.ObjectSchema<{
6936
+ readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6937
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6938
+ }, undefined>, undefined>;
6939
+ readonly isCurrentRevision: v.BooleanSchema<undefined>;
6940
+ readonly reasoning: v.StringSchema<undefined>;
6941
+ }, undefined>, undefined>;
6942
+ /**
6943
+ * Misaligned rows in the window beyond the `MAX_GUIDE_HISTORY_FINDINGS`
6944
+ * returned. Reported rather than silently truncated: a caller reading five
6945
+ * findings has no other way to know it is reading five of forty.
6946
+ */
6947
+ readonly findingsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6948
+ /**
6949
+ * The caller's newest stored failure-pattern analysis of this guide, or
6950
+ * **null when they have never asked for one**. Optional because a server
6951
+ * that predates it sends no key; a reader must not take absence for "never
6952
+ * analysed".
6953
+ */
6954
+ readonly analysis: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
6955
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6956
+ /** When it was written, ISO. */
6957
+ readonly createdAt: v.StringSchema<undefined>;
6958
+ readonly outcome: v.PicklistSchema<["pattern", "no_pattern"], undefined>;
6959
+ readonly summary: v.StringSchema<undefined>;
6960
+ /** Failed sessions the analysis read. */
6961
+ readonly sessionsAnalysed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6962
+ /** Failed sessions it left out to stay within its prompt's cap. */
6963
+ readonly sessionsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
6964
+ readonly stale: v.BooleanSchema<undefined>;
6965
+ /** Why it is out of date, or null while it is current. */
6966
+ readonly staleReason: v.NullableSchema<v.PicklistSchema<["revision_changed", "new_failures"], undefined>, undefined>;
6967
+ /** Failures it has not read, when `staleReason` is `new_failures`; else null. */
6968
+ readonly newFailures: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
6969
+ }, undefined>, undefined>, undefined>;
6970
+ readonly untrusted: v.ObjectSchema<{
6971
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6972
+ readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6973
+ readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6974
+ readonly note: v.StringSchema<undefined>;
6975
+ }, undefined>;
6976
+ }, undefined>, undefined>;
6977
+ /** Present exactly when `grading` is null. */
6978
+ readonly gradingUnavailable: v.OptionalSchema<v.ObjectSchema<{
6979
+ readonly code: v.PicklistSchema<["not-graded", "not-available-to-credential"], undefined>;
6980
+ readonly reason: v.StringSchema<undefined>;
6981
+ }, undefined>, undefined>;
6982
+ }, undefined>;
6983
+ export type ArtifactFeedbackResponse = v.InferOutput<typeof ArtifactFeedbackResponseSchema>;
6434
6984
  export declare const SessionGradeRequestSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
6435
6985
  readonly session: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>, v.CheckAction<string, "identifier must not contain control characters">]>, undefined>;
6436
6986
  readonly agent_session: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>, v.CheckAction<string, "identifier must not contain control characters">]>, undefined>;