Documentation
¶
Index ¶
- Constants
- Variables
- func AnnotationPushRequestSchemaJSON() []byte
- func BuildAuthoritativePublicationProjections(detail SessionDetailPayload, metadata UnifiedMetadata, schemaVersion int, ...) (AuthoritativeSessionIdentity, AuthoritativeSessionStats, ...)
- func CollectiveFetchHTTPStatus(report CollectiveFetchReport) int
- func ComputeAnnotationHash(annotationTypeID string, annotatorID string, value string, sessionID *string, ...) string
- func ComputeManifestDigest(hashes []string) string
- func ComputeMetadataHash(meta *UnifiedMetadata) string
- func ComputeTranscriptHash(transcriptBytes []byte) string
- func ConstructSessionGraphRef(i SessionGraphRefInput) (string, error)
- func DecodeNativeMetadataDataRaw(raw []byte) (json.RawMessage, error)
- func HarnessDisplayName(h Harness) string
- func HarnessJSONSchema() jsonschema.Schema
- func IsClaudeBuiltinCommand(name string) bool
- func IsConversationTurn(role Role, entryType EntryType, depth int) bool
- func LicenseMenu() string
- func MarshalPositionedSegment(seg PositionedSegment) ([]byte, error)
- func NewJSONSchemaCompiler() *jsonschema.Compiler
- func PublishRequestSchemaJSON() []byte
- func ReconcileVillageContributionAttempt(saved *LocalRemoteContributionAttempt, incoming LocalRemoteContributionAttempt) (LocalRemoteContributionAttempt, VillageContributionAttemptReconciliation, ...)
- func RemoteLabel(remote string) (label string, ok bool)
- func RunPublishVerdicts(t *testing.T, validate func([]byte) error)
- func ScanRawJSONDocument(raw []byte, p RawJSONPathPolicy) error
- func SegmentedReadGenerations() []int
- func SegmentedReadMinSpecJSON() []byte
- func SegmentedReadProtocolVersion(generation int) (string, bool)
- func SegmentedReadSpecJSON() []byte
- func TranscriptContentStrict(detail json.RawMessage) bool
- func TranscriptHeaderETag(in HeaderETagInputs) string
- func TranscriptJSONStringByteLength(s string) int
- func TranscriptRepresentation(in TranscriptRepresentationInputs) string
- func TranscriptTurnByteLength(turn TurnDetail) int
- func TranscriptUpdateVisibilityMenu() string
- func ValidateAnnotationPushRequest(data []byte) error
- func ValidateAnnotationValue(domain ValueDomain, value string) error
- func ValidateAttachmentRef(ref string) error
- func ValidateClaudeCodeCompactionDetails(v ClaudeCodeCompactionDetails) error
- func ValidateContentCapabilityAdvertisements(advertised []ContentCapability) error
- func ValidateContributionHistoryQuery(q LocalContributionHistoryQuery, current ContributionTraversalRevision) int
- func ValidateConversationTurnCount(value *int64, path string) error
- func ValidateDescribedValue(domain ValueDomain, value string) error
- func ValidateImagePart(mode ImagePartMode, part ImagePart) error
- func ValidateInputSubmissionCount(value *int64, path string) error
- func ValidateNativeMetadata(v SessionDetailPayload) error
- func ValidateNativeMetadataRecords(records []NativeMetadataRecord, targets []TurnDetail) error
- func ValidateObservedModelEvidence(role Role, observed ObservedModelID) error
- func ValidatePositionedSegmentBoundaries(seg PositionedSegment, ref PositionedSegmentRef) error
- func ValidatePositionedWindowCoverage(window PositionedWindow, refs []PositionedSegmentRef) error
- func ValidatePublicRefJSONSchemaFormat(value any) bool
- func ValidatePublicationRequest(r AuthoritativePublishRequest) error
- func ValidatePublishRequest(data []byte) error
- func ValidatePublishedSessionDetailPayload(value SessionDetailPayload) error
- func ValidateRetainedUnknown(value SessionDetailPayload) error
- func ValidateScaleDomainCombo(scale ScaleKind, domain ValueDomainKind) error
- func ValidateSessionDetailPayload(value SessionDetailPayload) error
- func ValidateSessionRelationships(rs []SessionRelationship) error
- func ValidateThinkingLevelEvidence(role Role, level ThinkingLevel, raw ThinkingLevelRaw) error
- func ValidateThinkingLevelRawJSONSchemaFormat(value any) bool
- func ValidateTranscriptContent(v TranscriptContent) error
- func ValidateTranscriptSegmentBoundaries(segment TranscriptSegment, totalSegments int) error
- func ValidateTranscriptWindowCoverage(window TranscriptWindow, refs []TranscriptSegmentRef) error
- func ValidateTurnContentPart(mode ImagePartMode, part TurnContentPart) error
- func ValidateUsageDetail(v UsageDetail) error
- func VillageAPISpecJSON() []byte
- func VillageWithheldRepositoryFields() map[string][]string
- type ActivityEdge
- type ActorOrigin
- type AnalyticsSessionStats
- type AnnotationAxis
- type AnnotationDatatype
- type AnnotationEntryTarget
- type AnnotationFixtureSummary
- type AnnotationFixtures
- type AnnotationManifestResponse
- type AnnotationPushItem
- type AnnotationPushRequest
- type AnnotationPushResponse
- type AnnotationPushResult
- type AnnotationPushStatus
- type AnnotationRegistry
- type AnnotationStatus
- type AnnotationSummary
- type AnnotationTypeReader
- type AnnotationTypeSummary
- type AnnotationsPayload
- type AnnotatorKind
- type AnnotatorSummary
- type AssociationConclusion
- type AssociationEvidenceKind
- type AssociationEvidenceObservation
- type AssociationID
- type AttachmentRouteFixtures
- type AttachmentRouteOperationFixture
- type AttachmentRouteOutcome
- type AttachmentRouteRefExpected
- type AttachmentRouteRefInput
- type AttachmentRouteResponse
- type AttachmentRouteResponseExpected
- type AttachmentRouteResponseInput
- type AuthoritativeClientInfo
- type AuthoritativeCommitInfo
- type AuthoritativeDiagnosticEntry
- type AuthoritativeDiagnosticsInfo
- type AuthoritativeGitContext
- type AuthoritativeModelInfo
- type AuthoritativeProjectContext
- type AuthoritativePublishRequest
- type AuthoritativePublishResponse
- type AuthoritativeQualityMetrics
- type AuthoritativeSessionEntry
- type AuthoritativeSessionIdentity
- type AuthoritativeSessionStats
- type AuthoritativeSourceInfo
- type AuthoritativeSubagentRef
- type AuthoritativeTimestampInfo
- type AutoPublishEvent
- type AutoPublishHook
- type AutoPublishHookRemedy
- type AutoPublishHookStatus
- type AutoPublishInstallRequest
- type AutoPublishRemovalResponse
- type AutoPublishRepository
- type AutoPublishRule
- type AutoPublishRuleKind
- type AutoPublishRuleRequest
- type BatchCreateAnnotationsErrorResponse
- type BatchCreateAnnotationsRequest
- type BatchCreateAnnotationsResponse
- type BuiltinCommand
- type CLILoginQuery
- type CanonicalPublishGitContext
- type CanonicalPublishOperation
- type CanonicalPublishReplacement
- type ChangeBinding
- type ChangeDetailPayload
- type ChangeDiffPayload
- type ChangeSession
- type ChangeSummary
- type ChannelSubscription
- type ChannelTopic
- type ChildSessionPage
- type ChildSessionRef
- type ChildSessionSummary
- type ClaudeCodeCompactionDetails
- type ClaudeCodeCompactionTrigger
- type ClientMessage
- type CollectiveEvidenceCoverage
- type CollectiveFetchAssociationResults
- type CollectiveFetchAssociationScopeResult
- type CollectiveFetchCommit
- type CollectiveFetchDomain
- type CollectiveFetchDomainResult
- type CollectiveFetchDomainSummary
- type CollectiveFetchOutcome
- type CollectiveFetchReport
- type CollectiveFetchSourceResult
- type CollectiveFetchState
- type CollectiveFetchSummary
- type CollectiveObservation
- type CollectiveObservationReason
- type CollectiveObservationResponse
- type CollectiveObservationScope
- type CollectiveObservationSource
- type CollectiveObservationState
- type CollectiveOperation
- type CollectiveSourceOutcome
- type CommandInvocation
- type CommitInfo
- type CommitRef
- type Confidence
- type ContentCapability
- type ContentCapabilityAdvertisementInput
- type ContentCapabilityDetailInput
- type ContentCapabilityExpected
- type ContentCapabilityFixtureNames
- type ContentCapabilityProducerInput
- type ContentCapabilitySessionGraphFixtures
- type ContentKind
- type ContentOrigin
- type ContentOwnership
- type ContentPartDetailFixtureExpected
- type ContentPartDetailFixtureInput
- type ContentPartDetailFixtures
- type ContentPartFixtureExpected
- type ContentPartFixtureInput
- type ContentPartsFixtures
- type ContentProvenance
- type ContractVersion
- type ContributionTraversalIdentity
- type ContributionTraversalRevision
- type ContributorBreakdown
- type ConversationTurnSpan
- type CookedTurn
- type CreateAnnotationRequest
- type CreateAnnotationResponse
- type DashboardPayload
- type DayStats
- type DecayLevel
- type DeliveryOrigin
- type DiagnosticEntry
- type DiagnosticsInfo
- type DiffHunk
- type DiffLine
- type DiffLineKind
- type DigestItemKind
- type DurableGraphFixtures
- type DurableMirrorInput
- type EarlierHistorySection
- type EarlierHistoryState
- type EdgeViolation
- type EdgeViolationKind
- type EntryType
- type EvidenceKind
- type ExchangeCodeRequest
- type ExchangeCodeResponse
- type FamiliarityPayload
- type FileChange
- type FileChangeStatus
- type FileFamiliarity
- type FrictionCluster
- type GitContext
- type Harness
- type HeaderETagInputs
- type HealthResponse
- type HelperContextSummary
- type HelperGroupSummary
- type HostSlug
- type IDCasing
- type ImageMediaType
- type ImagePart
- type ImagePartMode
- type InputModality
- type InsightClassification
- type InsightEvidence
- type InsightKind
- type InsightProvenance
- type InteractionType
- type InterpretationDiagnostics
- type InvalidRefCategory
- type InvalidRefSubcase
- type LegacyPullAnnotation
- type LegacyPullListResponse
- type LegacyPullTranscriptInfo
- type License
- type LocalAnnotationRow
- type LocalArtifactIdentity
- type LocalArtifactIdentityKind
- type LocalClaimEntry
- type LocalClaimSource
- type LocalCollectiveSuggestion
- type LocalCollectiveSuggestionReason
- type LocalConfirmedContributionOutcome
- type LocalConfirmedContributionReceipt
- type LocalContributionEvidenceKind
- type LocalContributionHistoryQuery
- type LocalContributionHistoryResponse
- type LocalContributionTraversalConflict
- type LocalHelperMembersPayload
- type LocalKickstartAnswers
- type LocalKickstartCloseReason
- type LocalKickstartCommitRefusal
- type LocalKickstartCommitted
- type LocalKickstartConflict
- type LocalKickstartConnect
- type LocalKickstartConnectAnswer
- type LocalKickstartDiff
- type LocalKickstartDiffLine
- type LocalKickstartDiffLineType
- type LocalKickstartErrorCode
- type LocalKickstartErrorResponse
- type LocalKickstartEvent
- type LocalKickstartEventKind
- type LocalKickstartField
- type LocalKickstartFieldKind
- type LocalKickstartGuide
- type LocalKickstartHunk
- type LocalKickstartIngest
- type LocalKickstartIngestState
- type LocalKickstartLine
- type LocalKickstartLineKind
- type LocalKickstartNextStep
- type LocalKickstartNode
- type LocalKickstartNodeKind
- type LocalKickstartNodeState
- type LocalKickstartOpenRequest
- type LocalKickstartOption
- type LocalKickstartOverwrite
- type LocalKickstartPatchResult
- type LocalKickstartPreview
- type LocalKickstartPreviewCloseReason
- type LocalKickstartPreviewContinuation
- type LocalKickstartPreviewCutReason
- type LocalKickstartPreviewDirectory
- type LocalKickstartPreviewEvent
- type LocalKickstartPreviewEventKind
- type LocalKickstartPreviewOp
- type LocalKickstartPreviewRequest
- type LocalKickstartPreviewSegment
- type LocalKickstartPreviewState
- type LocalKickstartResolution
- type LocalKickstartScan
- type LocalKickstartScanState
- type LocalKickstartScope
- type LocalKickstartSession
- type LocalKickstartStatus
- type LocalKickstartStop
- type LocalKickstartStopKind
- type LocalKickstartSummary
- type LocalKickstartTree
- type LocalKickstartVillage
- type LocalOperationDiagnostic
- type LocalOperationDiagnosticOutcome
- type LocalOwner
- type LocalOwnerClaimPrompt
- type LocalOwnerClaimRequest
- type LocalOwnerClaimResult
- type LocalOwnerOwnership
- type LocalOwnerOwnershipCounts
- type LocalOwnerPromptState
- type LocalOwnerStatus
- type LocalPublication
- type LocalPublicationAttemptFailure
- type LocalPublicationAudienceMember
- type LocalPublicationState
- type LocalPublicationsResponse
- type LocalRemoteContributionAttempt
- type LocalSessionListItem
- type LocalSessionListPayload
- type LocalSessionPage
- type LocalSessionRow
- type LocalSetting
- type LocalSettingKind
- type LocalSettingRefusal
- type LocalSettingUpdateRequest
- type LocalSettingValue
- func (v LocalSettingValue) IsUnset() bool
- func (LocalSettingValue) JSONSchema() (jsonschema.Schema, error)
- func (v LocalSettingValue) MarshalJSON() ([]byte, error)
- func (v *LocalSettingValue) UnmarshalJSON(data []byte) error
- func (v LocalSettingValue) ValidateFor(kind LocalSettingKind, options []string) error
- type LocalSettingsResponse
- type LocalSyncProjectOption
- type LocalSyncProjectOptions
- type LocalSyncPublicationFilter
- type LocalSyncSessionPage
- type LocalSyncSessionRow
- type LocalSyncSessionTotals
- type LocalSyncSessionsPayload
- type LocalSyncSessionsQuery
- type LocalSyncSummary
- type LocalVillageCollective
- type LocalVillageCollectivesResponse
- type LongestStreak
- type MapEdge
- type MapGraphPayload
- type MapNode
- type MapNodeDetailPayload
- type MapNodeKind
- type MapSlice
- type MedianP90
- type MessageType
- type MockConfigResponse
- type ModelID
- type ModelInfo
- type NativeAttachmentRef
- type NativeLimitInput
- type NativeMetadataKind
- type NativeMetadataRecord
- type NativeMetadataSourceType
- type NativePiMessageRole
- type NativeSourceRef
- type NegativeLookalike
- type ObservedModelID
- type OffsetPage
- type OmittedReason
- type OperationIssue
- type OperationIssueCode
- type OutcomeDistribution
- type OwnerTranscriptUpdateRequest
- type OwnerTranscriptUpdateResponse
- type OwnerUpdateEncodingInput
- type OwnerUpdateFixtures
- type OwnerUpdateLicenseIntent
- func (v OwnerUpdateLicenseIntent) IsSet() bool
- func (OwnerUpdateLicenseIntent) JSONSchema() (jsonschema.Schema, error)
- func (v OwnerUpdateLicenseIntent) MarshalJSON() ([]byte, error)
- func (v *OwnerUpdateLicenseIntent) UnmarshalJSON(data []byte) error
- func (v OwnerUpdateLicenseIntent) Value() (License, bool)
- type OwnerUpdateRequestBehaviour
- type OwnerUpdateSpecExpectation
- type OwnerUpdateSpecProbe
- type OwnerUpdateSpecProbeKind
- type OwnerUpdateValidationExpectation
- type PageSize
- type PersonalMedians
- type PositionedDirectory
- type PositionedSegment
- type PositionedSegmentRef
- type PositionedWindow
- type PositionedWindowInput
- type PositionedWindowTurn
- type ProjectAnalytics
- type ProjectContext
- type ProjectHash
- type ProjectResolutionPayload
- type ProjectSummariesPayload
- type ProjectSummary
- type ProjectTasksPayload
- type PromptDigest
- type PromptDigestHeader
- type PromptDigestItem
- type PromptDigestSkill
- type Provenance
- type PublicRevisionRef
- type PublicSourceAnchor
- type PublicSourceAnchorKind
- type PublishAppliedState
- type PublishAssociationOperation
- type PublishLicenseOperation
- type PublishNormalizedValues
- type PublishOperationKind
- type PublishRequest
- type PublishRequestFingerprint
- type PublishResponse
- type PublishVerdictCase
- type PublishVerdictExpectation
- type PublishVerdictFixtures
- type PublishedAssociation
- type PullAnnotation
- type PullAssociationMetadataResult
- type PullAssociationMetadataState
- type PullListResponse
- type PullRefFixtures
- type PullRefValues
- type PullSkipGateItem
- type PullSkipGateRequest
- type PullSkipGateResponse
- type PullSkipGateResult
- type PullStatusFixtures
- type PullStatusMapping
- type PullTranscriptInfo
- type PushContractVersion
- type QualityFixtureName
- type QualityFixtureSet
- type QualityFixtureSetName
- type QualityFixtures
- func (f *QualityFixtures) QualitySessions() []QualitySession
- func (f *QualityFixtures) QualitySessionsForSet(name QualityFixtureSetName) ([]QualitySession, error)
- func (f *QualityFixtures) SessionByName(name QualityFixtureName) (QualitySessionFixture, bool)
- func (f *QualityFixtures) SetByName(name QualityFixtureSetName) (QualityFixtureSet, bool)
- type QualityMedianCase
- type QualityMedianSession
- type QualityMetricVariation
- type QualityMetricVariations
- type QualityMetrics
- type QualityPage
- type QualityPayload
- type QualityRatioVariation
- type QualitySession
- type QualitySessionFixture
- type QualityStringVariation
- type QualityVariations
- type RawJSONPathPolicy
- type ReadAttributionState
- type ReadStateGrade
- type RecordedCostAmount
- type RecordedCostDetail
- type RedactionExample
- type RedactionFixtureLevel
- type RedactionInfo
- type RefCase
- type RefForm
- type RelationshipNavigationStatus
- type RelationshipTargetState
- type RetainedUnknownRecord
- type ReturningContributorRate
- type ReviewListPayload
- type ReviewSuggestion
- type RewriteMethod
- type RewriteResolution
- type RewrittenCommit
- type Role
- type ScaleKind
- type SchemaVersionResponse
- type ScryCheckRequest
- type ScryCheckResponse
- type ScryHealthResponse
- type ScryTranscriptRecord
- type ScryVerdict
- type SearchPayload
- type SearchResult
- type ServerMessage
- type SessionAssociation
- type SessionCommitsResponse
- type SessionDetailHeader
- type SessionDetailHeaderPayload
- type SessionDetailPayload
- type SessionDetailReadPayload
- type SessionEntry
- type SessionGraphEnumInput
- type SessionGraphFixtureCorpus
- type SessionGraphFixtureExpected
- type SessionGraphRawExpected
- type SessionGraphRawInput
- type SessionGraphRefExpected
- type SessionGraphRefInput
- type SessionID
- type SessionIdentity
- type SessionInsight
- type SessionListItemKind
- type SessionOrigin
- type SessionOriginBehaviour
- type SessionOriginFixtures
- type SessionOriginPayloadKind
- type SessionOriginRoundTripExpectation
- type SessionOriginRoundTripInput
- type SessionOriginSchemaExpectation
- type SessionOriginSchemaProbe
- type SessionOriginValidityExpectation
- type SessionOutcome
- type SessionPullRequest
- type SessionPullRequestsResponse
- type SessionPurpose
- type SessionRelationship
- type SessionRelationshipKind
- type SessionRelationshipNavigation
- type SessionRelationshipsInput
- type SessionScorecard
- type SessionStats
- type SessionSummariesByIDAnchor
- type SessionSummariesByIDContract
- type SessionSummariesByIDDescriptionAnchor
- type SessionSummary
- type SessionTeammate
- type SessionTeammateBoundsExpectation
- type SessionTeammateBoundsFixtures
- type SessionTeammateBoundsInput
- type SessionTeammateEvidence
- type SessionTeammateFixtures
- type SessionTeammateIdentityProbe
- type SessionTeammateSchemaExpectation
- type SessionTeammateSchemaProbe
- type SessionToCommitRate
- type SessionsPayload
- type ShutdownResponse
- type SourceEntryRef
- type SourceFormat
- type SourceInfo
- type StopReason
- type SubagentRef
- type SubmissionRef
- type SubscriptionValidationCase
- type SyncAuthResponse
- type SyncHoldReason
- type SyncLoginResponse
- type SyncLoginStatus
- type SyncLogoutResponse
- type SyncLogoutStatus
- type SyncPushCollectives
- type SyncPushRequest
- type SyncPushResponse
- type SyncPushSessionResult
- type SyncPushSessionStatus
- type SyncPushStep
- type SyncPushStepOutcome
- type SyncPushStepResult
- type SyncRedactionCategoryGroup
- type SyncRedactionItem
- type SyncRedactionRuleGroup
- type SyncRedactionsResponse
- type SyncStatus
- type TargetKind
- type TaskSummary
- type TaxonomyFamilyNode
- type TaxonomyNode
- type ThinkingLevel
- type ThinkingLevelChange
- type ThinkingLevelRaw
- type TimelineFixtureCase
- type TimelineFixtureCorpus
- type TimelineFixtureExpected
- type TimelineFixtureInput
- type TimelineSessionRef
- type TimestampInfo
- type TokenUsageDetail
- type ToolCallDetail
- type ToolCallKind
- type TranscriptCaptureError
- type TranscriptCaptureRefusal
- type TranscriptContent
- type TranscriptContentHash
- type TranscriptContentHashWord
- type TranscriptContentHeader
- type TranscriptContentReadPolicy
- type TranscriptCookTurn
- type TranscriptCookTurnFacts
- type TranscriptDownloadKind
- type TranscriptDownloadRead
- type TranscriptEntryHit
- type TranscriptEntryLocateRequest
- type TranscriptEntryMatch
- type TranscriptEntryReferenceKind
- type TranscriptEntryScanRow
- type TranscriptFlaggedTurn
- type TranscriptHistorySection
- type TranscriptID
- type TranscriptNativePresence
- type TranscriptPageOutline
- type TranscriptReadContext
- type TranscriptReadTransport
- type TranscriptReadTransportKind
- type TranscriptReadValidation
- type TranscriptRecordedIndexState
- type TranscriptRepresentationInputs
- type TranscriptRetainedOwnerVisibility
- type TranscriptRetainedState
- type TranscriptSegment
- type TranscriptSegmentDirectory
- type TranscriptSegmentPartition
- type TranscriptSegmentPartitionKind
- type TranscriptSegmentRef
- type TranscriptSegmentRow
- type TranscriptServedTurn
- type TranscriptSessionHeader
- type TranscriptTurn
- type TranscriptUpdateLicense
- type TranscriptUpdateRequest
- type TranscriptUpdateVisibility
- type TranscriptUsagePresence
- type TranscriptViewerProjection
- type TranscriptWindow
- type TranscriptWindowTurn
- type TrendsPayload
- type TurnContentPart
- type TurnDetail
- type TurnOutlineRow
- type TurnOutlineSubagentStub
- type TurnPartType
- type TypeDefinition
- type TypeDependency
- type TypeFilter
- type TypeOrigin
- type UICapabilitiesResponse
- type UnifiedMetadata
- type UnusualSignal
- type UnverifiedPullRequest
- type UnverifiedPullRequestSource
- type UsageCompleteness
- type UsageDetail
- type UsageOwnerID
- type UsageScope
- type ValidGenExpectation
- type ValidGeneration
- type ValueDomain
- type ValueDomainKind
- type VillageAPIKey
- type VillageAssignableCollectiveRole
- type VillageAssignableGroupRoledeprecated
- type VillageAttestationType
- type VillageAvailableRepositoriesResponse
- type VillageAvailableRepository
- type VillageBatchReviewRequest
- type VillageBatchReviewResponse
- type VillageBatchShareEntry
- type VillageBatchShareRequest
- type VillageBatchShareResponse
- type VillageBatchShareSelectionRequest
- type VillageCollective
- type VillageCollectiveAcceptanceMode
- type VillageCollectiveContributor
- type VillageCollectiveDataAccess
- type VillageCollectiveDetailRecord
- type VillageCollectiveDetailResponse
- type VillageCollectiveInvitation
- type VillageCollectiveInvitationRequest
- type VillageCollectiveInvitationSent
- type VillageCollectiveInvitationsSentResponse
- type VillageCollectiveMember
- type VillageCollectiveMemberRoleRequest
- type VillageCollectiveMemberUsernameRequestdeprecated
- type VillageCollectiveModelBreakdown
- type VillageCollectiveRole
- type VillageCollectiveSearchResponse
- type VillageCollectiveSearchResult
- type VillageCollectiveStatusRoleResponse
- type VillageCollectiveSubmission
- type VillageCollectiveTranscript
- type VillageCollectiveTranscriptStats
- type VillageCollectiveViewerRole
- type VillageContributableResponse
- type VillageContributableTranscript
- type VillageContributableView
- type VillageContributedCollective
- type VillageContributedCollectivesResponse
- type VillageContributionAttemptReconciliation
- type VillageContributionErrorCode
- type VillageContributionErrorDetail
- type VillageContributionErrorResponse
- type VillageContributionFamilyMember
- type VillageContributionPageItem
- type VillageContributionPageResponse
- type VillageContributionProjectPage
- type VillageContributionProjectSummary
- type VillageContributionProviderFacet
- type VillageContributionSnapshotRecord
- type VillageContributionSnapshotResponse
- type VillageContributionStatus
- type VillageCreateAPIKeyRequest
- type VillageCreateAttestationRequest
- type VillageCreateCollectiveRequest
- type VillageCreateGroupRequestdeprecated
- type VillageCreatedAPIKey
- type VillageDeprecatedGroupedContributableResponsedeprecated
- type VillageDiscoverabilityRequest
- type VillageEnrichedTranscriptShare
- type VillageErrorResponse
- type VillageGitHubWebhookPayload
- type VillageGroupdeprecated
- type VillageGroupAcceptanceModedeprecated
- type VillageGroupContributordeprecated
- type VillageGroupDataAccessdeprecated
- type VillageGroupDetailRecorddeprecated
- type VillageGroupDetailResponsedeprecated
- type VillageGroupMemberdeprecated
- type VillageGroupMemberRoleRequestdeprecated
- type VillageGroupMemberUsernameRequestdeprecated
- type VillageGroupModelBreakdowndeprecated
- type VillageGroupRoledeprecated
- type VillageGroupStatusRoleResponsedeprecated
- type VillageGroupTranscriptdeprecated
- type VillageGroupTranscriptStatsdeprecated
- type VillageGroupViewerRoledeprecated
- type VillageGroupedCollectiveDetailResponse
- type VillageGroupedContributableResponse
- type VillageGroupedGroupDetailResponsedeprecated
- type VillageHealthResponse
- type VillageHelperMembersPayload
- type VillageInvitedCollective
- type VillageLinkRepositoryRequest
- type VillageLinkedRepositoriesResponse
- type VillageLinkedRepository
- type VillageListTranscriptAttestation
- type VillageListUserOrganization
- type VillageManualAnnotationRequest
- type VillageMetadataUserOrganization
- type VillageMyInvitationsResponse
- type VillageNotificationEmail
- type VillageOrganizationCollective
- type VillageOrganizationCollectivesResponse
- type VillageOrganizationSearchResponse
- type VillageOrganizationSearchResult
- type VillageOrganizationVisibilityRequest
- type VillageOrganizationVisibilityResponse
- type VillagePendingShare
- type VillageProjectCollective
- type VillageProjectDisplayNameRequest
- type VillageProjectNameSource
- type VillagePromptRequest
- type VillagePromptRequestsResponse
- type VillagePromptsCheckMode
- type VillagePublicCollective
- type VillagePublicGroupdeprecated
- type VillagePublicOwner
- func (o VillagePublicOwner) IsAccount(account VillageUUID) bool
- func (o VillagePublicOwner) IsProfile() bool
- func (VillagePublicOwner) JSONSchema() (jsonschema.Schema, error)
- func (o VillagePublicOwner) MarshalJSON() ([]byte, error)
- func (o *VillagePublicOwner) UnmarshalJSON(data []byte) error
- func (o VillagePublicOwner) Validate() error
- type VillagePublicOwnerKind
- type VillagePullRequestAttachedTranscript
- type VillagePullRequestAttachment
- type VillagePullRequestAttachmentResponse
- type VillagePullRequestAttachmentState
- type VillagePullRequestRef
- type VillagePullRequestsSummary
- type VillageRemoveCollectiveMemberResponse
- type VillageRemoveGroupMemberResponsedeprecated
- type VillageRepositoryCommit
- type VillageRepositoryCommitsResponse
- type VillageResolvedProject
- type VillageReviewDecision
- type VillageReviewShareRequest
- type VillageReviewShareResponse
- type VillageSessionListItem
- type VillageSessionListPayload
- type VillageSessionRow
- type VillageSetNotificationEmailRequest
- type VillageShareEvent
- type VillageShareEventActor
- type VillageShareStatus
- type VillageShareTranscriptRequest
- type VillageStatusResponse
- type VillageTag
- type VillageTagUsage
- type VillageTranscript
- type VillageTranscriptAnnotationsResponse
- type VillageTranscriptAttestation
- type VillageTranscriptCollective
- type VillageTranscriptCollectivesResponse
- type VillageTranscriptCommit
- type VillageTranscriptCommitsResponse
- type VillageTranscriptDeletionPolicy
- type VillageTranscriptIntegrity
- type VillageTranscriptListResponse
- type VillageTranscriptListRow
- type VillageTranscriptMetadataResponse
- type VillageTranscriptPullRequest
- type VillageTranscriptPullRequestsResponse
- type VillageTranscriptShare
- type VillageTranscriptVisibility
- type VillageUUID
- type VillageUpdateCollectiveRequest
- type VillageUpdateGroupRequestdeprecated
- type VillageUpdateUserSettingsRequest
- type VillageUser
- type VillageUserCollective
- type VillageUserCollectiveShare
- type VillageUserGroupdeprecated
- type VillageUserGroupSharedeprecated
- type VillageUserProjectResponse
- type VillageUserSettings
- type VillageUserStats
- type VillageUsernameRequest
- type VillageVerifyNotificationEmailRequest
- type VillageVisibleCollective
- type VillageVisibleGroupdeprecated
- type Visibility
- type VisibilityIntent
- type WalkthroughStep
- type WalkthroughTrail
- type WeekAvgDuration
- type WeekContributors
- type WeekCount
- type WeekNewContributors
Constants ¶
const ( AttachmentRouteStatusOK = 200 AttachmentRouteStatusMalformed = 400 AttachmentRouteStatusNotFound = 404 )
Attachment route statuses. A malformed ref is refused before any file is opened. A well-formed ref with no row, or a row whose file is missing, is not found. A present png or jpeg is 200.
const ( AttachmentRouteCodeMalformed = "attachment_ref_malformed" AttachmentRouteCodeNotFound = "attachment_not_found" )
Machine-readable LocalErrorResponse codes for the attachment route. A 200 response has no code.
const ( VillageCollectiveAcceptanceOpen = VillageGroupAcceptanceOpen VillageCollectiveAcceptanceVerifiedOnly = VillageGroupAcceptanceVerifiedOnly VillageCollectiveAcceptanceCurated = VillageGroupAcceptanceCurated VillageCollectiveDataAccessMembersOnly = VillageGroupDataAccessMembersOnly VillageCollectiveDataAccessContributors = VillageGroupDataAccessContributors VillageCollectiveDataAccessPublic = VillageGroupDataAccessPublic VillageCollectiveRoleOwner = VillageGroupRoleOwner VillageCollectiveRoleMember = VillageGroupRoleMember VillageCollectiveRoleContributor = VillageGroupRoleContributor VillageCollectiveRolePending = VillageGroupRolePending VillageAssignableCollectiveRoleContributor = VillageAssignableGroupRoleContributor VillageAssignableCollectiveRoleMember = VillageAssignableGroupRoleMember VillageCollectiveViewerRoleNone = VillageGroupViewerRoleNone VillageCollectiveViewerRoleOwner = VillageGroupViewerRoleOwner VillageCollectiveViewerRoleMember = VillageGroupViewerRoleMember VillageCollectiveViewerRoleContributor = VillageGroupViewerRoleContributor VillageCollectiveViewerRolePending = VillageGroupViewerRolePending )
const ( MaxCollectiveObservationURLBytes = 1024 MaxContributionTraversalTokenBytes = 4096 MaxContributionPageLimit = 200 MaxCollectiveFetchItems = 10000 MaxCollectiveOperationIssueBytes = 2048 )
const ( // TranscriptWindowSpanDefault is the span served when the caller names none. TranscriptWindowSpanDefault = 10 // TranscriptWindowSpanMinimum is the narrowest span a caller may request. TranscriptWindowSpanMinimum = 1 // TranscriptWindowSpanMaximum is the widest span a caller may request. TranscriptWindowSpanMaximum = 10 )
The window span is the number of assistant turns collected on each side of the anchor. A caller may narrow it; it cannot widen the design value.
const ( // TranscriptOutlineLimitDefault is the default row count for page-1 turn outlines. TranscriptOutlineLimitDefault = 50 // TranscriptOutlineLimitMinimum is the smallest allowed outline row count. TranscriptOutlineLimitMinimum = 1 // TranscriptOutlineLimitMaximum is the largest allowed outline row count. TranscriptOutlineLimitMaximum = 200 )
const ( HarnessClaudeCode = bestiary.HarnessClaudeCode // HarnessGeminiCLI is archived: retained for history, never removed. // Gemini CLI was replaced by the Antigravity products. The value stays known // so that sessions which already carry it remain valid. No harvester exists // for it and none is planned. HarnessGeminiCLI = bestiary.HarnessGeminiCLI HarnessCodex = bestiary.HarnessCodex HarnessOpenCode = bestiary.HarnessOpenCode HarnessCursor = bestiary.HarnessCursor // HarnessAntigravity is archived. It named the Antigravity products as one // harness before HarnessAntigravityCLI and HarnessAntigravityIDE existed. // // Deprecated: use HarnessAntigravityCLI or HarnessAntigravityIDE. Removal is // planned; see https://github.com/peasant-labs/schema/issues/232. HarnessAntigravity = bestiary.HarnessAntigravity HarnessStrike = bestiary.HarnessStrike HarnessPi = bestiary.HarnessPi HarnessGrokBuild = bestiary.HarnessGrokBuild HarnessDevinDesktop = bestiary.HarnessDevinDesktop HarnessCline = bestiary.HarnessCline HarnessKiro = bestiary.HarnessKiro HarnessKiroCLI = bestiary.HarnessKiroCLI HarnessKiroCrew = bestiary.HarnessKiroCrew // HarnessAntigravityCLI is the Antigravity command-line agent. HarnessAntigravityCLI = bestiary.HarnessAntigravityCLI // HarnessAntigravityIDE is the Antigravity desktop application. HarnessAntigravityIDE = bestiary.HarnessAntigravityIDE )
const ( // VillageAPIVersion is the info.version of the Village API spec. Bumped to // 0.2.0 when the /api/v1/pull surface was added (additive = minor bump). // Bumped to 0.3.0 (rc2 #118) when model + model.harness/model.model became // required — a tightening of the publish contract (selective required arrays on // operation-specific publish request + SchemaModelInfo). Bumped to 0.4.0 when // PublishRequest.License + PullTranscriptInfo.License were added (additive // optional field = minor bump). Bumped to 0.5.0 when the pull skip-gate surface // (POST /api/v1/pull/transcripts/skip-gate) was added (additive = minor bump). // Bumped to 0.6.0 when shared operation components adopted exact canonical // Types schemas and the stricter publish HTTP body gained a distinct component // identity instead of shadowing the canonical PublishRequest. // Bumped to 0.7.0 when TargetKind gained the file_version and association // members and AnnotationSummary gained TargetFilePath/TargetContentHash and // TargetAssociationID; // harmonizeSharedTypeComponents propagates both into this spec's embedded // annotation components (additive = minor bump). // Bumped to 0.8.0 when the publish wire gained owner-scoped published // associations and annotation ingress gained targetAssociationId plus its // documented Village POST operation (additive = minor bump). // Bumped to 0.9.0 when Harness gained Strike and SessionID gained the two // observed Strike identifier forms (additive = minor bump). // Bumped to 0.10.0 when the owner transcript update operation // (PATCH /api/v1/transcripts/{id}) was declared: an operation the village // already served but the published contract never stated, together with its // tri-state license semantics, its narrowed visibility menu, and its full // reachable refusal set (additive = minor bump). // Each prior version's generated goldens are retained byte-frozen under the // retired-spec immutability guard. // Bumped to 0.11.0 when publication gained canonical operation currency, // authoritative success receipts, real multipart transport, and a complete // successor owner-update projection (additive = minor bump). // Bumped to 0.12.0 when authoritative publication identity adopted its // declared parentSessionId key while historical SessionIdentity retained // parentUuid (corrective additive version). // Bumped to 0.13.0 when schema negotiation gained optional enriched-content // capability advertisements (additive = minor bump). // Bumped to 0.14.0 when the Village API spec gained the schema-owned // collectives, contribution, review, and linked-repository web routes. // Bumped to 0.15.0 when the canonical harness inventory gained Pi. // Bumped to 0.16.0 when the pull request prompt attachment surface was // declared: the GitHub webhook receiver, the attachment read, confirm, and // detach routes, the prompt-request and user-settings routes, and two // collective settings (additive = minor bump). // Bumped to 0.17.0 for grouped transcript listings, helper-member reads, // durable provenance, and authorized relationship navigation. // Bumped to 0.18.0 when the prompt digest's commit items gained the // optional per-commit change counts, which harmonizeSharedTypeComponents // propagates into this spec's embedded digest item component (additive = // minor bump). // Bumped to 0.19.0 when a prompt digest skill item gained the optional args // typed after the command, propagated the same way (additive = minor bump). // Bumped to 0.20.0 when the group repository surface gained the available- // repositories read that feeds the repository picker (additive operation = // minor bump). // Bumped to 0.21.0 when the prompt-request list gained the pull request's // head remote beside its base, so a push from a clone of a fork matches the // request waiting on that fork's author (additive field = minor bump). // Bumped for retained unknown source evidence and preservation negotiation. // Bumped to 0.23.0 for the transcript pull request read, the caller's // totals, the automatic pull request linking setting, pull request titles, // head branches, and list summaries, the collective and repository counts, // and a create request that accepts a null organization (additive = minor // bump). // Bumped to 0.25.0 for the optional thinking level and its raw native // spelling on session metadata, session detail, and assistant turns, the // in-session thinking-level history, plus the thinking_level_v1 content // capability (additive = minor bump). // Bumped to 0.26.0 when the transcript pull list gained the optional // collectives filter, which narrows the list to the approved shares of the // listed collectives the caller belongs to (additive parameter = minor bump). // Canonical collective routes retain deprecated groups for a full release window. // Bumped to 0.28.0 when the grouped transcript metadata stopped declaring // diagnostics_warnings as bare strings: publication carries structured // DiagnosticEntry objects, so the declared read shape could never describe a // stored row (corrective type change = minor bump on a 0.x contract). // Bumped to 0.29.0 when every response that shows a person to another // viewer adopted VillagePublicOwner (a profile or anonymous, resolved by // the server per viewer) in place of the whole VillageUser, owner ids, // usernames, avatars, and discoverable flags; the pull envelope moved to // pull contract 0.3.0 with it, attesters, pull request authors and // requesters, collective creators, and repository linkers adopted it too, // and transcript rows gained the server-resolved parent_transcript_id // and made their repository fields nullable, withheld beside an anonymous // owner (breaking change on a 0.x contract = minor bump). // Bumped to 0.29.1 when the pull operations accepted the optional // Peasant-Pull-Contract request header, reported the served envelope in the // same response header, declared the frozen 0.2.0 Legacy* envelope beside // the 0.3.0 one, and the version response gained pullContractMaxVersion // (additive = patch bump; every 0.29.0 client reads it unchanged). // Bumped to 0.30.0 when collective invitations replaced the owner's add by // username: the add-member operation was removed (breaking change on a 0.x // contract = minor bump), and the invitation operations, the caller's // notification email operations, the one-click unsubscribe operation, and // the notification email and invitation-email preference on the caller's // settings were added. // Bumped to 0.31.0 for the optional unverified pull request read projection. // Bumped to 0.32.0 for the owner integrity-check operation, the optional // integrity field on the transcript metadata read, the Village-Content-Hash // header on the content read, the stored publish metadata pull read, and the // optional publishing client on publish metadata (additive = minor bump). // Bumped to 0.33.0 when the owner integrity-check operation was removed and // integrity became servable on a transcript of any visibility (an operation // removed; minor bump before 1.0). // Bumped to 0.34.0 when AuthoritativeModelInfo keyed its harness version // harnessVersion, the key the publish decoder accepts, instead of version, // which the decoder refused (minor bump before 1.0). // Bumped to 0.35.0 when TurnDetail gained the optional controlKind // annotation, which this spec carries in its embedded session-detail // components (additive = minor bump). // Bumped to 0.36.0 when the transcript list response adopted the numbered // page: per_page replaces limit and next_items carries the following // page's rows, and the list route declares the closed per_page query // (a wire field renamed before 1.0 = minor bump). // Bumped to 0.37.0 when TurnDetail gained the optional contentParts list // and its ordered text/image part and image-part evidence, together with // the content_parts_v1 content capability (additive = minor bump). // 0.38.0 adds known harness identities. // Bumped to 0.39.0 on 2026-11-12 when the session and village row types // gained the optional conversationTurnCount and the village rows gained // displayed_turn_count, the segment directory gained totalConversationTurns // and the ref gained conversationTurns, and every turnCount was re-documented // in folded-turn units (additive = minor bump). The same version declares // the segmented transcript reads getTranscriptSegments, getTranscriptSegment // and getTranscriptWindow with the existing transcript types. // Bumped to 0.40.0 on 2026-11-12 when Harness gained the separate // antigravity-cli and antigravity-ide identities (additive = minor bump). // Bumped to 0.41.0 for the additive positioned segmented transcript reads. // Bumped to 0.42.0 when the transcript metadata read declared 410 for a // transcript its publisher retracted, and the content, header, segment // directory, segment, window and locator reads declared 410 for a // transcript whose stored content an operator recorded as lost (additive // statuses on the existing error envelope = minor bump). The locator // answers the lost-content 410 and never the retracted one. The pull reads // declare no 410. No type, protocol version or segmented read document // changes. VillageAPIVersion = "0.50.0" // Bumped to 0.25.0 when the stored-browsing reads stopped being scoped by // the saved ingestion selection: the home page, its child reads and its // project options describe the stored library, a page row may carry // outsideSelection while remaining visible, and a by-id or publication // read states the same rule. A saved selection scopes future ingest and // hook publication only, never a stored read. // Bumped to 0.26.0 for the optional unverified pull request read projection. // Bumped to 0.27.0 when the search result limit documented its real cap of // 500 rows in place of 50, so the published page bound and the bound the // consumer enforces are one number (a documented bound widened; minor bump // before 1.0). // Bumped to 0.28.0 when TurnDetail gained the optional controlKind // annotation naming the harness control record a turn was projected from // (additive = minor bump). // Bumped to 0.29.0 when the Home sync read moved to one OffsetPage with a // closed PageSize, next-page rows, totals, and a decimal revision, and the // grouped payloads were normalized to the same offset fields (a breaking // envelope change before 1.0 = minor bump). // Bumped to 0.30.0 when the quality read entered the document as one offset // page of QualitySession rows beside the library-wide ProjectAnalytics // summary at the page revision, so no surface subscribes to the full library // (additive operation = minor bump). // Bumped to 0.31.0 when TurnDetail gained the optional ordered contentParts // list, its text and image part evidence, the image entry type, and the // content_parts_v1 capability; every turnCount field documents conversation // turns (additive = minor bump). // Bumped to 0.32.0 when the transcript segment surface entered the document: // the segment directory, the segment read, and the window descriptor, with // their page, revision, and anchor parameters and their refusal arms // (additive operations = minor bump). // Bumped to 0.33.0 when the local image read entered the document: // GET /api/v1/attachments/{ref} serves one content-addressed png or jpeg, // with 400 for a malformed ref and 404 when the row or file is missing // (additive operation = minor bump). // 0.34.0 adds known harness identities. // Bumped to 0.35.0 on 2026-11-10 when the kickstart setup surface entered // the document: the status, session, tree, preview, scan, and commit // routes, the kickstart topic and message, and their closed sets. The // status body is configured plus an optional activeSessionId. Every // non-GET route declares the shared cross-origin refusal. A stale patch // may replace no field, so an empty overwritten list is valid. No // kickstart payload is paged (additive operations = minor bump). // Bumped to 0.36.0 on 2026-11-11 when every kickstart route declared the // non-2xx statuses the server answers, each with the closed // LocalKickstartErrorResponse envelope in place of the shared error body, // and the scan state gained the declared notice for a partial scan. // The settings update also declared 503 for a configuration file that // another save holds, the settings read declared its 500 and 503, and the // four kickstart reads and the settings read declared the host refusal, // and the 403 on every write names both of its codes (additive statuses, // descriptions and a field on a closed response = minor bump). // Bumped to 0.37.0 on 2026-11-12 when the session types gained the optional // conversationTurnCount and the segment directory gained // totalConversationTurns with the ref conversationTurns span, and every // turnCount was re-documented in folded-turn units (additive = minor bump). // Bumped to 0.38.0 on 2026-11-12 when Harness gained the separate // antigravity-cli and antigravity-ide identities (additive = minor bump). // Bumped for the connection-owned preview stream. PeasantLocalAPIVersion = "0.46.0" // Bumped to 0.38.0 to describe the local publication's selection fields as // ingest and push membership rather than browsing permission, without // changing any field or enum. // Bumped to 0.39.0 for unverified pull request evidence and exact source locators. // Bumped to 0.40.0 for the scry check request, response and health body, the // transcript integrity types, and AuthoritativeClientInfo (additive = minor // bump). // Bumped to 0.41.0 when VillageIntegrityCheckResult and // VillageIntegrityCheckResponse were removed with the owner integrity check // (minor bump before 1.0). // Bumped to 0.42.0 when AuthoritativeModelInfo keyed its harness version // harnessVersion instead of version (minor bump before 1.0). // Bumped to 0.43.0 when TurnDetail gained the optional controlKind // annotation (additive = minor bump). // Bumped to 0.44.0 when the page contract became one OffsetPage with a // numeric PageSize, and the local grouped payloads adopted its offset fields // (a breaking envelope change before 1.0 = minor bump). // Bumped to 0.45.0 when TurnContentPart, TurnPartType, ImagePart, // OmittedReason, ImageMediaType, and the image EntryType entered the // catalog, and every turnCount field documented conversation turns // (additive = minor bump). // 0.46.0 adds known harness identities. // Bumped to 0.47.0 on 2026-11-10 when the kickstart session, tree, event, // and closed-set types entered the catalog so the local setup routes and // the language bindings share one definition (additive = minor bump). // Bumped to 0.48.0 on 2026-11-11 when LocalKickstartErrorCode and // LocalKickstartErrorResponse entered the catalog and LocalKickstartScan // gained the optional notice (additive = minor bump). // Bumped to 0.49.0 on 2026-11-12 when the catalog gained // ConversationTurnSpan, the conversationTurnCount fields, and the // re-documented folded-turn turnCount fields (additive = minor bump). // Bumped to 0.50.0 on 2026-11-12 when Harness gained the separate // antigravity-cli and antigravity-ide identities (additive = minor bump). // Bumped to 0.51.0 for the positioned segmented transcript read catalog. // Bumped for preview stream payloads and closed sets. TypesVersion = "0.60.0" // SegmentedReadAPIVersion identifies the newest declared segmented read // protocol. Version 0.1.0 (additive) first declares the already-shipped // reads and is still served when v is omitted or v=1. // Version 0.2.0 (breaking) adds the positioned protocol at v=2; this is // a breaking-class change expressed as a minor bump before 1.0. // // A breaking protocol change that needs a new v= generation is separate // from freezing a document and requires its own protocol decision. SegmentedReadAPIVersion = "0.2.0" // SegmentedReadSpecVersion identifies the current frozen document. Release // freezes advance it independently of the wire protocol and its selectors. SegmentedReadSpecVersion = "0.5.0" // SegmentedReadMinVersion is the oldest declared and served segmented read // protocol. It moves only when the oldest served version is retired. SegmentedReadMinVersion = "0.1.0" )
Versioned-spec info.version values. These are the SINGLE SOURCE OF TRUTH for each versioned OpenAPI spec's semantic version: they feed WithVersion(...) in the openapi.Build*Spec functions (re-exported there as openapi.VillageAPIVersion etc.), the frozen artifact filenames, AND the version-aware accessors in this package (e.g. VillageAPISpecJSON). The release freeze writes these stamps.
They live in the contract root (not the openapi sub-package) so the embedded-spec accessors below can key off them without an import cycle (openapi imports this package, so this package cannot import openapi).
Content changes regenerate working specs without changing these constants. Numbered documents stay byte-frozen under the registry guards.
const ( // VillageContributionPageLimitDefault is the number of roots a page holds // when the caller names no limit. VillageContributionPageLimitDefault = 500 // VillageContributionPageLimitMinimum is the smallest page a caller may ask for. VillageContributionPageLimitMinimum = 1 // VillageContributionPageLimitMaximum is the largest page a caller may ask // for, counted in roots. VillageContributionPageLimitMaximum = 500 )
The paged contribution view bounds one page by the number of root sessions, never by the number of transcripts. A root is a session with no parent_session_id, or whose parent is not among the owner's published transcripts. A session whose chain of parents loops back on itself (for example a session that names itself as its parent) is listed as a root with no helpers taken from the loop, so every session of the library is listed exactly once. A page carries each of its roots together with the whole family of helpers that descend from them, so a page can hold far more transcripts than its limit.
Families are listed most recently active first. A family is ordered by the last activity of its ROOT session, newest first, where last activity is the root's session_end, or its session_start when session_end is unknown, or its published_at when both are unknown. Families with the same last activity are ordered by the root's transcript id ascending. Helpers never affect the position of their family.
const ( // VillageContributionSnapshotMaxBytes bounds the encoded response body of // one snapshot, 8 MiB (8388608 bytes). A snapshot that would exceed it is // refused whole with a 413 whose code is snapshot_too_large; nothing // partial is returned, and the client narrows the search with q or // provider and reads the snapshot again. The bound is a size: there is no // record-count cap, so how many sessions fit depends on their records. It // is a contract constant, not a field, and the snapshot declares no limit // parameter. VillageContributionSnapshotMaxBytes = 8 << 20 // VillageContributionSelectionMaxTranscripts is the most sessions one // selection write may offer, and the most private approvals it may carry. // A body over the bound is an ordinary contract violation, a 400 with no // code; a client with a larger selection sends it as several requests. VillageContributionSelectionMaxTranscripts = 1000 )
The snapshot view and the selection write are bounded by the size of one document and by the number of sessions in one request.
const AttachmentCacheControl = "public, max-age=31536000, immutable"
AttachmentCacheControl is the Cache-Control value of a successful image read. The URL is the digest, so a 200 response never changes.
const AttachmentRefPattern = `^[0-9a-f]{64}$`
AttachmentRefPattern is the path-parameter pattern for a stored image. It is the same lowercase 64-hex sha256 rule ImagePart.ref uses, so a renderer and the local route cannot disagree about which references resolve.
const AttachmentRouteOperationID = "getAttachment"
AttachmentRouteOperationID is the OpenAPI operationId of AttachmentRoutePath.
const AttachmentRoutePath = "/api/v1/attachments/{ref}"
AttachmentRoutePath is the local content-addressed image read. The path parameter is the sha256 of the stored bytes, not a session identifier.
const CollectiveTimestampPattern = `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?Z$`
CollectiveTimestampPattern is the lossless UTC RFC3339 wire grammar for collective evidence: seconds are required, precision is at most nanoseconds.
const CutVersion = "c1"
CutVersion names the producer rules for the turn byte measure, segment cut, ResolveTranscriptWindow, ResolvePositionedWindow, cooking, numbering, and TranscriptSegmentBudgetBytes. Changing served rows, segment boundaries, or display numbers changes this identity and adds a new version's cut and numbering fixture expectations.
const LegacyPullAnonymousUsername = "anon"
LegacyPullAnonymousUsername is the username the 0.2.0 envelope carries for a person anonymous to the caller, beside an empty id. The empty id plus "anon" is the one value every released CLI tolerates: it decodes, it never equals the caller's own id, so the transcript or annotation is foreign, and it never names the hidden person.
const LocalKickstartDroppedLabelsMax = 3
LocalKickstartDroppedLabelsMax is the most vanished choices a scan names in DroppedLabels. DroppedSelections carries the full count, so a consumer that lists the labels reads the rest from the difference and never restates this number. The maxItems tag on LocalKickstartScan.DroppedLabels is this value, and a test keeps the two equal.
const LocalOwnerRecentClaimLimit = 100
LocalOwnerRecentClaimLimit is the most recent claim entries a status read returns. The log itself is append-only and keeps every entry; the wire bounds one response so a session-end harvest that claims for years cannot grow it without limit. A client that needs an older page asks again before LocalOwnerStatus.NextBefore.
const MaxLocalKickstartPreviewNodeIDBytes = 512
MaxLocalKickstartPreviewNodeIDBytes bounds the decoded node ID. The request validator separately checks the encoded message, including JSON escaping. At worst 512 one-byte control characters take 3072 encoded bytes, leaving room for the bounded setup and request IDs and the surrounding envelope.
const MaxTranscriptDirectoryRefs = 10000
MaxTranscriptDirectoryRefs bounds one TranscriptSegmentDirectory read. The directory is the transcript's only global index, so the read is capped: above this many segments the server serves one page of this size and sets directoryPage/directoryPerPage. 10,000 segments is roughly 10 GiB of transcript, so the cap only exists to keep the directory read from becoming the unbounded payload the segment model removes.
const MetadataSchemaVersion = 12
MetadataSchemaVersion is the schema version written by this build of the ingest tool. v1: initial schema v2: SQLite persistence layer, store integration v3: transcript filename {sessionId}--transcript.{ext} (was {unixMillis}--),
timestamp extraction scans all lines (was first/last line only)
v4: GitContext.Commits field added (session-to-commit linking) v5: Claude indexer fixes — system content extraction, tool_result tool_use_id linking v6: ContentHash, MetadataHash, RedactionInfo — deferred redaction model v7: CWD field — real working directory for context-aware slug redaction v8: DerivedAt field — Unix ms when metadata.json was derived from DB (DB as SOT) v9: harness key unification — UnifiedMetadata.ModelHarness re-keyed json:"modelHarness"
-> json:"harness" (emit-side flip). The bump forces the DIFF stage to re-classify existing on-disk sessions as Updated so the stale "modelHarness" key self-heals (re-extract + rewrite) on next ingest; UnmarshalJSON still accepts the legacy key on pre-v9 files in the meantime.
v10: optional AdapterVersion records the successful Peasant adapter/parser.
The v9-to-v10 change is local metadata bookkeeping, not a reason to read native sources again. Consumers can losslessly adopt v9 metadata without inventing the missing producer revision. Native refresh is a separate decision.
v11: session graph provenance.
v12: optional thinking level, raw native spelling, and in-session level history; optional-only, stays refresh-free.
const PublicRefUTF8ByteFormat = "public-ref-utf8-96-bytes"
PublicRefUTF8ByteFormat identifies the format assertion shared by generated validators for opaque public references. Unlike maxLength, which counts Unicode code points, this assertion counts the encoded UTF-8 bytes.
const PullContractHeader = "Peasant-Pull-Contract"
PullContractHeader names the request and response header that selects and reports the pull envelope version on the four pull operations: the list, the metadata read, the annotations read and the content read.
A client sends the newest pull contract it reads. Village serves the highest version it supports that is no newer than the requested one and no older than its minimum; with no header it serves its default (the advertised pullContractVersion); a requested version below its minimum is refused with 406 Not Acceptable and a VillageErrorResponse, which a client reports as its incompatible-contract error. Every pull response carries the header with the version actually served, so a client knows exactly which envelope it got.
A well-formed value is MAJOR.MINOR.PATCH digits only (0.3.0). A malformed value (0.3, v0.3.0, any other text) is treated as absent and the default is served: lenient, so a client with a buggy header still pulls.
Compatibility: a patch bump within a minor (0.3.x) is additive, so a client that reads 0.3.0 accepts any 0.3.z and ignores fields it does not know. Only a new minor needs a new client, and Village keeps serving older minors to older clients for a deprecation period.
const RecordedCostSourceHarnessEstimate = "recorded_harness_estimate"
const RepresentationVersion = "r1"
RepresentationVersion names the representation derivation. Changing its inputs or encoding requires a coordinated version change.
const ScryContractVersion = "0.1.0"
ScryContractVersion is the version of the scry wire contract. Village and scry pin the same schema release, so both sides carry the same value. Village compares it with ScryHealthResponse.ContractVersion before it calls POST /v1/check, and the check request carries it so scry can refuse a request built for another contract.
const SessionTeammateMaxIdentityRunes = 256
SessionTeammateMaxIdentityRunes is the bound on each SessionTeammate identity field, counted in Unicode code points. It matches the published maxLength, which counts code points too.
const ThinkingLevelRawMaxBytes = 128
ThinkingLevelRawMaxBytes is the encoded UTF-8 byte bound of ThinkingLevelRaw.
const ThinkingLevelRawUTF8ByteFormat = "thinking-level-raw-utf8-128-bytes"
ThinkingLevelRawUTF8ByteFormat identifies the JSON Schema format assertion that counts encoded UTF-8 bytes of a ThinkingLevelRaw. maxLength counts code points, so this assertion carries the byte rule.
const TranscriptSegmentBudgetBytes = 1 << 20
TranscriptSegmentBudgetBytes is the target byte size of one transcript segment. A segment fills with whole turns until the next turn would push it past this size. A single turn larger than the budget is alone in its segment.
It is a contract value, not a tuning knob: every server cuts with it, so changing it moves the segment boundaries of every transcript on every server, and a directory cut under the old value no longer matches a segment cut under the new one. Change it only as a deliberate contract change.
const TranscriptUpdateTitleMaxLength = 500
Validate checks the closed-set fields a client can get wrong locally, so a caller learns about a bad enum value before spending a network round trip on a guaranteed 400. It deliberately does NOT attempt to predict the server's ownership check or the irrevocability refusal: both depend on stored state this request cannot see, and pretending otherwise would produce a local success that the server then contradicts. TranscriptUpdateTitleMaxLength is the declared bound on a title, mirroring the storage column. It is a named constant because three places must agree: this validator, the reflector tag that emits maxLength into both documents, and the corpus rows that exercise the boundary.
It counts RUNES, matching the column's code-point counting. A generated JavaScript validator counts UTF-16 code units instead and is therefore stricter on astral input; that divergence is deliberate and documented on Title above.
Variables ¶
var ( // TranscriptSourceReadPolicy is the unchanged envelope source boundary. TranscriptSourceReadPolicy = transcriptRawPolicy() // TranscriptSourceDetailReadPolicy is the unchanged bare-detail boundary. TranscriptSourceDetailReadPolicy = sessionDetailRawPolicy() // TranscriptDownloadPolicy preserves source validation without an additional // outer byte cap. It accepts envelope and bare-detail opaque metadata paths. TranscriptDownloadPolicy = TranscriptContentReadPolicy{ MaxDocumentDepth: 64, OpaqueMetadataPointers: []string{ "/" + transcriptWireSessionDetail + "/" + transcriptWireNativeMetadata + "/*/" + transcriptWireData, "/" + transcriptWireSessionDetail + "/" + transcriptWireEarlierHistory + "/*/" + transcriptWireNativeMetadata + "/*/" + transcriptWireData, "/" + transcriptWireNativeMetadata + "/*/" + transcriptWireData, "/" + transcriptWireEarlierHistory + "/*/" + transcriptWireNativeMetadata + "/*/" + transcriptWireData, }, } )
var AllActorOrigins = []ActorOrigin{ActorOriginOperator, ActorOriginAgentDelegate, ActorOriginHarness, ActorOriginUnknown}
var AllAnnotationAxes = []AnnotationAxis{ AxisType, AxisSession, AxisProject, }
AllAnnotationAxes is the canonical list of annotation subscription axes.
var AllAnnotationDatatypes = []AnnotationDatatype{ DatatypeText, DatatypeInteger, DatatypeReal, DatatypeBoolean, }
AllAnnotationDatatypes is the canonical list of all known annotation datatypes.
var AllAnnotationPushStatuses = []AnnotationPushStatus{ PushStatusCreated, PushStatusUpdated, PushStatusSkipped, PushStatusError, }
AllAnnotationPushStatuses is the canonical list of annotation push outcomes.
var AllAnnotationStatuses = []AnnotationStatus{ StatusProposed, StatusActive, StatusDeprecated, StatusRetired, }
AllAnnotationStatuses is the canonical list of all known annotation statuses.
var AllAnnotatorKinds = []AnnotatorKind{ AnnotatorHuman, AnnotatorAgent, AnnotatorRule, }
AllAnnotatorKinds is the canonical list of all known annotator kinds.
var AllAssociationConclusions = []AssociationConclusion{ AssociationConclusionConfirmed, AssociationConclusionCandidate, }
AllAssociationConclusions is the canonical list of association conclusions.
var AllAssociationEvidenceKinds = []AssociationEvidenceKind{ AssociationEvidenceRecordedCommit, AssociationEvidenceTouchedFile, AssociationEvidenceBranchMembership, AssociationEvidenceTimeWindow, }
AllAssociationEvidenceKinds is the canonical list and order of atomic association evidence observations.
var AllAttachmentRouteOutcomes = []AttachmentRouteOutcome{ AttachmentRouteOutcomePNG, AttachmentRouteOutcomeJPEG, AttachmentRouteOutcomeMalformed, AttachmentRouteOutcomeMissingRow, AttachmentRouteOutcomeMissingFile, }
AllAttachmentRouteOutcomes is the canonical closed list.
var AllAutoPublishEvents = []AutoPublishEvent{AutoPublishPrePush, AutoPublishPostCommit}
AllAutoPublishEvents is the canonical auto-publish hook menu.
var AllAutoPublishHookStatuses = []AutoPublishHookStatus{AutoPublishHookAbsent, AutoPublishHookInstalled, AutoPublishHookBlocked, AutoPublishHookFailed}
AllAutoPublishHookStatuses is the canonical hook state menu.
var AllAutoPublishRuleKinds = []AutoPublishRuleKind{AutoPublishRuleFolder, AutoPublishRuleRemote}
AllAutoPublishRuleKinds is the canonical rule kind menu.
var AllChangeBindings = []ChangeBinding{ ChangeBindingBound, ChangeBindingCandidate, }
AllChangeBindings is the canonical list of session-to-change bindings.
var AllChannelTopics = []ChannelTopic{ TopicDashboard, TopicSessions, TopicSessionDetail, TopicTrends, TopicQuality, TopicAnnotations, TopicProjectFamiliarity, TopicKickstart, }
AllChannelTopics is the canonical list of subscribable WebSocket topics.
var AllClaudeBuiltinCmds = [...]BuiltinCommand{ ClaudeBuiltinCmdExit, ClaudeBuiltinCmdCompact, ClaudeBuiltinCmdClear, ClaudeBuiltinCmdNew, ClaudeBuiltinCmdModel, ClaudeBuiltinCmdUsage, ClaudeBuiltinCmdCost, ClaudeBuiltinCmdContext, ClaudeBuiltinCmdPlugin, ClaudeBuiltinCmdPermissions, ClaudeBuiltinCmdLogin, ClaudeBuiltinCmdResume, ClaudeBuiltinCmdPlan, ClaudeBuiltinCmdFast, ClaudeBuiltinCmdVoice, ClaudeBuiltinCmdTodos, ClaudeBuiltinCmdReloadPlugins, ClaudeBuiltinCmdSandbox, ClaudeBuiltinCmdConfig, ClaudeBuiltinCmdStatusline, ClaudeBuiltinCmdUpgrade, ClaudeBuiltinCmdExtraUsage, ClaudeBuiltinCmdRateLimitOptions, ClaudeBuiltinCmdPrivacySettings, ClaudeBuiltinCmdHelp, ClaudeBuiltinCmdCommands, }
AllClaudeBuiltinCmds is the canonical list of all known Claude Code built-in commands.
var AllClaudeCodeCompactionTriggers = []ClaudeCodeCompactionTrigger{ ClaudeCodeCompactionTriggerAuto, ClaudeCodeCompactionTriggerManual, }
var AllCollectiveEvidenceCoverages = []CollectiveEvidenceCoverage{CollectiveEvidenceCoverageAvailable, CollectiveEvidenceCoverageUnknown}
var AllCollectiveFetchCommits = []CollectiveFetchCommit{CollectiveFetchCommitUpdated, CollectiveFetchCommitUnchanged, CollectiveFetchCommitRetained}
var AllCollectiveFetchDomains = []CollectiveFetchDomain{CollectiveFetchDomainCatalog, CollectiveFetchDomainHistory, CollectiveFetchDomainAssociations}
var AllCollectiveFetchOutcomes = []CollectiveFetchOutcome{CollectiveFetchOutcomeComplete, CollectiveFetchOutcomePartial, CollectiveFetchOutcomeFailed}
var AllCollectiveFetchStates = []CollectiveFetchState{CollectiveFetchStateComplete, CollectiveFetchStateFailed, CollectiveFetchStateCancelled, CollectiveFetchStateSuperseded, CollectiveFetchStateNotRequested}
var AllCollectiveObservationReasons = []CollectiveObservationReason{CollectiveObservationReasonMembership, CollectiveObservationReasonContribution, CollectiveObservationReasonOrganization, CollectiveObservationReasonExplicit}
var AllCollectiveObservationSources = []CollectiveObservationSource{CollectiveObservationSourceMembership, CollectiveObservationSourceContributionDiscovery, CollectiveObservationSourceOrganization, CollectiveObservationSourceExplicit, CollectiveObservationSourceSubmissions, CollectiveObservationSourceAttempts, CollectiveObservationSourceAssociations}
var AllCollectiveObservationStates = []CollectiveObservationState{CollectiveObservationStateObserved, CollectiveObservationStateUnavailable, CollectiveObservationStateInvalidated}
var AllCollectiveOperations = []CollectiveOperation{CollectiveOperationPublish, CollectiveOperationShare, CollectiveOperationFetch, CollectiveOperationPull}
var AllCollectiveSourceOutcomes = []CollectiveSourceOutcome{CollectiveSourceDisclosed, CollectiveSourceNotDisclosed, CollectiveSourceFailed}
var AllConfidences = []Confidence{ ConfidenceHigh, ConfidenceMedium, ConfidenceLow, }
AllConfidences is the canonical list of confidence levels.
var AllContentCapabilities = []ContentCapability{ContentCapabilityContentPartsV1, ContentCapabilityDetailedUsageV1, ContentCapabilityNativeMetadataV1, ContentCapabilityObservedModelV1, ContentCapabilityRetainedUnknownV1, ContentCapabilitySessionGraphProvenanceV1, ContentCapabilityThinkingLevelV1, ContentCapabilityToolNamespaceV1}
AllContentCapabilities is the canonical closed capability inventory.
var AllContentKinds = []ContentKind{ContentKindSessionDetail}
AllContentKinds is the canonical list of transcript content envelope kinds.
var AllContentOrigins = []ContentOrigin{ContentOriginSubmittedInput, ContentOriginHarnessContext, ContentOriginAgentOutput, ContentOriginAgentCommunication, ContentOriginToolActivity, ContentOriginSystemControl, ContentOriginGeneratedSummary, ContentOriginUnknown}
var AllContentOwnerships = []ContentOwnership{ContentOwnershipLocal, ContentOwnershipInherited, ContentOwnershipUncertain}
var AllDecayLevels = []DecayLevel{ DecayFresh, DecayFading, DecayStale, DecayUnexplored, }
AllDecayLevels is the canonical list of project familiarity decay levels.
var AllDeliveryOrigins = []DeliveryOrigin{DeliveryOriginSessionAdmission, DeliveryOriginGuardianReview, DeliveryOriginSubagentDelivery, DeliveryOriginInheritedContext, DeliveryOriginToolDelivery, DeliveryOriginSystemLifecycle, DeliveryOriginUnknown}
var AllDiffLineKinds = []DiffLineKind{ DiffLineKindContext, DiffLineKindAdd, DiffLineKindDelete, }
AllDiffLineKinds is the canonical inventory of unified-diff line kinds.
var AllDigestItemKinds = []DigestItemKind{DigestItemSession, DigestItemPrompt, DigestItemSkill, DigestItemCommit}
AllDigestItemKinds is the canonical inventory, in the order a renderer documents them.
var AllEarlierHistoryStates = []EarlierHistoryState{EarlierHistoryUncertainMigrated, EarlierHistoryUncertainUnresolved}
var AllEdgeViolationKinds = []EdgeViolationKind{ EdgeViolationCycle, EdgeViolationWrongWay, }
AllEdgeViolationKinds is the canonical list of map structure violations.
var AllEntryTypes = []EntryType{ EntryTypeText, EntryTypeToolUse, EntryTypeToolResult, EntryTypeThinking, EntryTypeSystem, EntryTypeError, EntryTypeResult, EntryTypeImage, }
AllEntryTypes is the canonical list of all known entry types.
var AllEvidenceKinds = []EvidenceKind{EvidenceNativeTyped, EvidenceLifecycleTyped, EvidenceExistingAdapter, EvidenceRetainedLastGood, EvidenceUnknown, EvidenceConflict}
var AllFileChangeStatuses = []FileChangeStatus{ FileChangeStatusModified, FileChangeStatusAdded, FileChangeStatusDeleted, FileChangeStatusRenamed, }
AllFileChangeStatuses is the canonical inventory of file change statuses.
var AllHarnesses = []Harness{ HarnessClaudeCode, HarnessGeminiCLI, HarnessCodex, HarnessOpenCode, HarnessCursor, HarnessStrike, HarnessPi, }
AllHarnesses is the declared set: the harness values a Peasant release has listed for ingestion. It is a subset of Harnesses(), the known set, and it is not the list of every legal harness value. It includes HarnessGeminiCLI, which is archived and has no harvester. Which harnesses a Peasant build can harvest is owned by that build's adapter registry, not by this module.
var AllImageMediaTypes = []ImageMediaType{ImageMediaTypePNG, ImageMediaTypeJPEG}
AllImageMediaTypes is the canonical closed list of recorded image media types.
var AllInputModalities = []InputModality{InputModalityNone, InputModalityText, InputModalityMedia, InputModalityUserAction, InputModalityMixed, InputModalityUnknown}
var AllInsightKinds = []InsightKind{ InsightKindDecision, InsightKindFriction, InsightKindUnusual, InsightKindRetryLoop, }
AllInsightKinds is the canonical list of insight kinds.
var AllInsightProvenances = []InsightProvenance{ InsightProvenanceMechanical, InsightProvenanceMined, }
AllInsightProvenances is the canonical list of insight provenances.
var AllInteractionTypes = []InteractionType{ InteractionMentioned, InteractionRead, InteractionDiscussed, InteractionQuestioned, }
AllInteractionTypes is the canonical list of project familiarity interactions.
var AllLicenses = []License{ LicenseCC0, LicenseCCBY, LicenseCCBYSA, }
AllLicenses is the canonical menu of known licenses.
var AllLocalArtifactIdentityKinds = []LocalArtifactIdentityKind{ LocalArtifactIdentityKindLocal, LocalArtifactIdentityKindVillage, LocalArtifactIdentityKindForeign, LocalArtifactIdentityKindUnknown, }
AllLocalArtifactIdentityKinds is the canonical artifact identity menu.
var AllLocalClaimSources = []LocalClaimSource{ LocalClaimSourceManual, LocalClaimSourceSignInPrompt, LocalClaimSourceAutomatic, }
AllLocalClaimSources is the closed set of claim-entry sources.
var AllLocalCollectiveSuggestionReasons = []LocalCollectiveSuggestionReason{LocalCollectiveSuggestionLinkedRepository, LocalCollectiveSuggestionLinkedGithubOrg}
AllLocalCollectiveSuggestionReasons is the canonical suggestion reason menu.
var AllLocalConfirmedContributionOutcomes = []LocalConfirmedContributionOutcome{LocalConfirmedContributionPublished, LocalConfirmedContributionSubmitted}
var AllLocalContributionEvidenceKinds = []LocalContributionEvidenceKind{LocalContributionEvidenceRemoteAttempts, LocalContributionEvidenceReceipts, LocalContributionEvidenceOperationDiagnostics}
var AllLocalKickstartCloseReasons = []LocalKickstartCloseReason{LocalKickstartClosedCommitted, LocalKickstartClosedExpired}
AllLocalKickstartCloseReasons is the canonical close-reason menu.
var AllLocalKickstartConnectAnswers = []LocalKickstartConnectAnswer{LocalKickstartConnectAccept, LocalKickstartConnectSkip}
AllLocalKickstartConnectAnswers is the canonical connect-answer menu.
var AllLocalKickstartDiffLineTypes = []LocalKickstartDiffLineType{LocalKickstartDiffAdd, LocalKickstartDiffDel, LocalKickstartDiffCtx}
AllLocalKickstartDiffLineTypes is the canonical diff-line menu.
var AllLocalKickstartErrorCodes = []LocalKickstartErrorCode{ LocalKickstartErrorBodyMissing, LocalKickstartErrorBodyInvalid, LocalKickstartErrorScopeInvalid, LocalKickstartErrorAnswersInvalid, LocalKickstartErrorSessionCommitting, LocalKickstartErrorRevisionAhead, LocalKickstartErrorAnswerRefused, LocalKickstartErrorScanNotDone, LocalKickstartErrorFieldUnknown, LocalKickstartErrorFieldOutOfScope, LocalKickstartErrorFieldHidden, LocalKickstartErrorTreeAnswerShape, LocalKickstartErrorConnectOutOfScope, LocalKickstartErrorConnectNotConnected, LocalKickstartErrorConnectUnknown, LocalKickstartErrorCommitRefused, LocalKickstartErrorSessionNotFound, LocalKickstartErrorPreviewRowNotFound, LocalKickstartErrorPreviewCaptureNotFound, LocalKickstartErrorPreviewSourceChanged, LocalKickstartErrorPreviewLateResult, LocalKickstartErrorPreviewCapacity, LocalKickstartErrorPreviewOutOfOrder, LocalKickstartErrorFailed, LocalKickstartErrorStatusUnreadable, LocalKickstartErrorConfigUnreadable, LocalKickstartErrorConfigUnwritable, LocalKickstartErrorSessionUnbuildable, LocalKickstartErrorAnswerUnencodable, LocalKickstartErrorPreviewUnreadable, LocalKickstartErrorContractBreach, LocalKickstartErrorUnavailable, LocalKickstartErrorConfigBusy, LocalKickstartErrorConfigChanging, }
AllLocalKickstartErrorCodes is the canonical kickstart error-code menu.
var AllLocalKickstartEventKinds = []LocalKickstartEventKind{ LocalKickstartEventSession, LocalKickstartEventAnswers, LocalKickstartEventConflicts, LocalKickstartEventScan, LocalKickstartEventIngest, LocalKickstartEventClosed, }
AllLocalKickstartEventKinds is the canonical event-kind menu.
var AllLocalKickstartFieldKinds = []LocalKickstartFieldKind{LocalKickstartFieldToggle, LocalKickstartFieldChoice, LocalKickstartFieldAction, LocalKickstartFieldTree, LocalKickstartFieldNotice}
AllLocalKickstartFieldKinds is the canonical field-control menu.
var AllLocalKickstartIngestStates = []LocalKickstartIngestState{LocalKickstartIngestIdle, LocalKickstartIngestRunning, LocalKickstartIngestBusy, LocalKickstartIngestFailed}
AllLocalKickstartIngestStates is the canonical ingest-state menu.
var AllLocalKickstartLineKinds = []LocalKickstartLineKind{LocalKickstartLineText, LocalKickstartLineLabel, LocalKickstartLineBefore, LocalKickstartLineAfter, LocalKickstartLineSpacer}
AllLocalKickstartLineKinds is the canonical line menu.
var AllLocalKickstartNextSteps = []LocalKickstartNextStep{ LocalKickstartNextStepConfig, LocalKickstartNextStepWebStart, LocalKickstartNextStepVillageLogin, LocalKickstartNextStepVillagePush, LocalKickstartNextStepAutoPublish, }
AllLocalKickstartNextSteps is the canonical finish-action menu.
var AllLocalKickstartNodeKinds = []LocalKickstartNodeKind{LocalKickstartNodeProject, LocalKickstartNodeGroup, LocalKickstartNodeBranch, LocalKickstartNodeSession}
AllLocalKickstartNodeKinds is the canonical node-kind menu.
var AllLocalKickstartNodeStates = []LocalKickstartNodeState{LocalKickstartNodeNone, LocalKickstartNodeSome, LocalKickstartNodeAll}
AllLocalKickstartNodeStates is the canonical node-state menu.
var AllLocalKickstartPreviewCloseReasons = []LocalKickstartPreviewCloseReason{LocalKickstartPreviewClosedByClient, LocalKickstartPreviewReplaced, LocalKickstartPreviewSessionClosed, LocalKickstartPreviewRescanned, LocalKickstartPreviewIdle, LocalKickstartPreviewEvicted, LocalKickstartPreviewShutdown, LocalKickstartPreviewSourceChanged, LocalKickstartPreviewLateResult, LocalKickstartPreviewUnreadable, LocalKickstartPreviewOutOfOrder, LocalKickstartPreviewSlowClient, LocalKickstartPreviewRowNotFound, LocalKickstartPreviewNotSessionRow, LocalKickstartPreviewUnavailable, LocalKickstartPreviewNoTurns, LocalKickstartPreviewCapacity}
var AllLocalKickstartPreviewContinuations = []LocalKickstartPreviewContinuation{LocalKickstartPreviewContinuationMore, LocalKickstartPreviewContinuationEnd, LocalKickstartPreviewContinuationCut}
var AllLocalKickstartPreviewCutReasons = []LocalKickstartPreviewCutReason{LocalKickstartPreviewCutSourceBudget, LocalKickstartPreviewCutSerializedBudget, LocalKickstartPreviewCutTurnBudget, LocalKickstartPreviewCutOversizedRecord, LocalKickstartPreviewCutOriginNotResumable}
var AllLocalKickstartPreviewEventKinds = []LocalKickstartPreviewEventKind{LocalKickstartPreviewOpened, LocalKickstartPreviewSegmentEvent, LocalKickstartPreviewClosed}
var AllLocalKickstartPreviewOps = []LocalKickstartPreviewOp{LocalKickstartPreviewOpen, LocalKickstartPreviewMore, LocalKickstartPreviewClose}
var AllLocalKickstartResolutions = []LocalKickstartResolution{LocalKickstartResolutionMine, LocalKickstartResolutionTheirs}
AllLocalKickstartResolutions is the canonical conflict-resolution menu.
var AllLocalKickstartScanStates = []LocalKickstartScanState{LocalKickstartScanIdle, LocalKickstartScanRunning, LocalKickstartScanDone, LocalKickstartScanError}
AllLocalKickstartScanStates is the canonical scan-state menu.
var AllLocalKickstartScopes = []LocalKickstartScope{LocalKickstartScopeFull, LocalKickstartScopeSelection}
AllLocalKickstartScopes is the canonical scope menu.
var AllLocalKickstartStopKinds = []LocalKickstartStopKind{LocalKickstartStopConnection, LocalKickstartStopConfig, LocalKickstartStopReview, LocalKickstartStopIngest}
AllLocalKickstartStopKinds is the canonical stop-layout menu.
var AllLocalOperationDiagnosticOutcomes = []LocalOperationDiagnosticOutcome{LocalOperationDiagnosticFailed, LocalOperationDiagnosticUncertain}
var AllLocalOwnerPromptStates = []LocalOwnerPromptState{ LocalOwnerPromptStateNotApplicable, LocalOwnerPromptStateDue, LocalOwnerPromptStateDeclined, LocalOwnerPromptStateCompleted, }
AllLocalOwnerPromptStates is the closed set of claim prompt states.
var AllLocalPublicationStates = []LocalPublicationState{LocalPublicationUnpublished, LocalPublicationPublished}
AllLocalPublicationStates is the canonical publication state menu.
var AllLocalSettingKinds = []LocalSettingKind{LocalSettingBoolean, LocalSettingInteger, LocalSettingString, LocalSettingStringList, LocalSettingChoice, LocalSettingStructured}
AllLocalSettingKinds is the canonical setting value kind menu.
var AllLocalSyncPublicationFilters = []LocalSyncPublicationFilter{LocalSyncPublicationAll, LocalSyncPublicationNotPublished, LocalSyncPublicationPublished, LocalSyncPublicationAuto}
var AllMapNodeKinds = []MapNodeKind{ MapNodeKindModule, MapNodeKindPackage, MapNodeKindFile, }
AllMapNodeKinds is the canonical list of map node classifications.
var AllMessageTypes = []MessageType{ MsgSubscribe, MsgUnsubscribe, MsgDashboard, MsgSessions, MsgSessionDetail, MsgTrends, MsgQuality, MsgAnnotations, MsgProjectFamiliarity, MsgConnected, MsgError, MsgKickstart, MsgKickstartPreview, }
AllMessageTypes is the canonical list of WebSocket message discriminators.
var AllNativeMetadataKinds = []NativeMetadataKind{NativeMetadataPiCustomData, NativeMetadataPiCustomMessageDetails, NativeMetadataPiToolResultDetails, NativeMetadataPiCompactionDetails, NativeMetadataPiBranchSummaryDetails, NativeMetadataClaudeCodeCompactionDetails}
var AllNativeMetadataSourceTypes = []NativeMetadataSourceType{NativeSourcePiCustom, NativeSourcePiCustomMessage, NativeSourcePiMessage, NativeSourcePiCompaction, NativeSourcePiBranchSummary, NativeSourceClaudeCodeCompaction}
var AllNativePiMessageRoles = []NativePiMessageRole{NativePiMessageRoleToolResult}
var AllOmittedReasons = []OmittedReason{ OmittedReasonTooLarge, OmittedReasonUnsupported, OmittedReasonMissing, OmittedReasonNotPublished, }
AllOmittedReasons is the canonical closed list of image omission reasons.
var AllOperationIssueCodes = []OperationIssueCode{OperationIssueAuth, OperationIssueRemote, OperationIssueContract, OperationIssueDeadline, OperationIssuePersistence, OperationIssueSuperseded}
var AllOutcomes = []SessionOutcome{ OutcomeResolved, OutcomePartial, OutcomeFailed, }
AllOutcomes is the canonical list of all known session outcomes.
var AllOwnerUpdateRequestBehaviours = []OwnerUpdateRequestBehaviour{ OwnerUpdateBehaviourVisibilityAccepted, OwnerUpdateBehaviourVisibilityRefused, OwnerUpdateBehaviourLicenseAccepted, OwnerUpdateBehaviourLicenseClearAccepted, OwnerUpdateBehaviourLicenseRefused, OwnerUpdateBehaviourNullRefused, OwnerUpdateBehaviourUnknownFieldRefused, OwnerUpdateBehaviourOmissionAccepted, OwnerUpdateBehaviourEmptyStringAccepted, OwnerUpdateBehaviourTitleBoundEnforced, }
AllOwnerUpdateRequestBehaviours is the canonical ordered closed set. The suite derives its minimum from this list AND asserts every member is exercised, so adding a behaviour without a row fails rather than silently reducing coverage.
var AllOwnerUpdateSpecProbeKinds = []OwnerUpdateSpecProbeKind{ OwnerUpdateProbeOperationDeclared, OwnerUpdateProbePathParameter, OwnerUpdateProbeBodyIsReference, OwnerUpdateProbeResponseStatuses, OwnerUpdateProbeVisibilityEnum, OwnerUpdateProbeLicenseEnum, OwnerUpdateProbeSuccessHasNoBody, OwnerUpdateProbeBodyProperties, OwnerUpdateProbeBodyIsClosed, OwnerUpdateProbeDescriptionAnchors, OwnerUpdateProbeBodyIsRequired, OwnerUpdateProbePathParameterIsCanonical, OwnerUpdateProbeTitleMaxLength, OwnerUpdateProbeRefusalEnvelopeProperties, }
AllOwnerUpdateSpecProbeKinds is the canonical ordered closed set. The spec test asserts the corpus covers every member, so adding a probe kind without a fixture row fails rather than silently reducing coverage.
var AllPageSizes = []PageSize{PageSize25, PageSize50, PageSize100}
AllPageSizes is the canonical inventory, in ascending order. The TypeScript set and the OpenAPI enum both derive from it.
var AllPublicSourceAnchorKinds = []PublicSourceAnchorKind{PublicSourceAnchorGeneral, PublicSourceAnchorBefore, PublicSourceAnchorThrough}
var AllPublishOperationKinds = []PublishOperationKind{PublishOperationPreserve, PublishOperationReplace, PublishOperationAppend}
var AllPullAssociationMetadataStates = []PullAssociationMetadataState{PullAssociationMetadataObserved, PullAssociationMetadataStale, PullAssociationMetadataUnknown, PullAssociationMetadataInvalidated}
var AllReadAttributionStates = []ReadAttributionState{ ReadAttributionComplete, ReadAttributionPartial, ReadAttributionUnavailable, }
AllReadAttributionStates is the canonical list of read attribution states.
var AllReadStateGrades = []ReadStateGrade{ ReadStateGradeNone, ReadStateGradeViewed, ReadStateGradeReviewed, ReadStateGradeReviewedInDetail, }
AllReadStateGrades is the canonical ordered list of read-state grades, ascending: none < viewed < reviewed < reviewed_in_detail.
var AllRelationshipTargetStates = []RelationshipTargetState{RelationshipTargetKnown, RelationshipTargetKnownRetained, RelationshipTargetExplicitNone, RelationshipTargetUnknown, RelationshipTargetConflictingCurrentNativeEvidence}
var AllRewriteMethods = []RewriteMethod{ RewriteMethodHash, RewriteMethodPatchID, RewriteMethodAuthorIdentity, RewriteMethodMessageEmbedded, RewriteMethodTemporal, RewriteMethodNone, }
AllRewriteMethods is the canonical list of rewrite resolution methods.
var AllRewriteResolutions = []RewriteResolution{ RewriteResolutionLive, RewriteResolutionRewritten, RewriteResolutionUnresolved, }
AllRewriteResolutions is the canonical list of rewrite resolutions.
var AllRoles = []Role{ RoleUser, RoleAssistant, RoleTool, RoleSystem, }
AllRoles is the canonical list of all known roles.
var AllScaleKinds = []ScaleKind{ ScaleNominal, ScaleOrdinal, ScaleContinuous, }
AllScaleKinds is the canonical list of all known scale kinds.
var AllScryVerdicts = []ScryVerdict{ScryVerdictChecked, ScryVerdictUnchecked}
AllScryVerdicts is the closed verdict set. A transcript is flagged when its verdict is checked and at least one turn position is listed; "flagged" is never a verdict.
var AllSegmentedReadVersions = []string{SegmentedReadAPIVersion, SegmentedReadMinVersion}
AllSegmentedReadVersions is the exact set of declared protocol versions. Compare tokens by membership, never by inferred semantic-version ordering.
var AllSessionListItemKinds = []SessionListItemKind{SessionListItemTranscript, SessionListItemContextContainer}
var AllSessionOriginBehaviours = []SessionOriginBehaviour{ SessionOriginBehaviourMenuMemberAccepted, SessionOriginBehaviourAbsentDeclarationAccepted, SessionOriginBehaviourOutOfMenuRejected, SessionOriginBehaviourDetailRoundTrip, SessionOriginBehaviourSummaryRoundTrip, SessionOriginBehaviourAbsentFieldOmitted, SessionOriginBehaviourPublishedSchemaRefusal, }
AllSessionOriginBehaviours is the canonical ordered closed set. The corpus declares the same set, and the loader compares the two by MEMBERSHIP, so adding a behaviour without a row fails rather than silently reducing coverage.
var AllSessionOriginPayloadKinds = []SessionOriginPayloadKind{ SessionOriginPayloadDetail, SessionOriginPayloadSummary, }
AllSessionOriginPayloadKinds is the canonical ordered closed set.
var AllSessionOrigins = []SessionOrigin{ SessionOriginUser, SessionOriginAgent, SessionOriginUnknown, }
AllSessionOrigins is the canonical menu of declared session origins.
var AllSessionPurposes = []SessionPurpose{SessionPurposeInteraction, SessionPurposeDelegatedWork, SessionPurposeHelperReview, SessionPurposeUnknown}
var AllSessionRelationshipKinds = []SessionRelationshipKind{SessionRelationshipStartedBy, SessionRelationshipContextFrom}
var AllSessionSummariesByIDAnchors = []SessionSummariesByIDAnchor{ SessionSummariesByIDAnchorResolvesLinks, SessionSummariesByIDAnchorNoOriginScope, SessionSummariesByIDAnchorNoSelectionScope, SessionSummariesByIDAnchorUnknownIDOmitted, }
AllSessionSummariesByIDAnchors is the canonical ordered closed set. The corpus declares one row per member and the loader compares the two by membership.
var AllSessionTeammateEvidences = []SessionTeammateEvidence{SessionTeammateEvidenceNativeDynamicWorkflow}
AllSessionTeammateEvidences is the canonical teammate evidence menu.
var AllSourceFormats = []SourceFormat{ SourceFormatJSONL, SourceFormatJSON, }
AllSourceFormats is the canonical list of transcript source formats.
var AllStopReasons = []StopReason{ StopReasonEndTurn, StopReasonCancelled, StopReasonMaxTokens, StopReasonMaxTurnRequests, StopReasonRefusal, }
AllStopReasons is the canonical list of all known stop reasons.
var AllSyncHoldReasons = []SyncHoldReason{SyncHoldReasonMetricsMissing, SyncHoldReasonMetadataMissing}
AllSyncHoldReasons is the canonical hold reason menu.
var AllSyncLoginStatuses = []SyncLoginStatus{SyncLoginPending, SyncLoginAlreadyAuthenticated}
AllSyncLoginStatuses is the canonical sign-in result menu.
var AllSyncLogoutStatuses = []SyncLogoutStatus{SyncLogoutLoggedOut, SyncLogoutAlreadyLoggedOut}
AllSyncLogoutStatuses is the canonical sign-out result menu.
var AllSyncPushSessionStatuses = []SyncPushSessionStatus{SyncPushSessionNew, SyncPushSessionUpdated, SyncPushSessionSkipped, SyncPushSessionError, SyncPushSessionHeld}
AllSyncPushSessionStatuses is the canonical per-session push outcome menu.
var AllSyncPushStepOutcomes = []SyncPushStepOutcome{SyncPushStepSucceeded, SyncPushStepPendingApproval, SyncPushStepSkipped, SyncPushStepFailed, SyncPushStepNotAttempted}
AllSyncPushStepOutcomes is the canonical push step outcome menu.
var AllSyncPushSteps = []SyncPushStep{SyncPushStepContent, SyncPushStepAddCollective, SyncPushStepRemoveCollective}
AllSyncPushSteps is the canonical push step menu.
var AllSyncStatuses = []SyncStatus{SyncStatusNew, SyncStatusUpdated, SyncStatusSynced, SyncStatusHeld}
AllSyncStatuses is the canonical sync chooser status menu.
var AllTargetKinds = []TargetKind{ TargetSession, TargetEntry, TargetAnnotation, TargetProject, TargetFileVersion, TargetAssociation, }
AllTargetKinds is the canonical list of all known target kinds.
var AllThinkingLevels = []ThinkingLevel{ ThinkingLevelOff, ThinkingLevelMinimal, ThinkingLevelLow, ThinkingLevelMedium, ThinkingLevelHigh, ThinkingLevelXHigh, ThinkingLevelMax, ThinkingLevelUltra, ThinkingLevelUltracode, }
AllThinkingLevels lists the nine levels in canonical order, off..ultracode.
var AllToolCallKinds = []ToolCallKind{ ToolCallKindRead, ToolCallKindEdit, ToolCallKindDelete, ToolCallKindMove, ToolCallKindSearch, ToolCallKindExecute, ToolCallKindThink, ToolCallKindFetch, ToolCallKindOther, }
AllToolCallKinds is the canonical list of all known tool call kinds.
var AllTranscriptCaptureRefusals = []TranscriptCaptureRefusal{ TranscriptCaptureDocumentInvalid, TranscriptCaptureDocumentNotObject, TranscriptCaptureDocumentDuplicateMember, TranscriptCaptureDocumentEnvelope, TranscriptCaptureTurnsNotArray, TranscriptCaptureTurnUnicodeEscape, TranscriptCaptureTurnDuplicateMember, TranscriptCaptureTurnNotObject, TranscriptCaptureTurnTypeMismatch, }
AllTranscriptCaptureRefusals is the complete capture refusal set.
var AllTranscriptContentHashWords = []TranscriptContentHashWord{ TranscriptContentHashPending, TranscriptContentHashKnown, }
var AllTranscriptDownloadKinds = []TranscriptDownloadKind{ TranscriptDownloadStrict, TranscriptDownloadLegacy, TranscriptDownloadRecords, }
var AllTranscriptEntryReferenceKinds = []TranscriptEntryReferenceKind{ TranscriptEntryReferenceSource, TranscriptEntryReferenceToolCall, TranscriptEntryReferenceToolResult, }
var AllTranscriptNativePresences = []TranscriptNativePresence{ TranscriptNativeAbsent, TranscriptNativePresent, TranscriptNativeWithheld, }
var AllTranscriptReadTransportKinds = []TranscriptReadTransportKind{ TranscriptReadTransportLocalSession, TranscriptReadTransportVillageTranscript, }
var AllTranscriptReadValidations = []TranscriptReadValidation{ TranscriptReadPublishedStrict, TranscriptReadServedLegacy, TranscriptReadMigrated, }
var AllTranscriptRecordedIndexStates = []TranscriptRecordedIndexState{ TranscriptRecordedIndexPresent, TranscriptRecordedIndexAbsent, TranscriptRecordedIndexInvalid, }
AllTranscriptRecordedIndexStates is the complete recorded-index state set.
var AllTranscriptRetainedOwnerVisibilities = []TranscriptRetainedOwnerVisibility{ TranscriptRetainedOwnerVisible, TranscriptRetainedOwnerWithheld, }
var AllTranscriptRetainedStates = []TranscriptRetainedState{TranscriptRetainedAbsent, TranscriptRetainedDeferred}
var AllTranscriptSegmentPartitionKinds = []TranscriptSegmentPartitionKind{ TranscriptPartitionMain, TranscriptPartitionHistory, }
var AllTranscriptUpdateLicenses = func() []TranscriptUpdateLicense { values := make([]TranscriptUpdateLicense, 0, len(AllLicenses)+1) values = append(values, TranscriptUpdateLicenseClear) for _, license := range AllLicenses { values = append(values, TranscriptUpdateLicense(license)) } return values }()
AllTranscriptUpdateLicenses is the canonical menu of values this operation accepts: the clear sentinel first, then every canonical menu license in order. It is DERIVED from AllLicenses rather than restated, so widening the license menu widens this operation with no second edit to forget.
var AllTranscriptUpdateVisibilities = []TranscriptUpdateVisibility{ TranscriptUpdateVisibilityPrivate, TranscriptUpdateVisibilityPublic, }
AllTranscriptUpdateVisibilities is the canonical menu of visibility values this operation accepts, in declaration order. The generated schema enum is derived from it so a widening is a one-line edit that cannot drift from the documented contract.
var AllTranscriptUsagePresences = []TranscriptUsagePresence{ TranscriptUsagePresent, TranscriptUsageEmpty, TranscriptUsageUnknown, }
var AllTranscriptViewerProjections = []TranscriptViewerProjection{ TranscriptViewerProjectionAnonymous, TranscriptViewerProjectionAuthenticated, }
var AllTurnPartTypes = []TurnPartType{TurnPartTypeText, TurnPartTypeImage}
AllTurnPartTypes is the canonical closed list of turn content part kinds.
var AllTypeOrigins = []TypeOrigin{ OriginSystem, OriginUser, OriginGroup, }
AllTypeOrigins is the canonical list of all known type origins.
var AllUsageCompleteness = []UsageCompleteness{UsageComplete, UsagePartial, UsageUnknown}
var AllUsageScopes = []UsageScope{UsageScopeAssistant, UsageScopeTool, UsageScopeSummary}
var AllValueDomainKinds = []ValueDomainKind{ DomainEnumerated, DomainDescribed, }
AllValueDomainKinds is the canonical list of all known value domain kinds.
var AllVillageAssignableCollectiveRoles = AllVillageAssignableGroupRoles
var AllVillageAssignableGroupRoles = []VillageAssignableGroupRole{ VillageAssignableGroupRoleContributor, VillageAssignableGroupRoleMember, }
var AllVillageAttestationTypes = []VillageAttestationType{VillageAttestationUsedInTraining, VillageAttestationReferenced, VillageAttestationEvaluated, VillageAttestationDeployed}
var AllVillageCollectiveAcceptanceModes = AllVillageGroupAcceptanceModes
var AllVillageCollectiveDataAccessPolicies = AllVillageGroupDataAccessPolicies
var AllVillageCollectiveRoles = AllVillageGroupRoles
var AllVillageCollectiveViewerRoles = AllVillageGroupViewerRoles
var AllVillageContributableViews = []VillageContributableView{ VillageContributableViewGrouped, VillageContributableViewPaged, VillageContributableViewSnapshot, }
var AllVillageContributionErrorCodes = []VillageContributionErrorCode{ VillageContributionErrorMoved, VillageContributionErrorMissing, VillageContributionErrorPrivateUnapproved, VillageContributionErrorConflict, VillageContributionErrorPolicy, VillageContributionErrorMembership, VillageContributionErrorStaleSelection, VillageContributionErrorSnapshotTimeout, VillageContributionErrorSnapshotBusy, VillageContributionErrorSnapshotTooLarge, }
var AllVillageContributionStatuses = []VillageContributionStatus{ VillageContributionStatusApproved, VillageContributionStatusPending, }
var AllVillageGroupAcceptanceModes = []VillageGroupAcceptanceMode{ VillageGroupAcceptanceOpen, VillageGroupAcceptanceVerifiedOnly, VillageGroupAcceptanceCurated, }
var AllVillageGroupDataAccessPolicies = []VillageGroupDataAccess{ VillageGroupDataAccessMembersOnly, VillageGroupDataAccessContributors, VillageGroupDataAccessPublic, }
var AllVillageGroupRoles = []VillageGroupRole{ VillageGroupRoleOwner, VillageGroupRoleMember, VillageGroupRoleContributor, VillageGroupRolePending, }
var AllVillageGroupViewerRoles = []VillageGroupViewerRole{ VillageGroupViewerRoleNone, VillageGroupViewerRoleOwner, VillageGroupViewerRoleMember, VillageGroupViewerRoleContributor, VillageGroupViewerRolePending, }
var AllVillageProjectNameSources = []VillageProjectNameSource{ VillageProjectNameSourceOverride, VillageProjectNameSourceConsented, VillageProjectNameSourceRemote, VillageProjectNameSourcePath, VillageProjectNameSourcePrivacy, }
var AllVillagePromptsCheckModes = []VillagePromptsCheckMode{VillagePromptsCheckInformational, VillagePromptsCheckRequired}
var AllVillagePublicOwnerKinds = []VillagePublicOwnerKind{ VillagePublicOwnerProfile, VillagePublicOwnerAnonymous, }
AllVillagePublicOwnerKinds is the closed set a producer may emit.
var AllVillagePullRequestAttachmentStates = []VillagePullRequestAttachmentState{ VillagePullRequestAttachmentRequested, VillagePullRequestAttachmentWaiting, VillagePullRequestAttachmentPreview, VillagePullRequestAttachmentAttached, VillagePullRequestAttachmentDetached, }
var AllVillageReviewDecisions = []VillageReviewDecision{ VillageReviewDecisionApproved, VillageReviewDecisionRejected, }
VillageShareEventActorNone, VillageShareEventActorOwner, VillageShareEventActorCollective, VillageShareEventActorModerator, }
VillageShareStatusPending, VillageShareStatusApproved, VillageShareStatusRejected, VillageShareStatusRetracted, VillageShareStatusRevoked, }
var AllVillageTranscriptDeletionPolicies = []VillageTranscriptDeletionPolicy{ VillageTranscriptDeletionUserChoice, VillageTranscriptDeletionMandatory, }
var AllVillageTranscriptVisibilities = []VillageTranscriptVisibility{ VillageTranscriptVisibilityPrivate, VillageTranscriptVisibilityShared, VillageTranscriptVisibilityPublic, }
var AllVisibilities = []Visibility{ VisibilityPrivate, VisibilityGroup, VisibilityPublic, }
AllVisibilities is the canonical list of all known visibility levels.
var AllVisibilityIntents = []VisibilityIntent{VisibilityIntentPrivate, VisibilityIntentPublic}
var AnnotationsYAML []byte
AnnotationsYAML contains the raw YAML content for annotation test fixtures.
var AssociationAnnotationIngressYAML []byte
AssociationAnnotationIngressYAML contains the cross-language association publication and annotation ingress validation corpus.
var ContractCorpusFS embed.FS
ContractCorpusFS is the push/pull back-compat golden corpus tree (testdata/contract/**): the current contract shape plus the retained legacy shapes (legacy-metadata-field / legacy-provider-keyed / legacy-raw-jsonl). Exported as an embed.FS so consumers (peasant internal/push back-compat round-trip tests) enumerate and read the corpus through the contract leaf rather than a cross-module filesystem path. Walk it from the "testdata/contract" root (e.g. fs.ReadDir(schema.ContractCorpusFS, "testdata/contract")).
var ErrCycleDetected = errors.New("annotation type dependency cycle detected")
ErrCycleDetected is returned when adding a dependency would create a cycle in the annotation_type_deps graph (V14: depth limit 20).
var ErrInvalidValue = errors.New("invalid annotation value")
ErrInvalidValue is returned when a value is not permissible for an annotation domain. Callers should wrap this error with fmt.Errorf("%w: ...", ErrInvalidValue) for context.
var ErrPositionedSegmentNotEncodable = errors.New("a positioned segment must be written by schema.MarshalPositionedSegment")
ErrPositionedSegmentNotEncodable identifies an attempt to encode a segment through encoding/json, which would rewrite its turns' preserved bytes.
var ErrTranscriptSegmentRowNotEncodable = errors.New("a positioned segment row must be written by schema.writeTranscriptSegmentRow")
ErrTranscriptSegmentRowNotEncodable identifies an attempt to encode a row outside its segment, which would rewrite the row's preserved turn bytes.
var ErrTranscriptUncookable = errors.New("transcript cooking refused this stored partition")
ErrTranscriptUncookable identifies a partition the whole-document reader's evidence gate or duplicate comparison would also refuse.
var ErrTranscriptWindowAnchorUnresolvable = errors.New("the transcript has no user turn with a comparable recorded index")
ErrTranscriptWindowAnchorUnresolvable reports that user rows exist but none has a recorded index that an anchored request can compare.
var ErrTranscriptWindowEmptyPartition = errors.New("the transcript partition contains no served rows")
ErrTranscriptWindowEmptyPartition reports that a partition has no rows to anchor.
var ErrTranscriptWindowNoUserTurn = errors.New("the transcript holds no user turn to centre a window on")
ErrTranscriptWindowNoUserTurn reports that the turns hold no user turn to centre a window on. ResolveTranscriptWindow wraps it with the session and the requested anchor; match it with errors.Is.
var ErrTypeNotFound = errors.New("annotation type not found")
ErrTypeNotFound is returned when a requested annotation type does not exist in the registry.
var EvalSchemaJSON []byte
EvalSchemaJSON is the vendored EEE (eval) JSON Schema (external/eee/eval.schema.json) — the contract that peasant's `export` surface validates its evaluation payloads against. Exported so consumers (peasant internal/export conformance + drift tests) read the schema through the contract leaf instead of a cross-module filesystem path. Provenance and re-vendoring policy: external/eee/PROVENANCE.md.
var NativeMetadataKindHarness = map[NativeMetadataKind]Harness{ NativeMetadataPiCustomData: HarnessPi, NativeMetadataPiCustomMessageDetails: HarnessPi, NativeMetadataPiToolResultDetails: HarnessPi, NativeMetadataPiCompactionDetails: HarnessPi, NativeMetadataPiBranchSummaryDetails: HarnessPi, NativeMetadataClaudeCodeCompactionDetails: HarnessClaudeCode, }
NativeMetadataKindHarness maps each published NativeMetadataKind to the one Harness that may emit it.
var OwnerUpdateYAML []byte
OwnerUpdateYAML contains the owner transcript update corpus: request validation verdicts, exact tri-state license encodings, and the generated Village document probes for the declared operation.
var PublishVerdictsYAML []byte
PublishVerdictsYAML contains the shared publish schema verdict corpus.
var PullManifestExampleJSON []byte
PullManifestExampleJSON is the golden one-complete-PullManifest example (round-trip shape-pin source).
var PullRefsYAML []byte
PullRefsYAML contains the raw YAML content for transcript-reference parse fixtures (internal/pull.ParseTranscriptRef).
var PullStatusesYAML []byte
PullStatusesYAML contains the raw YAML content for PullStatus<->wire mappings.
var QualitySessionsYAML []byte
QualitySessionsYAML contains the raw YAML content for mock quality sessions.
var ReadStateGradeRegistrySeedPermissibleValues = []string{ string(ReadStateGradeViewed), string(ReadStateGradeReviewed), string(ReadStateGradeReviewedInDetail), }
ReadStateGradeRegistrySeedPermissibleValues is AllReadStateGrades with the unstated zero grade "none" removed, in the same ascending order: the registered set the peasant-side read-state registry seed's PermissibleValues must byte-equal. TestReadStateGradeRegistrySeedCrossCheck pins this module's half of the cross-check; the peasant-side registry seed test pins the other half against this exported value.
var RedactionExamples = []RedactionExample{ { Name: "aws_access_key", RuleID: "aws_access_key", Category: "secrets", Level: RedactionLevelMinimal, OriginalText: "AKIAIOSFODNN7EXAMPLE", RedactedReplacement: "<AWS_ACCESS_KEY>", Confidence: 98, LineNumber: 142, Description: "AWS access key ID (pkg/redact rule: aws_access_key)", }, { Name: "email_address", RuleID: "email", Category: "pii", Level: RedactionLevelStandard, OriginalText: "vitor.eduardo@company.com", RedactedReplacement: "<EMAIL>", Confidence: 94, LineNumber: 587, Description: "Email address (pkg/redact rule: email)", }, { Name: "home_directory", RuleID: "unix_home_path", Category: "paths", Level: RedactionLevelMinimal, OriginalText: "/Users/acme-dev/Projects/internal-api", RedactedReplacement: "/Users/<USER>/Projects/internal-api", Confidence: 72, LineNumber: 23, Description: "Unix home directory path with username (pkg/redact rule: unix_home_path)", }, { Name: "github_token", RuleID: "github_pat", Category: "secrets", Level: RedactionLevelMinimal, OriginalText: "ghp_xK9mN2pL4qR7sT8vW1yZ3aB5cD6eF0gH12ab", RedactedReplacement: "<GITHUB_PAT>", Confidence: 96, LineNumber: 310, Description: "GitHub personal access token (pkg/redact rule: github_pat)", }, { Name: "git_remote_url", RuleID: "git_remote_https", Category: "project", Level: RedactionLevelMaximum, OriginalText: "https://github.com/acme-corp/internal-api", RedactedReplacement: "<PROJECT_URL>", Confidence: 61, LineNumber: 445, Description: "Git remote URL exposing project identity (pkg/redact rule: git_remote_https)", }, { Name: "phone_number", RuleID: "phone_us", Category: "pii", Level: RedactionLevelStandard, OriginalText: "+1-555-867-5309", RedactedReplacement: "<PHONE>", Confidence: 89, LineNumber: 712, Description: "US phone number (pkg/redact rule: phone_us)", }, { Name: "database_connection", RuleID: "basic_auth_uri", Category: "secrets", Level: RedactionLevelMinimal, OriginalText: "postgresql://admin:s3cretPass99@db.prod.internal:5432/maindb", RedactedReplacement: "postgresql://<BASIC_AUTH_URI>@db.prod.internal:5432/maindb", Confidence: 99, LineNumber: 18, Description: "URL with embedded basic-auth credentials (pkg/redact rule: basic_auth_uri)", }, { Name: "workspace_path", RuleID: "unix_home_path", Category: "paths", Level: RedactionLevelMinimal, OriginalText: "/home/deploy/apps/acme-billing-service", RedactedReplacement: "/home/<USER>/apps/acme-billing-service", Confidence: 65, LineNumber: 891, Description: "Unix home directory path with username (pkg/redact rule: unix_home_path)", }, { Name: "ip_address", RuleID: "ip_address", Category: "pii", Level: RedactionLevelStandard, OriginalText: "192.168.1.42", RedactedReplacement: "<IP_ADDRESS>", Confidence: 85, LineNumber: 156, Description: "IPv4 address (pkg/redact rule: ip_address)", }, { Name: "slack_webhook", RuleID: "slack_webhook_url", Category: "secrets", Level: RedactionLevelMinimal, OriginalText: "https://hooks.slack.com/services/T024BE7LD/B0DAF2RC3/bJTqg8NS27FYm2pQL0jAiE", RedactedReplacement: "<SLACK_WEBHOOK_URL>", Confidence: 58, LineNumber: 234, Description: "Slack incoming webhook URL (pkg/redact rule: slack_webhook_url)", }, { Name: "stripe_secret", RuleID: "stripe_key", Category: "secrets", Level: RedactionLevelMinimal, OriginalText: "sk_live_4eC39HqLyjWDarjtT1zdp7dc", RedactedReplacement: "<STRIPE_KEY>", Confidence: 92, LineNumber: 67, Description: "Stripe API secret key (pkg/redact rule: stripe_key)", }, }
RedactionExamples is the canonical redaction example corpus — the CURRENT session-detail mock cases only (NOT the full pkg/redact corpus). Every RedactedReplacement here is the verbatim output of the real pkg/redact engine run on OriginalText at Level; the peasant conformance test (pkg/redact/redactconform_test.go) enforces that and fails on any drift.
var RedactionsYAML []byte
RedactionsYAML contains the GENERATED redaction example corpus (testdata/session-detail/redactions.yaml). It is produced by `go run ./cmd/schema-gen` from RedactionExamples (see redactions.go) and is the single source of truth consumed by peasant's behavioural conformance test (pkg/redact) and the web mock codegen. Regenerate + commit on any change to RedactionExamples; the leaf freshness gate enforces byte-identity.
var SessionGraphProvenanceYAML []byte
SessionGraphProvenanceYAML contains primitive graph validation cases.
var SessionsYAML []byte
SessionsYAML contains the raw YAML content for mock sessions.
var TimelineYAML []byte
TimelineYAML contains project timeline validation cases.
var TranscriptSessionHeaderPresenceMembers = []string{
transcriptWireID, transcriptWireHarness, transcriptWireStartTime, transcriptWireEndTime, transcriptWireDurationMins,
transcriptWireTotalTokens, transcriptWireTokensIn, transcriptWireTokensOut, transcriptWireTurnCount, transcriptWireToolCallCount,
}
TranscriptSessionHeaderPresenceMembers names the fields whose absence must remain distinct from an explicitly supplied zero value.
var TranscriptSessionHeaderRepositoryMembers = []string{
transcriptWireProject, transcriptWireWorkingDirectory, transcriptWireGitBranch, transcriptWireGitRemote,
}
TranscriptSessionHeaderRepositoryMembers is the exact set of header fields removed by the repository-withholding projection.
Functions ¶
func AnnotationPushRequestSchemaJSON ¶
func AnnotationPushRequestSchemaJSON() []byte
AnnotationPushRequestSchemaJSON returns the standalone JSON Schema bytes for the current Village annotation-push operation. The generator extracts it from the same operation schema Village serves, so ValidateAnnotationPushRequest validates the documented wire shape before invoking the typed request validator for relational entry-target rules.
func BuildAuthoritativePublicationProjections ¶ added in v0.19.0
func BuildAuthoritativePublicationProjections(detail SessionDetailPayload, metadata UnifiedMetadata, schemaVersion int, projectedMainCount bool) (AuthoritativeSessionIdentity, AuthoritativeSessionStats, []AuthoritativeSubagentRef, error)
BuildAuthoritativePublicationProjections derives the publication identity, statistics, and legacy child projection from one durable detail payload. The metadata argument is a mirror check, not a second authority. projectedMainCount must be true only when the caller positively identified a projected-format generation whose TurnCount is defined as emitted main records. Legacy callers pass false so their established metadata and export turn totals can remain different. InputSubmissionCount presence does not identify the projection format.
func CollectiveFetchHTTPStatus ¶ added in v0.31.0
func CollectiveFetchHTTPStatus(report CollectiveFetchReport) int
CollectiveFetchHTTPStatus chooses the transport status without dropping any domain effects. Validate the report first; malformed reports fail closed.
func ComputeAnnotationHash ¶
func ComputeAnnotationHash( annotationTypeID string, annotatorID string, value string, sessionID *string, entryIndex *int, endIndex *int, confidence *float64, reason *string, provenance *Provenance, ) string
ComputeAnnotationHash computes a SHA3-256 content hash over the core fields of an annotation for deduplication purposes. The hash is deterministic: the same annotation content always produces the same hex string.
Parameters mirror the annotation's content-bearing fields. Target-specific fields (sessionID, entryIndex, endIndex) are optional and contribute to the hash only when set (ensuring session-level and entry-level annotations of the same type/value/annotator produce different hashes).
func ComputeManifestDigest ¶
ComputeManifestDigest computes a deterministic SHA3-256 digest over a SET of content-hashes. The result depends only on the underlying set, not on input order or duplicate multiplicity: the hashes are sorted and de-duplicated before hashing. Two callers observing the same logical set always produce the same digest, which is what makes the no-op short-circuit correct across machines.
The empty set hashes to a fixed, well-defined value (the digest of no input), so two empty manifests compare equal.
func ComputeMetadataHash ¶
func ComputeMetadataHash(meta *UnifiedMetadata) string
ComputeMetadataHash computes the SHA3-256 hash of metadata fields, excluding ContentHash, MetadataHash, and Redaction to avoid circular dependency. Changing any content-bearing metadata field produces a different hash.
func ComputeTranscriptHash ¶
ComputeTranscriptHash computes the SHA3-256 hash of raw transcript bytes. Used to detect content changes for incremental re-processing and stale redaction detection.
func ConstructSessionGraphRef ¶ added in v0.19.0
func ConstructSessionGraphRef(i SessionGraphRefInput) (string, error)
func DecodeNativeMetadataDataRaw ¶ added in v0.16.0
func DecodeNativeMetadataDataRaw(raw []byte) (json.RawMessage, error)
func HarnessDisplayName ¶
HarnessDisplayName returns the human-readable name for a harness.
func HarnessJSONSchema ¶
func HarnessJSONSchema() jsonschema.Schema
HarnessJSONSchema returns the JSON Schema for the Harness type. This is a standalone function because Harness is a type alias for bestiary.Harness, and Go does not allow methods on imported types.
func IsClaudeBuiltinCommand ¶
IsClaudeBuiltinCommand reports whether name (with any leading slash stripped) matches a known Claude Code built-in command. Skill names like "aura:epoch" or "user-defined-command" will return false.
Examples:
IsClaudeBuiltinCommand("exit") → true
IsClaudeBuiltinCommand("/exit") → true
IsClaudeBuiltinCommand("aura:epoch") → false
func IsConversationTurn ¶ added in v0.51.0
IsConversationTurn reports whether a folded turn is a conversation turn: it is a top-level entry (depth 0) and its (role, entryType) is one of (user, text), (user, image), (assistant, text) or (assistant, image). It is the one definition behind every conversationTurnCount and ConversationTurnSpan. A role or entry type added later does not count until it is listed. It never reads content: a blank text entry and a harness notice typed as user text both count.
func LicenseMenu ¶
func LicenseMenu() string
LicenseMenu returns the known license IDs as a comma-separated string, derived from AllLicenses so help text and error messages can't drift from the canonical menu when a license is added.
func MarshalPositionedSegment ¶ added in v0.54.0
func MarshalPositionedSegment(seg PositionedSegment) ([]byte, error)
MarshalPositionedSegment validates and writes one complete response. The turn objects are written directly, retaining their original served bytes. The caller writes the returned bytes as the entire JSON response body.
func NewJSONSchemaCompiler ¶ added in v0.19.0
func NewJSONSchemaCompiler() *jsonschema.Compiler
NewJSONSchemaCompiler returns the canonical compiler for schema-owned validation assets. Custom wire formats are assertions, not annotations, so callers cannot accidentally compile a schema that silently ignores them.
func PublishRequestSchemaJSON ¶
func PublishRequestSchemaJSON() []byte
PublishRequestSchemaJSON returns the standalone JSON-Schema (draft 2020-12) bytes for the PublishRequest wire format at the CURRENT VillageAPIVersion — the schema extracted from the Village API spec by openapi.BuildPublishRequestSchema and committed under generated/publish-request-<VillageAPIVersion>.schema.json.
This is the SINGLE BYTE-SOURCE the publish-enforce path validates against: schema.ValidatePublishRequest (root publish_validate.go) compiles exactly these bytes, and village's publish handler enforces through it rather than vendoring its own schema copy. Routing both the documented spec and the enforced schema through this one accessor means they can never drift (it retired the hand-maintained validate/schema.json, which had diverged from the generated artifact, and — rc2 #118 — folded the standalone `validate` subpackage into the root schema package).
It is version-aware: the filename is derived from VillageAPIVersion, never a literal, so a version bump in versions.go re-points it in lockstep. The bytes are embedded at compile time, so a miss here is a build/generation bug, not a runtime condition — it panics with an actionable message. The codegen-freshness gate and TestPublishRequestSchemaJSON_MatchesGenerated keep this unreachable in a healthy tree.
func ReconcileVillageContributionAttempt ¶ added in v0.31.0
func ReconcileVillageContributionAttempt(saved *LocalRemoteContributionAttempt, incoming LocalRemoteContributionAttempt) (LocalRemoteContributionAttempt, VillageContributionAttemptReconciliation, error)
ReconcileVillageContributionAttempt reconciles one identity against the latest retained value. Callers must select the authenticated storage scope first and call this under their write transaction, not against an earlier network-read snapshot. A new ordinal is a separate identity and must be passed with nil saved evidence; gaps do not imply missing attempts.
On conflict the saved evidence is returned unchanged along with an error. The result never aliases either input's decision timestamp. FirstSeenAt belongs to local evidence and is preserved on every existing-identity reconciliation.
func RemoteLabel ¶ added in v0.1.2
RemoteLabel formats a git remote as the canonical "host:owner/repo" display label, using the FULL host for every host so self-hosted and enterprise forges are distinguishable (github.com:peasant-labs/village, gitlab.example.corp:team/repo). There is no host allowlist and no short-prefix table: a host that is not a well-known forge keeps its full hostname rather than failing closed.
The port, when a remote carries one, is DROPPED: "gitlab.example.corp:2222" and "gitlab.example.corp:2200" both render as "gitlab.example.corp". This is a deliberate collision, not an oversight — two forges reachable at the same host on different ports are indistinguishable in the rendered label by design. An IPv6 literal host keeps its brackets with the port removed from inside them ("[::1]:2222" -> "[::1]"); the bracket delimiters are never mistaken for a port separator. Port stripping applies only to a syntactic host component (the URL-scheme and bare-normalized forms); the SCP-like form's colon is a path separator, never a port, so nothing there is stripped — see the port-handling note below.
RemoteLabel accepts the normalized bare form ("host/owner/repo") and, defensively, an HTTPS or SSH remote URL that was not pre-normalized ("https://host/owner/repo[.git]", "git@host:owner/repo[.git]", "ssh://git@host/owner/repo[.git]"). Any userinfo embedded in the remote (user:pass@ or user:TOKEN@ — e.g. a personal access token baked into a CI/CD or git-credential-store remote) is stripped before the host is extracted, so a credential can never reach a rendered label. A trailing ".git" is dropped.
ok is false when remote is empty or does not contain a recognizable host + path pair; the caller MUST fall back to another display tier in that case.
The signature is deliberately two-valued: there is no RemoteLabelSource discriminator, because no consumer of this rule needs one.
func RunPublishVerdicts ¶
RunPublishVerdicts drives a publish-body validator over the ENTIRE shared publish-verdict corpus (testdata/publish/verdicts.yaml), in two passes — first the Acceptances() (schema_accepts:true), then the Rejections() (schema_accepts:false) — asserting each row's expectation with ASSERT-WHERE-PRESENT semantics (FINDING-2a):
- an accepted row MUST validate with no error;
- a rejected row MUST error;
- WHERE a rejected row pins error_contains, the validator message MUST contain that exact (minimal/stable) substring — but rows WITHOUT error_contains are NOT required to carry one (no false-fail on the ~half the corpus that pins only error_category); and
- EVERY rejected row MUST carry a non-empty error_category (no vacuous reject).
It is the one-call, reusable form of the accept/reject loop every corpus consumer would otherwise open-code, so the corpus stays the SINGLE source of publish-validation cases. Pass the validator under test — e.g. schema.RunPublishVerdicts(t, schema.ValidatePublishRequest) for the root client validator, or a compiled-schema closure for the extracted-schema side.
ERROR-STRING BREADCRUMB (FINDING-2b): the pinned error_contains substrings are coupled to the message text of github.com/santhosh-tekuri/jsonschema/v5, pinned at v5.3.1 (see go.mod). They are kept MINIMAL/stable on purpose — e.g. "value must be one of", "missing properties: 'model'"/'harness'", "does not match pattern". If a future jsonschema/v5 bump changes the wording, the error_contains assertions here (and TestPublishVerdicts_ErrorContainsPinnedStrings) fail loudly so the drift is diagnosable at the dep, not silently tolerated.
NOTE on placement: this helper takes *testing.T, so it necessarily imports "testing". It is isolated in this dedicated file (not the production-logic files) and is consumed only by _test packages (publish_validate_test, openapi); production code never calls it.
func ScanRawJSONDocument ¶ added in v0.16.0
func ScanRawJSONDocument(raw []byte, p RawJSONPathPolicy) error
func SegmentedReadGenerations ¶ added in v0.54.0
func SegmentedReadGenerations() []int
SegmentedReadGenerations returns the supported selectors in declaration order. The returned slice is independent of the protocol's generation table.
func SegmentedReadMinSpecJSON ¶ added in v0.54.0
func SegmentedReadMinSpecJSON() []byte
SegmentedReadMinSpecJSON returns the oldest still-served read document.
func SegmentedReadProtocolVersion ¶ added in v0.54.0
SegmentedReadProtocolVersion resolves the integer generation to an exact protocol version. Unknown generations are refused by returning false.
func SegmentedReadSpecJSON ¶ added in v0.54.0
func SegmentedReadSpecJSON() []byte
SegmentedReadSpecJSON returns the current frozen segmented read document.
func TranscriptContentStrict ¶ added in v0.54.0
func TranscriptContentStrict(detail json.RawMessage) bool
TranscriptContentStrict reports the in-band strict core of the content boundary. It reads the selected served detail, not an outer envelope or a trusted caller's harness attestation.
func TranscriptHeaderETag ¶ added in v0.54.0
func TranscriptHeaderETag(in HeaderETagInputs) string
TranscriptHeaderETag returns a quoted HTTP entity tag for the complete header input set. Inputs are encoded as a JSON struct in declaration order, then hashed; no content or input values appear in the result.
func TranscriptJSONStringByteLength ¶ added in v0.51.0
TranscriptJSONStringByteLength is the number of bytes the JSON encoder writes for s, quotes included. It counts the encoder's escaping, HTML-escaping and invalid-UTF-8 replacement exactly as the wire carries them, without encoding; FuzzTranscriptJSONStringByteLength holds it equal to json.Marshal. It is the string term of TranscriptTurnByteLength; a server that bounds served text against the same measure calls it instead of keeping a copy.
func TranscriptRepresentation ¶ added in v0.54.0
func TranscriptRepresentation(in TranscriptRepresentationInputs) string
TranscriptRepresentation derives an opaque generation-scoped identity. It is neither a secret nor an authorization token.
func TranscriptTurnByteLength ¶ added in v0.51.0
func TranscriptTurnByteLength(turn TurnDetail) int
TranscriptTurnByteLength returns the pre-bound JSON byte length of a turn: its content, its text parts, its image metadata, and every tool call's arguments and result, measured with the JSON encoder so escaping is counted as the wire carries it. It is the one measure of the cut and of a segment's byteLength. It is the size before any served-text bound, so an oversized turn stays detectable in the cut after its text has been shortened.
func TranscriptUpdateVisibilityMenu ¶
func TranscriptUpdateVisibilityMenu() string
TranscriptUpdateVisibilityMenu renders the accepted values for help text and error messages, derived from AllTranscriptUpdateVisibilities so a message can never drift from the enum.
func ValidateAnnotationPushRequest ¶
ValidateAnnotationPushRequest validates an annotation-push JSON body against the generated operation schema, then decodes AnnotationPushRequest and calls its typed validator. The schema enforces the documented structural contract; the typed validator additionally enforces relational rules such as entryTarget.endIndex being greater than entryTarget.entryIndex.
func ValidateAnnotationValue ¶
func ValidateAnnotationValue(domain ValueDomain, value string) error
ValidateAnnotationValue checks that value is permissible for the given ValueDomain.
Rules:
- value must not be empty (regardless of domain kind).
- For enumerated domains: value must be in PermissibleValues.
- For described domains: delegates to ValidateDescribedValue (datatype coercion + JSON schema).
Returns nil if valid. Returns an error wrapping ErrInvalidValue otherwise.
func ValidateAttachmentRef ¶ added in v0.47.0
ValidateAttachmentRef accepts a lowercase 64-hex sha256 and rejects every other spelling. The local attachment route answers 400 for a rejection and does not open a file.
func ValidateClaudeCodeCompactionDetails ¶ added in v0.66.0
func ValidateClaudeCodeCompactionDetails(v ClaudeCodeCompactionDetails) error
ValidateClaudeCodeCompactionDetails validates a Claude Code compaction details payload against its closed trigger set and JS-safe nonnegative integer bounds.
func ValidateContentCapabilityAdvertisements ¶ added in v0.1.1
func ValidateContentCapabilityAdvertisements(advertised []ContentCapability) error
ValidateContentCapabilityAdvertisements validates a server-produced list. Discovery readers stay forward-open, but producers must emit only known, unique tokens in canonical lexicographic order.
func ValidateContributionHistoryQuery ¶ added in v0.31.0
func ValidateContributionHistoryQuery(q LocalContributionHistoryQuery, current ContributionTraversalRevision) int
ValidateContributionHistoryQuery returns 400 for malformed requests, 409 for a valid but different selected category token, and 200 otherwise. Tokens never select scope and no overall cache revision participates in this comparison.
func ValidateConversationTurnCount ¶ added in v0.51.0
ValidateConversationTurnCount preserves unknown (nil) separately from measured zero and limits present values to the exact integer range shared with JS.
func ValidateDescribedValue ¶
func ValidateDescribedValue(domain ValueDomain, value string) error
ValidateDescribedValue validates that value is permissible for the given described ValueDomain. It performs two checks in order:
Datatype coercion: the string value must parse as the declared Datatype before schema validation. This catches "3.7" for an integer field before jsonschema sees it.
JSON-schema validation: the ConstraintSpec is compiled (with caching) and the coerced Go value is validated against it.
Returns nil if valid, or an error wrapping ErrInvalidValue when rejected. Returns a non-ErrInvalidValue error when the ConstraintSpec is malformed JSON.
Callers:
- ValidateAnnotationValue (delegated for described domains)
Where: annotation_validate.go ValidateDescribedValue.
func ValidateImagePart ¶ added in v0.45.0
func ValidateImagePart(mode ImagePartMode, part ImagePart) error
ValidateImagePart validates one image part for the given mode. Local requires a recorded media type except for an unsupported source type, a lowercase 64-hex reference whenever the reason is not exempt, a zero size whenever the bytes are omitted, and the exact zero-or-present size rule. Published requires the not_published reason and forbids every local field. Width and height are always optional and nonnegative.
func ValidateInputSubmissionCount ¶ added in v0.19.0
ValidateInputSubmissionCount preserves unknown (nil) separately from measured zero and limits present values to the exact integer range shared with JS.
func ValidateNativeMetadata ¶ added in v0.16.0
func ValidateNativeMetadata(v SessionDetailPayload) error
func ValidateNativeMetadataRecords ¶ added in v0.16.0
func ValidateNativeMetadataRecords(records []NativeMetadataRecord, targets []TurnDetail) error
ValidateNativeMetadataRecords validates metadata and its public targets before a producer attaches them to a harness-specific session envelope. See NativeMetadataRecord.Attachment for the partition-local attachment rule.
func ValidateObservedModelEvidence ¶ added in v0.1.1
func ValidateObservedModelEvidence(role Role, observed ObservedModelID) error
ValidateObservedModelEvidence enforces the enriched-publish attribution rule. Subagent output uses the assistant role at a nonzero depth, so RoleAssistant covers both root assistants and subagents. Omitted evidence is valid. Servers advertising observed_model_v1 guarantee this validation completes before any persistence or other side effect and that accepted observedModel value bytes survive publish, storage, migration, rewrite, and serving exactly. JSON whitespace, object-key ordering, and other formatting are not guaranteed.
func ValidatePositionedSegmentBoundaries ¶ added in v0.54.0
func ValidatePositionedSegmentBoundaries(seg PositionedSegment, ref PositionedSegmentRef) error
ValidatePositionedSegmentBoundaries compares the segment's served rows with the directory ref it was cut from. Validate checks the segment alone; this function checks the independent directory coordinates.
func ValidatePositionedWindowCoverage ¶ added in v0.54.0
func ValidatePositionedWindowCoverage(window PositionedWindow, refs []PositionedSegmentRef) error
ValidatePositionedWindowCoverage checks the window against the refs it was resolved on, including the anchor and an optional requested-position widening.
func ValidatePublicRefJSONSchemaFormat ¶ added in v0.19.0
ValidatePublicRefJSONSchemaFormat implements PublicRefUTF8ByteFormat for JSON Schema runtimes. Register it as a format assertion before compiling a schema that exposes one of the public reference types.
func ValidatePublicationRequest ¶
func ValidatePublicationRequest(r AuthoritativePublishRequest) error
ValidatePublicationRequest validates the complete successor publication request. PublishRequest.Validate retains the released rc11 association-only behavior for source compatibility.
func ValidatePublishRequest ¶
ValidatePublishRequest validates a legacy rc11 publish-request JSON body against the byte-frozen Village 0.10.0 schema. It intentionally does not follow the current Village API version: successor authoritative multipart metadata is validated by DecodeAuthoritativePublishRequest. A non-nil error means the body is invalid — a type/enum/pattern violation, the rc2 (#118) required model object or its harness/model fields missing (e.g. "missing properties: 'model'"/'harness'), or not valid JSON — and the caller must reject it (the village maps this to HTTP 422). It returns nil for a conforming body, or the compile error if the embedded schema fails to compile on first use.
func ValidatePublishedSessionDetailPayload ¶ added in v0.45.0
func ValidatePublishedSessionDetailPayload(value SessionDetailPayload) error
ValidatePublishedSessionDetailPayload validates a session detail assembled for publication. Ordered image parts must carry only the not_published shape; a local ref, media type, size, or dimensions is refused. Village's typed read and rewrite boundary uses this when it validates a stored published detail.
func ValidateRetainedUnknown ¶ added in v0.24.0
func ValidateRetainedUnknown(value SessionDetailPayload) error
ValidateRetainedUnknown checks complete retained evidence and its source order. Payload text keeps the normal scanner bounds, never metadata-only budgets. Outer byte limits belong to the actual raw input/output serialization, not a semantic validator's alternate encoding of the same typed value.
func ValidateScaleDomainCombo ¶
func ValidateScaleDomainCombo(scale ScaleKind, domain ValueDomainKind) error
ValidateScaleDomainCombo returns an error when the (scale, domain) combination is structurally incoherent:
- described + ordinal: rejected because ordinal requires explicit ordering via permissible values (enumerated), not a range constraint.
- enumerated + continuous: rejected because continuous ranges must be described with a JSON-schema constraint, not a finite list of permissible values.
func ValidateSessionDetailPayload ¶ added in v0.16.0
func ValidateSessionDetailPayload(value SessionDetailPayload) error
ValidateSessionDetailPayload validates durable local session detail. Content parts are validated in their local image shape; a published transcript is validated by ValidatePublishedSessionDetailPayload or ValidateTranscriptContent.
func ValidateSessionRelationships ¶ added in v0.19.0
func ValidateSessionRelationships(rs []SessionRelationship) error
func ValidateThinkingLevelEvidence ¶ added in v0.29.0
func ValidateThinkingLevelEvidence(role Role, level ThinkingLevel, raw ThinkingLevelRaw) error
ValidateThinkingLevelEvidence enforces the producer rule that a thinking level or raw spelling may appear only on assistant-generated output (root assistants and subagents both use RoleAssistant). Generated shape validators cannot express this role condition. Omitted evidence is valid.
func ValidateThinkingLevelRawJSONSchemaFormat ¶ added in v0.29.0
ValidateThinkingLevelRawJSONSchemaFormat implements ThinkingLevelRawUTF8ByteFormat for JSON Schema runtimes. Non-string values pass so type assertions remain the responsibility of the "type" keyword.
func ValidateTranscriptContent ¶ added in v0.16.0
func ValidateTranscriptContent(v TranscriptContent) error
func ValidateTranscriptSegmentBoundaries ¶ added in v0.42.0
func ValidateTranscriptSegmentBoundaries(segment TranscriptSegment, totalSegments int) error
ValidateTranscriptSegmentBoundaries checks a segment's edge flags against the directory's segment count: HasOlder is Index > 0 and HasNewer is Index < totalSegments-1. A segment alone cannot know the total, so the producer calls this with the directory it built.
func ValidateTranscriptWindowCoverage ¶ added in v0.42.0
func ValidateTranscriptWindowCoverage(window TranscriptWindow, refs []TranscriptSegmentRef) error
ValidateTranscriptWindowCoverage checks that the window's segment run is exactly the directory's run from the segment containing firstTurn to the one containing lastTurn. The descriptor carries no refs, so this check needs the directory the window was resolved against.
func ValidateTurnContentPart ¶ added in v0.45.0
func ValidateTurnContentPart(mode ImagePartMode, part TurnContentPart) error
ValidateTurnContentPart validates one ordered part for the given mode. A text part is accepted in both modes. An image part delegates to ValidateImagePart.
func ValidateUsageDetail ¶ added in v0.16.0
func ValidateUsageDetail(v UsageDetail) error
func VillageAPISpecJSON ¶
func VillageAPISpecJSON() []byte
VillageAPISpecJSON returns the JSON bytes of the CURRENT Village API OpenAPI spec — the version named by VillageAPIVersion. It is version-aware: the filename is derived from the single-source VillageAPIVersion constant, never a literal, so a version bump in versions.go re-points this accessor in lockstep and consumers (e.g. village's GET /openapi.json) need no change.
The bytes are embedded at compile time, so a failure here means the committed generated/ artifact for VillageAPIVersion is missing — a build/generation bug, not a runtime condition. It panics with an actionable message in that case; the codegen-freshness gate and TestVillageAPISpecJSON_MatchesCurrentVersion make this unreachable in a healthy tree.
func VillageWithheldRepositoryFields ¶ added in v0.33.0
VillageWithheldRepositoryFields returns, per holder, the JSON names of the repository fields Validate refuses beside an anonymous owner. A withheld field is null or absent; an empty string is present and is refused too.
Types ¶
type ActivityEdge ¶
type ActivityEdge struct {
From string `json:"from"`
To string `json:"to"`
TaskCount int `json:"taskCount"` // distinct tasks that edited both
}
ActivityEdge is a co-edit observation: two nodes repeatedly edited by the same tasks.
type ActorOrigin ¶ added in v0.19.0
type ActorOrigin string
const ( ActorOriginOperator ActorOrigin = "operator" ActorOriginAgentDelegate ActorOrigin = "agent_delegate" ActorOriginHarness ActorOrigin = "harness" ActorOriginUnknown ActorOrigin = "unknown" )
func NewActorOrigin ¶ added in v0.19.0
func NewActorOrigin(raw string) (ActorOrigin, error)
func (ActorOrigin) IsValid ¶ added in v0.19.0
func (v ActorOrigin) IsValid() bool
func (ActorOrigin) JSONSchema ¶ added in v0.19.0
func (ActorOrigin) JSONSchema() (jsonschema.Schema, error)
type AnalyticsSessionStats ¶ added in v0.42.0
type AnalyticsSessionStats struct {
DurationMins MedianP90 `json:"durationMins"`
TotalTokens MedianP90 `json:"totalTokens"`
TurnCount MedianP90 `json:"turnCount" description:"Median conversationTurnCount over the library."`
ToolCallCount MedianP90 `json:"toolCallCount"`
}
AnalyticsSessionStats is the analytics aggregate over the library. It is not the ingest SessionStats: the name keeps the two distinct in one package.
type AnnotationAxis ¶
type AnnotationAxis string
AnnotationAxis is the subscription dimension for annotation channels.
const ( AxisType AnnotationAxis = "type" AxisSession AnnotationAxis = "session" AxisProject AnnotationAxis = "project" )
func (AnnotationAxis) IsValid ¶
func (a AnnotationAxis) IsValid() bool
IsValid reports whether a is a defined annotation subscription axis.
func (AnnotationAxis) JSONSchema ¶
func (AnnotationAxis) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AnnotationAxis) String ¶
func (a AnnotationAxis) String() string
String returns the wire representation of the annotation axis.
type AnnotationDatatype ¶
type AnnotationDatatype string
AnnotationDatatype is the storage type for annotation values.
const ( DatatypeText AnnotationDatatype = "text" DatatypeInteger AnnotationDatatype = "integer" DatatypeReal AnnotationDatatype = "real" DatatypeBoolean AnnotationDatatype = "boolean" )
func (AnnotationDatatype) IsValid ¶
func (d AnnotationDatatype) IsValid() bool
IsValid returns true if the annotation datatype is one of the known variants.
func (AnnotationDatatype) JSONSchema ¶
func (AnnotationDatatype) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AnnotationDatatype) String ¶
func (d AnnotationDatatype) String() string
type AnnotationEntryTarget ¶
type AnnotationEntryTarget struct {
SessionID string `json:"sessionId"`
EntryIndex int `json:"entryIndex"`
EndIndex int `json:"endIndex"` // half-open [start, end)
}
AnnotationEntryTarget identifies an entry-level annotation target. EndIndex is a half-open range [EntryIndex, EndIndex).
func (AnnotationEntryTarget) Validate ¶
func (target AnnotationEntryTarget) Validate() error
Validate checks the semantic invariants of an entry-level annotation target. JSON Schema can enforce the non-empty session identifier, while this runtime predicate owns the relational half-open range rule shared by every Go request and response path that validates an entry target.
type AnnotationFixtureSummary ¶
type AnnotationFixtureSummary struct {
Name string `yaml:"name"`
ID string `yaml:"id"`
TargetKind string `yaml:"targetKind"`
TargetSessionID string `yaml:"targetSessionId,omitempty"`
TargetEntryIndex *int `yaml:"targetEntryIndex,omitempty"`
TargetEntryEndIndex *int `yaml:"targetEntryEndIndex,omitempty"`
TargetAnnotationID string `yaml:"targetAnnotationId,omitempty"`
TargetProjectHash string `yaml:"targetProjectHash,omitempty"`
TargetAssociationID string `yaml:"targetAssociationId,omitempty"`
TargetFilePath string `yaml:"targetFilePath,omitempty"`
TargetContentHash string `yaml:"targetContentHash,omitempty"`
IsPrimary bool `yaml:"isPrimary"`
AnnotatorKind string `yaml:"annotatorKind"`
AnnotatorName string `yaml:"annotatorName"`
TypeID string `yaml:"typeId"`
TypeName string `yaml:"typeName"`
Value string `yaml:"value"`
CreatedAt int64 `yaml:"createdAt"`
}
AnnotationFixtureSummary is a named annotation template in YAML.
func (*AnnotationFixtureSummary) ToAnnotationSummary ¶
func (f *AnnotationFixtureSummary) ToAnnotationSummary() AnnotationSummary
ToAnnotationSummary converts the fixture to a real AnnotationSummary.
type AnnotationFixtures ¶
type AnnotationFixtures struct {
Summaries []AnnotationFixtureSummary `yaml:"annotation_summaries"`
Validations []SubscriptionValidationCase `yaml:"subscription_validations"`
TargetValidations testcase.Corpus[AnnotationSummary, bool] `yaml:"annotation_target_validations"`
TargetRepairs testcase.Corpus[annotationTargetRepairInput, annotationTargetRepairExpected] `yaml:"annotation_target_repairs"`
}
AnnotationFixtures is the top-level YAML structure for annotation test data.
func LoadAnnotationFixtures ¶
func LoadAnnotationFixtures() (*AnnotationFixtures, error)
LoadAnnotationFixtures parses AnnotationsYAML into structured fixtures.
func (*AnnotationFixtures) FindSummary ¶
func (f *AnnotationFixtures) FindSummary(name string) *AnnotationFixtureSummary
FindSummary returns the fixture annotation with the given name, or nil.
type AnnotationManifestResponse ¶
type AnnotationManifestResponse struct {
// Hex-encoded SHA3-256 annotation content-hashes the village holds for the owner (sorted, de-duplicated).
// Always emitted as a (possibly empty) NON-null array: NewAnnotationManifestResponse
// normalizes via sortedUniqueHashes, which never returns nil — so nullable:"false"
// is the correct wire contract (matches develop's served village-api spec).
Hashes []string `` /* 148-byte string literal not displayed */
// Deterministic, order-independent digest over the hash set; a client computing the same digest over its local set knows nothing diverged.
Digest string `` /* 164-byte string literal not displayed */
}
AnnotationManifestResponse is the body returned by GET /api/v1/annotations/manifest. It advertises the SET of annotation content-hashes the village currently holds for the authenticated owner, so a push client can SKIP any local annotation whose hash already appears here (server-authoritative skip-gate).
Hashes are hex-encoded SHA3-256 content-hashes — the SAME identity the client already computes via content_hash.go (ComputeContentHash / ComputeAnnotationHash). No annotation CONTENT is carried, only its hash, so the manifest is privacy-safe.
Digest is a deterministic, ORDER-INDEPENDENT digest over the hash set (see ComputeManifestDigest). A no-op re-push can short-circuit: if the client computes the same digest over its own local hash set, nothing has diverged.
This type is ADDITIVE — it introduces a new endpoint's response shape and does not alter any existing publish/annotation-push wire contract.
func NewAnnotationManifestResponse ¶
func NewAnnotationManifestResponse(hashes []string) AnnotationManifestResponse
NewAnnotationManifestResponse builds a manifest from a set of content-hashes, normalizing the set (sorted + de-duplicated) and computing the matching digest.
Normalizing on construction means the wire payload is canonical: two villages holding the same logical set emit byte-identical manifests, and the Digest is always consistent with the Hashes it accompanies.
func (AnnotationManifestResponse) ComputeDigest ¶
func (r AnnotationManifestResponse) ComputeDigest() string
ComputeDigest recomputes the order-independent digest over this manifest's Hashes. It is provided so a client can verify the server's Digest field or compare against its own locally-derived digest for the no-op short-circuit.
type AnnotationPushItem ¶
type AnnotationPushItem struct {
ContentHash string `json:"contentHash"`
TargetKind TargetKind `json:"targetKind"`
TargetAssociationID *AssociationID `json:"targetAssociationId,omitempty"`
SessionID *string `json:"sessionId,omitempty"`
EntryTarget *AnnotationEntryTarget `json:"entryTarget,omitempty"`
AnnotationID *string `json:"annotationId,omitempty"`
ProjectHash *ProjectHash `json:"projectHash,omitempty"`
TypeID string `json:"typeId"`
Value string `json:"value"`
IsPrimary bool `json:"isPrimary"`
Confidence *float64 `json:"confidence,omitempty"`
Reason *string `json:"reason,omitempty"`
AnnotatorName string `json:"annotatorName,omitempty"`
Provenance *Provenance `json:"provenance,omitempty"`
}
AnnotationPushItem is the wire type for a single annotation in a push request. ContentHash is SHA3-256 of the canonical JSON representation of all other fields, computed by ComputeContentHash(). Used for server-side deduplication.
func (*AnnotationPushItem) ComputeContentHash ¶
func (item *AnnotationPushItem) ComputeContentHash() string
ComputeContentHash computes a SHA3-256 content hash over the canonical JSON representation of the AnnotationPushItem, excluding the ContentHash field itself.
The hash is deterministic: the same logical annotation always produces the same hex string regardless of struct field order. This is because encoding/json marshals struct fields in declaration order, producing stable output for the same values.
Use case: server-side deduplication. The caller sets item.ContentHash to this value before adding it to an AnnotationPushRequest.
func (AnnotationPushItem) Validate ¶
func (item AnnotationPushItem) Validate() error
Validate checks that an annotation push item names one exclusive target arm. Association target validation is shared with AnnotationSummary so ingress and returned annotations cannot disagree about when targetAssociationId is valid.
type AnnotationPushRequest ¶
type AnnotationPushRequest struct {
Annotations []AnnotationPushItem `json:"annotations" required:"true" nullable:"false"`
Retractions []string `json:"retractions,omitempty"`
}
AnnotationPushRequest is the body sent to POST /api/v1/annotations.
Retractions is an ADDITIVE, backwards-compatible field: a set of content-hashes the client wants the village to DROP (tombstone) for this owner. It carries propagated deletions/supersessions inline on the existing push request rather than via a separate DELETE endpoint (avoids a second auth/owner-scoping path and round-trip). The hashes are the SAME hex SHA3 content-hashes used for dedup; only hashes the owner authored AND locally retired are sent, so a foreign machine's annotation can never be retracted. omitempty preserves the prior wire shape for clients that send no retractions.
func (AnnotationPushRequest) Validate ¶
func (r AnnotationPushRequest) Validate() error
Validate checks every annotation in a pushed batch through the public item validator. A caller can reject the batch before persistence when one item is malformed, preserving all-or-nothing handler semantics.
type AnnotationPushResponse ¶
type AnnotationPushResponse struct {
Created int `json:"created"`
Updated int `json:"updated"`
Skipped int `json:"skipped"`
Errors int `json:"errors"`
Results []AnnotationPushResult `json:"results,omitempty"`
}
AnnotationPushResponse is returned by the village after processing an annotation push.
type AnnotationPushResult ¶
type AnnotationPushResult struct {
ContentHash string `json:"contentHash,omitempty"`
Status AnnotationPushStatus `json:"status"`
Error string `json:"error,omitempty"`
}
AnnotationPushResult is the per-item result within an AnnotationPushResponse.
type AnnotationPushStatus ¶
type AnnotationPushStatus string
AnnotationPushStatus is the per-item outcome status from the village.
const ( PushStatusCreated AnnotationPushStatus = "created" PushStatusUpdated AnnotationPushStatus = "updated" PushStatusSkipped AnnotationPushStatus = "skipped" PushStatusError AnnotationPushStatus = "error" )
func (AnnotationPushStatus) IsValid ¶
func (s AnnotationPushStatus) IsValid() bool
IsValid reports whether s is a defined annotation push outcome.
func (AnnotationPushStatus) JSONSchema ¶
func (AnnotationPushStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AnnotationPushStatus) String ¶
func (s AnnotationPushStatus) String() string
String returns the string representation of the push status.
type AnnotationRegistry ¶
type AnnotationRegistry interface {
AnnotationTypeReader
// Register inserts a new annotation type from the given definition.
// Returns the newly created AnnotationTypeSummary (status=proposed by default).
Register(ctx context.Context, def TypeDefinition) (*AnnotationTypeSummary, error)
// Activate transitions a type from proposed -> active.
Activate(ctx context.Context, typeID string) error
// Deprecate transitions a type from active -> deprecated, recording the superseding typeID.
Deprecate(ctx context.Context, typeID string, supersededBy string) error
// AddDependency records that typeID depends on dependsOn (V14: cycle detection enforced).
// required=true means the dependency must be satisfied before typeID can produce a value.
// rationale documents the reason for the dependency.
AddDependency(ctx context.Context, typeID, dependsOn string, required bool, rationale string) error
// GetDependencies returns the dependency entries for typeID.
GetDependencies(ctx context.Context, typeID string) ([]TypeDependency, error)
}
AnnotationRegistry extends AnnotationTypeReader with mutation operations. Used by admin commands and the registry management layer.
type AnnotationStatus ¶
type AnnotationStatus string
AnnotationStatus is the lifecycle state of an annotation type (ISO 11179 Part 6).
const ( StatusProposed AnnotationStatus = "proposed" StatusActive AnnotationStatus = "active" StatusDeprecated AnnotationStatus = "deprecated" StatusRetired AnnotationStatus = "retired" )
func (AnnotationStatus) IsValid ¶
func (s AnnotationStatus) IsValid() bool
IsValid returns true if the annotation status is one of the known variants.
func (AnnotationStatus) JSONSchema ¶
func (AnnotationStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AnnotationStatus) String ¶
func (s AnnotationStatus) String() string
type AnnotationSummary ¶
type AnnotationSummary struct {
ID string `json:"id"`
TargetKind TargetKind `json:"targetKind" yaml:"targetKind"`
TargetSessionID *string `json:"targetSessionId,omitempty" yaml:"targetSessionId,omitempty"`
TargetEntryIndex *int `json:"targetEntryIndex,omitempty" yaml:"targetEntryIndex,omitempty"`
TargetEntryEndIndex *int `json:"targetEntryEndIndex,omitempty" yaml:"targetEntryEndIndex,omitempty"` // V16: half-open [start, end)
TargetAnnotID *string `json:"targetAnnotationId,omitempty" yaml:"targetAnnotationId,omitempty"`
TargetProjectHash *ProjectHash `json:"targetProjectHash,omitempty" yaml:"targetProjectHash,omitempty"`
// TargetAssociationID identifies a durable session-to-commit association.
// It is an ID target, never an embedded association copy.
TargetAssociationID *AssociationID `json:"targetAssociationId,omitempty" yaml:"targetAssociationId,omitempty"`
// TargetFilePath and TargetContentHash discriminate a TargetFileVersion
// annotation (the 5th TPT arm): a whole-file
// read-state receipt keyed to a specific content hash of a specific
// repo-relative path, so an agent edit that changes the content hash
// invalidates the receipt without deleting it.
TargetFilePath *string `json:"targetFilePath,omitempty" yaml:"targetFilePath,omitempty"`
TargetContentHash *string `json:"targetContentHash,omitempty" yaml:"targetContentHash,omitempty"`
IsPrimary bool `json:"isPrimary"`
AnnotatorKind AnnotatorKind `json:"annotatorKind"`
AnnotatorName string `json:"annotatorName"`
TypeID string `json:"typeId"`
TypeName string `json:"typeName"`
Value string `json:"value"`
Confidence *float64 `json:"confidence,omitempty"`
Reason *string `json:"reason,omitempty"`
Provenance *Provenance `json:"provenance,omitempty"`
ContentHash *string `json:"contentHash,omitempty"` // V16: push dedup
CreatedAt int64 `json:"createdAt"`
SupersededBy *string `json:"supersededBy,omitempty"`
}
AnnotationSummary is the wire format for annotations in API responses. TargetKind is derived via TPT child table JOINs (annotations_with_target view).
func (AnnotationSummary) Validate ¶
func (a AnnotationSummary) Validate() error
Validate checks that TargetKind selects exactly one AnnotationSummary target arm. It validates the response contract at its shared boundary so producers cannot emit mixed target identities.
type AnnotationTypeReader ¶
type AnnotationTypeReader interface {
// GetType returns the annotation type summary for the given type_id string.
// Returns an error wrapping ErrTypeNotFound if no matching type exists.
GetType(ctx context.Context, typeID string) (*AnnotationTypeSummary, error)
// ListTypes returns all annotation types matching the given filter.
// An empty TypeFilter returns all non-deprecated/retired types.
ListTypes(ctx context.Context, f TypeFilter) ([]AnnotationTypeSummary, error)
// ValidateValue validates that value is permissible for the annotation type identified by typeID.
// Returns nil if valid. Returns an error wrapping ErrTypeNotFound if the type does not exist,
// or an error wrapping ErrInvalidValue if the value is not permissible.
ValidateValue(ctx context.Context, typeID string, value string) error
}
AnnotationTypeReader provides read-only access to the annotation type registry. Consumed by classifiers, the ingest pipeline, and the REST API handler. Returns AnnotationTypeSummary (wire type) — the internal domain object stays in internal/annotations.
type AnnotationTypeSummary ¶
type AnnotationTypeSummary struct {
ID string `json:"id,omitempty"` // UUID PK — populated from store for CLI use; omitted in REST responses
TypeID string `json:"typeId"`
Version int `json:"version"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
Family string `json:"family"`
Class string `json:"class"`
ScaleKind ScaleKind `json:"scaleKind,omitempty"` // measurement level (ISO 11179 Part 5)
ValueDomain ValueDomain `json:"valueDomain"`
LowerIsBetter *bool `json:"lowerIsBetter,omitempty"`
Status AnnotationStatus `json:"status"`
Origin TypeOrigin `json:"origin"`
PriorityOverride *int `json:"priorityOverride,omitempty"`
// AllowedTargetKinds lists the target kinds this type may annotate (V16).
// Empty/omitted means the type places no restriction (all kinds allowed).
// Clients filter entry-level pickers to types whose list includes "entry".
AllowedTargetKinds []TargetKind `json:"allowedTargetKinds,omitempty"`
}
AnnotationTypeSummary is the wire format for annotation types in API responses. Class is derived via the annotation_families → annotation_classes join (BCNF: no redundant column).
type AnnotationsPayload ¶
type AnnotationsPayload struct {
Axis AnnotationAxis `json:"axis"`
ID string `json:"id"`
Annotations []AnnotationSummary `json:"annotations"`
}
AnnotationsPayload is the data sent on the annotations WebSocket channel. Axis and ID echo the subscription parameters so clients can correlate updates.
type AnnotatorKind ¶
type AnnotatorKind string
AnnotatorKind identifies the type of entity that produced an annotation. Priority for effective annotation resolution: human(3) > agent(2) > rule(1).
const ( AnnotatorHuman AnnotatorKind = "human" AnnotatorAgent AnnotatorKind = "agent" AnnotatorRule AnnotatorKind = "rule" )
func (AnnotatorKind) IsValid ¶
func (k AnnotatorKind) IsValid() bool
IsValid returns true if the annotator kind is one of the known variants.
func (AnnotatorKind) JSONSchema ¶
func (AnnotatorKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AnnotatorKind) Priority ¶
func (k AnnotatorKind) Priority() int
Priority returns the resolution priority for effective annotation selection. Higher value wins: human(3) > agent(2) > rule(1). Returns 0 for unknown kinds.
func (AnnotatorKind) String ¶
func (k AnnotatorKind) String() string
type AnnotatorSummary ¶
type AnnotatorSummary struct {
ID string `json:"id"`
Kind AnnotatorKind `json:"kind"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
ModelID *string `json:"modelId,omitempty"`
// DO NOT TOUCH (TRAP): ProviderKey is the model-VENDOR credential
// (e.g. "anthropic"), a DIFFERENT axis from the coding-tool Harness. The
// harness-key changeover left this as json:"providerKey" on purpose.
// Never flip it to json:"harness" — enforced by ast-grep/no-trap-harness-flip.yml.
ProviderKey *string `json:"providerKey,omitempty"`
Status string `json:"status"`
}
AnnotatorSummary is the wire format for annotators in API responses. ModelID and ProviderKey are only populated for agent annotators.
type AssociationConclusion ¶
type AssociationConclusion string
AssociationConclusion is the producer-supplied conclusion for a session to commit relationship. Schema validates the closed set, not the inference policy that produced the conclusion.
const ( AssociationConclusionConfirmed AssociationConclusion = "confirmed" AssociationConclusionCandidate AssociationConclusion = "candidate" )
AssociationConclusion values.
func (AssociationConclusion) IsValid ¶
func (c AssociationConclusion) IsValid() bool
IsValid reports whether c is a defined association conclusion.
func (AssociationConclusion) JSONSchema ¶
func (AssociationConclusion) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AssociationConclusion) String ¶
func (c AssociationConclusion) String() string
String returns the wire representation of the association conclusion.
func (AssociationConclusion) Validate ¶
func (c AssociationConclusion) Validate() error
Validate rejects values outside the closed association-conclusion set.
type AssociationEvidenceKind ¶
type AssociationEvidenceKind string
AssociationEvidenceKind identifies one atomic observation supporting a session-to-commit association. The order in AllAssociationEvidenceKinds is also the required canonical evidence order.
const ( AssociationEvidenceRecordedCommit AssociationEvidenceKind = "recorded_commit" AssociationEvidenceTouchedFile AssociationEvidenceKind = "touched_file" AssociationEvidenceBranchMembership AssociationEvidenceKind = "branch_membership" AssociationEvidenceTimeWindow AssociationEvidenceKind = "time_window" )
AssociationEvidenceKind values.
func (AssociationEvidenceKind) IsValid ¶
func (k AssociationEvidenceKind) IsValid() bool
IsValid reports whether k is a defined association evidence kind.
func (AssociationEvidenceKind) JSONSchema ¶
func (AssociationEvidenceKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AssociationEvidenceKind) String ¶
func (k AssociationEvidenceKind) String() string
String returns the wire representation of the association evidence kind.
func (AssociationEvidenceKind) Validate ¶
func (k AssociationEvidenceKind) Validate() error
Validate rejects values outside the closed association-evidence-kind set.
type AssociationEvidenceObservation ¶
type AssociationEvidenceObservation struct {
Kind AssociationEvidenceKind `json:"kind" yaml:"kind" required:"true"`
RecordedCommitHash *string `json:"recordedCommitHash,omitempty" yaml:"recordedCommitHash,omitempty"`
TouchedFilePath *string `json:"touchedFilePath,omitempty" yaml:"touchedFilePath,omitempty"`
BranchName *string `json:"branchName,omitempty" yaml:"branchName,omitempty"`
WindowStartMs *int64 `json:"windowStartMs,omitempty" yaml:"windowStartMs,omitempty"`
WindowEndMs *int64 `json:"windowEndMs,omitempty" yaml:"windowEndMs,omitempty"`
}
AssociationEvidenceObservation is one atomic, typed observation supporting a session-to-commit association. Exactly the fields for Kind's selected arm are populated; producers must send canonical order and never rely on schema to normalize a wire value.
func (AssociationEvidenceObservation) Validate ¶
func (o AssociationEvidenceObservation) Validate() error
Validate checks that Kind selects exactly one structurally valid detail arm. Git hash and branch-name grammars are producer policy; schema only requires that their supplied strings are non-empty.
type AssociationID ¶
type AssociationID string
AssociationID is Peasant's opaque, durable identifier for one association between a project, session, and observed session-era commit. Consumers treat it as an identifier only: they do not derive, parse, rank, or recompute it.
func NewAssociationID ¶
func NewAssociationID(raw string) (AssociationID, error)
NewAssociationID validates and constructs an opaque association identifier.
func (AssociationID) JSONSchema ¶
func (AssociationID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AssociationID) String ¶
func (id AssociationID) String() string
String returns the wire representation of the association identifier.
func (AssociationID) Validate ¶
func (id AssociationID) Validate() error
Validate rejects an association identifier that cannot cross the wire boundary. The identifier is ASCII-only, one to 128 bytes, starts alphanumerically, and thereafter uses only alphanumeric, dot, underscore, colon, or hyphen characters.
type AttachmentRouteFixtures ¶ added in v0.47.0
type AttachmentRouteFixtures struct {
Operation AttachmentRouteOperationFixture `yaml:"operation"`
Refs testcase.Corpus[AttachmentRouteRefInput, AttachmentRouteRefExpected] `yaml:"refs"`
Responses testcase.Corpus[AttachmentRouteResponseInput, AttachmentRouteResponseExpected] `yaml:"responses"`
}
AttachmentRouteFixtures is the segmented local image-read corpus: one arm for the path parameter, one arm for the declared responses, and the operation facts both arms and the OpenAPI document must match.
func LoadAttachmentRouteFixtures ¶ added in v0.47.0
func LoadAttachmentRouteFixtures() (AttachmentRouteFixtures, error)
LoadAttachmentRouteFixtures loads the local image-read corpus and proves each arm's exact case-name inventory. The manifest is a separate document so a count-preserving rename still fails.
type AttachmentRouteOperationFixture ¶ added in v0.47.0
type AttachmentRouteOperationFixture struct {
Path string `yaml:"path"`
Method string `yaml:"method"`
OperationID string `yaml:"operation_id"`
Parameter string `yaml:"parameter"`
Pattern string `yaml:"pattern"`
MinLength int `yaml:"min_length"`
MaxLength int `yaml:"max_length"`
SuccessStatus int `yaml:"success_status"`
SuccessMediaTypes []string `yaml:"success_media_types"`
CacheHeader string `yaml:"cache_header"`
CacheControl string `yaml:"cache_control"`
MalformedStatus int `yaml:"malformed_status"`
MalformedCode string `yaml:"malformed_code"`
MissingStatus int `yaml:"missing_status"`
MissingCode string `yaml:"missing_code"`
DescriptionClauses []string `yaml:"description_clauses"`
}
AttachmentRouteOperationFixture is the declared local image read: the path parameter, the success media types, the immutable cache header, and the refusal statuses. The OpenAPI document and the Go validators must match it.
type AttachmentRouteOutcome ¶ added in v0.47.0
type AttachmentRouteOutcome string
AttachmentRouteOutcome is the closed set of results GET /api/v1/attachments/{ref} declares. missing_row and missing_file are distinct inputs that share one 404, so a caller cannot collapse a missing file into a malformed ref.
const ( AttachmentRouteOutcomePNG AttachmentRouteOutcome = "png" AttachmentRouteOutcomeJPEG AttachmentRouteOutcome = "jpeg" AttachmentRouteOutcomeMalformed AttachmentRouteOutcome = "malformed" AttachmentRouteOutcomeMissingRow AttachmentRouteOutcome = "missing_row" AttachmentRouteOutcomeMissingFile AttachmentRouteOutcome = "missing_file" )
func (AttachmentRouteOutcome) IsValid ¶ added in v0.47.0
func (o AttachmentRouteOutcome) IsValid() bool
IsValid reports whether the outcome belongs to the closed set.
func (AttachmentRouteOutcome) String ¶ added in v0.47.0
func (o AttachmentRouteOutcome) String() string
type AttachmentRouteRefExpected ¶ added in v0.47.0
type AttachmentRouteRefExpected struct {
Accepted bool `yaml:"accepted"`
ErrorContains string `yaml:"error_contains,omitempty"`
}
AttachmentRouteRefExpected is whether that spelling is a lowercase 64-hex sha256, and the rule a rejection must name.
type AttachmentRouteRefInput ¶ added in v0.47.0
type AttachmentRouteRefInput struct {
Ref string `yaml:"ref"`
}
AttachmentRouteRefInput is one path-parameter spelling.
type AttachmentRouteResponse ¶ added in v0.47.0
type AttachmentRouteResponse struct {
Status int
MediaType ImageMediaType
CacheControl string
Code string
}
AttachmentRouteResponse is one declared response of the local image read. MediaType and CacheControl are set only for 200. Code is set only for a refusal.
func AttachmentRouteResponseFor ¶ added in v0.47.0
func AttachmentRouteResponseFor(outcome AttachmentRouteOutcome) (AttachmentRouteResponse, error)
AttachmentRouteResponseFor returns the declared response for one closed outcome. A malformed ref is 400. A missing row and a missing file are both 404. A present png or jpeg is 200 with that media type and the immutable cache header.
type AttachmentRouteResponseExpected ¶ added in v0.47.0
type AttachmentRouteResponseExpected struct {
Accepted bool `yaml:"accepted"`
Status int `yaml:"status,omitempty"`
MediaType string `yaml:"media_type,omitempty"`
CacheControl string `yaml:"cache_control,omitempty"`
Code string `yaml:"code,omitempty"`
ErrorContains string `yaml:"error_contains,omitempty"`
}
AttachmentRouteResponseExpected is the declared status, media type, cache header, and error code for that outcome.
type AttachmentRouteResponseInput ¶ added in v0.47.0
type AttachmentRouteResponseInput struct {
Outcome string `yaml:"outcome"`
}
AttachmentRouteResponseInput names one closed route outcome.
type AuthoritativeClientInfo ¶ added in v0.37.0
type AuthoritativeClientInfo struct {
Name string `json:"name" minLength:"1" maxLength:"64" pattern:"^[a-z][a-z0-9-]{0,63}$"`
Version string `` /* 248-byte string literal not displayed */
}
AuthoritativeClientInfo names the program that built the publish request. It is self-reported and unsigned: evidence for consistency checks, not proof. It is outside the publish fingerprint.
func (AuthoritativeClientInfo) Validate ¶ added in v0.37.0
func (c AuthoritativeClientInfo) Validate() error
Validate checks the byte bounds and both patterns.
type AuthoritativeCommitInfo ¶
type AuthoritativeCommitInfo CommitInfo
type AuthoritativeDiagnosticEntry ¶
type AuthoritativeDiagnosticEntry DiagnosticEntry
type AuthoritativeDiagnosticsInfo ¶
type AuthoritativeDiagnosticsInfo struct {
Warnings []AuthoritativeDiagnosticEntry `json:"warnings"`
Partial *bool `json:"partial,omitempty"`
}
type AuthoritativeGitContext ¶
type AuthoritativeGitContext struct {
Branch *string `json:"branch,omitempty"`
Remote *string `json:"remote,omitempty"`
Worktree *string `json:"worktree,omitempty"`
Tracking *string `json:"tracking,omitempty"`
Commits []AuthoritativeCommitInfo `json:"commits,omitempty"`
Associations []PublishedAssociation `json:"associations,omitempty"`
}
type AuthoritativeModelInfo ¶
type AuthoritativeModelInfo struct {
Harness Harness `json:"harness" required:"true"`
Model ModelID `json:"model" required:"true"`
HarnessVersion string `json:"harnessVersion,omitempty"`
HostSlug HostSlug `json:"hostSlug,omitempty"`
}
AuthoritativeModelInfo is the successor publication model. It carries the same values as ModelInfo, but the harness version is keyed harnessVersion, the key the successor decoders accept; ModelInfo keeps the legacy key version. The two structs have identical field names and types, so Go conversions between them keep compiling.
type AuthoritativeProjectContext ¶
type AuthoritativeProjectContext ProjectContext
type AuthoritativePublishRequest ¶
type AuthoritativePublishRequest struct {
Identity AuthoritativeSessionIdentity `json:"identity,omitempty"`
Model AuthoritativeModelInfo `json:"model" required:"true"`
Timestamp AuthoritativeTimestampInfo `json:"timestamp,omitempty"`
Source AuthoritativeSourceInfo `json:"source,omitempty"`
Git AuthoritativeGitContext `json:"git,omitempty"`
Project AuthoritativeProjectContext `json:"project,omitempty"`
Stats AuthoritativeSessionStats `json:"stats,omitempty"`
Quality *AuthoritativeQualityMetrics `json:"quality,omitempty"`
Entries []AuthoritativeSessionEntry `json:"entries,omitempty"`
Subagents []AuthoritativeSubagentRef `json:"subagents,omitempty"`
Diagnostics AuthoritativeDiagnosticsInfo `json:"diagnostics,omitempty"`
License License `json:"license,omitempty"`
ContentHash TranscriptContentHash `json:"contentHash" required:"true"`
VisibilityIntent VisibilityIntent `json:"visibilityIntent,omitempty"`
Client *AuthoritativeClientInfo `json:"client,omitempty"`
}
func DecodeAuthoritativePublishMetadataRaw ¶ added in v0.16.0
func DecodeAuthoritativePublishMetadataRaw(raw []byte) (AuthoritativePublishRequest, error)
func DecodeAuthoritativePublishRequest ¶
func DecodeAuthoritativePublishRequest(data []byte) (AuthoritativePublishRequest, error)
func (*AuthoritativePublishRequest) UnmarshalJSON ¶
func (value *AuthoritativePublishRequest) UnmarshalJSON(data []byte) error
type AuthoritativePublishResponse ¶
type AuthoritativePublishResponse struct {
TranscriptID TranscriptID `json:"transcriptId"`
TranscriptURL string `json:"transcriptUrl"`
Visibility Visibility `json:"visibility"`
ContentHash TranscriptContentHash `json:"contentHash"`
RequestOperationFingerprint PublishRequestFingerprint `json:"requestOperationFingerprint"`
Applied PublishAppliedState `json:"applied"`
BlobKey string `json:"blobKey"`
BlobSizeBytes int64 `json:"blobSizeBytes"`
PublishedAt int64 `json:"publishedAt"`
UpdatedAt int64 `json:"updatedAt"`
Created bool `json:"created"`
}
func DecodePublishResponse ¶
func DecodePublishResponse(data []byte) (AuthoritativePublishResponse, error)
func (*AuthoritativePublishResponse) UnmarshalJSON ¶
func (value *AuthoritativePublishResponse) UnmarshalJSON(data []byte) error
func (AuthoritativePublishResponse) Validate ¶
func (response AuthoritativePublishResponse) Validate() error
type AuthoritativeQualityMetrics ¶
type AuthoritativeQualityMetrics QualityMetrics
type AuthoritativeSessionEntry ¶
type AuthoritativeSessionEntry SessionEntry
type AuthoritativeSessionIdentity ¶
type AuthoritativeSessionIdentity struct {
SessionID SessionID `json:"sessionId"`
ParentSessionID *SessionID `json:"parentSessionId,omitempty" nullable:"false"`
RootSessionID *SessionID `json:"rootSessionId,omitempty" nullable:"false"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
SchemaVersion int `json:"schemaVersion"`
}
Successor publication projections have distinct component identities so recursive unknown-field rejection does not tighten legacy uses of shared metadata components.
type AuthoritativeSessionStats ¶
type AuthoritativeSessionStats SessionStats
type AuthoritativeSourceInfo ¶
type AuthoritativeSourceInfo SourceInfo
type AuthoritativeSubagentRef ¶
type AuthoritativeSubagentRef SubagentRef
type AuthoritativeTimestampInfo ¶
type AuthoritativeTimestampInfo TimestampInfo
type AutoPublishEvent ¶ added in v0.25.0
type AutoPublishEvent string
AutoPublishEvent is the git hook that publishes a rule's sessions.
const ( AutoPublishPrePush AutoPublishEvent = "pre-push" AutoPublishPostCommit AutoPublishEvent = "post-commit" )
func (AutoPublishEvent) IsValid ¶ added in v0.25.0
func (e AutoPublishEvent) IsValid() bool
func (AutoPublishEvent) JSONSchema ¶ added in v0.25.0
func (AutoPublishEvent) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AutoPublishEvent) String ¶ added in v0.25.0
func (e AutoPublishEvent) String() string
type AutoPublishHook ¶ added in v0.25.0
type AutoPublishHook struct {
Event AutoPublishEvent `json:"event"`
Status AutoPublishHookStatus `json:"status"`
Remedy *AutoPublishHookRemedy `json:"remedy,omitempty" nullable:"false"`
}
AutoPublishHook is the state of one repository's hook for one event. Only a blocked or failed hook carries a remedy.
func (AutoPublishHook) Validate ¶ added in v0.25.0
func (h AutoPublishHook) Validate() error
Validate checks the event, the status, and the remedy pairing.
type AutoPublishHookRemedy ¶ added in v0.25.0
type AutoPublishHookRemedy struct {
Message string `json:"message" minLength:"1"`
Snippet string `json:"snippet,omitempty"`
}
AutoPublishHookRemedy tells the user what to do about a blocked or failed hook. Snippet, present only for a blocked hook Peasant could otherwise manage, is the exact section of hook script to add to the existing hook by hand.
type AutoPublishHookStatus ¶ added in v0.25.0
type AutoPublishHookStatus string
AutoPublishHookStatus is the state of one repository's hook for one event.
const ( // AutoPublishHookAbsent: no hook file exists; installing is offered. AutoPublishHookAbsent AutoPublishHookStatus = "absent" // AutoPublishHookInstalled: Peasant's own hook is installed. AutoPublishHookInstalled AutoPublishHookStatus = "installed" // AutoPublishHookBlocked: Peasant will not manage the hook, because a file // it did not write is in the way or the hook path is shared outside the // repository. Peasant never overwrites such a file. It carries a remedy. AutoPublishHookBlocked AutoPublishHookStatus = "blocked" // AutoPublishHookFailed: installing the hook failed. Only an install // response reports it, and it carries a remedy naming the failure. A rule // or a removal response never reports it. AutoPublishHookFailed AutoPublishHookStatus = "failed" )
func (AutoPublishHookStatus) IsValid ¶ added in v0.25.0
func (s AutoPublishHookStatus) IsValid() bool
func (AutoPublishHookStatus) JSONSchema ¶ added in v0.25.0
func (AutoPublishHookStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AutoPublishHookStatus) String ¶ added in v0.25.0
func (s AutoPublishHookStatus) String() string
type AutoPublishInstallRequest ¶ added in v0.25.0
type AutoPublishInstallRequest struct {
Path string `json:"path" minLength:"1"`
}
AutoPublishInstallRequest is the body of POST /api/v1/settings/auto-publish/{id}/install: the one recorded repository to install the rule's hooks in.
func (AutoPublishInstallRequest) Validate ¶ added in v0.25.0
func (r AutoPublishInstallRequest) Validate() error
Validate checks that the request names a repository.
type AutoPublishRemovalResponse ¶ added in v0.25.0
type AutoPublishRemovalResponse struct {
ID string `json:"id" minLength:"1"`
Repositories []AutoPublishRepository `json:"repositories" nullable:"false"`
}
AutoPublishRemovalResponse is the response of DELETE /api/v1/settings/auto-publish/{id}: the removed rule's identifier and the hooks of the repositories it matched, as they are. Removing a rule keeps hook files but stops their rule-required uploads unless another active rule covers the repository and event. Paused rules grant no publishing consent. Hooks installed separately from the terminal keep their independent consent.
func (AutoPublishRemovalResponse) Validate ¶ added in v0.25.0
func (r AutoPublishRemovalResponse) Validate() error
Validate checks every repository and that each appears once.
type AutoPublishRepository ¶ added in v0.25.0
type AutoPublishRepository struct {
// Path is the repository's root on this computer.
Path string `json:"path" minLength:"1"`
// Label is the repository's schema.RemoteLabel, present when it has a
// remote.
Label string `json:"label,omitempty"`
Hooks []AutoPublishHook `json:"hooks" nullable:"false"`
}
AutoPublishRepository is one recorded repository a rule matches, with the state of its hook for each of the rule's events.
func (AutoPublishRepository) Validate ¶ added in v0.25.0
func (r AutoPublishRepository) Validate() error
Validate checks the repository and that each event appears once.
type AutoPublishRule ¶ added in v0.25.0
type AutoPublishRule struct {
ID string `json:"id" minLength:"1"`
Kind AutoPublishRuleKind `json:"kind"`
Match string `json:"match" minLength:"1"`
Events []AutoPublishEvent `json:"events" nullable:"false"`
Collectives []VillageUUID `json:"collectives" nullable:"false"`
Repositories []AutoPublishRepository `json:"repositories" nullable:"false"`
}
AutoPublishRule is one saved auto-publish rule with the recorded repositories it matches. Saving a rule installs nothing: each repository reports its hooks as they are, and installing is a separate call per repository.
func (AutoPublishRule) Validate ¶ added in v0.25.0
func (r AutoPublishRule) Validate() error
Validate checks the rule, each repository, and that every repository reports exactly the rule's events.
type AutoPublishRuleKind ¶ added in v0.25.0
type AutoPublishRuleKind string
AutoPublishRuleKind says what a rule's match pattern names.
const ( // AutoPublishRuleFolder: Match is a folder glob on this computer. AutoPublishRuleFolder AutoPublishRuleKind = "folder" // AutoPublishRuleRemote: Match is a git remote pattern. AutoPublishRuleRemote AutoPublishRuleKind = "remote" )
func (AutoPublishRuleKind) IsValid ¶ added in v0.25.0
func (k AutoPublishRuleKind) IsValid() bool
func (AutoPublishRuleKind) JSONSchema ¶ added in v0.25.0
func (AutoPublishRuleKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (AutoPublishRuleKind) String ¶ added in v0.25.0
func (k AutoPublishRuleKind) String() string
type AutoPublishRuleRequest ¶ added in v0.25.0
type AutoPublishRuleRequest struct {
Kind AutoPublishRuleKind `json:"kind,omitempty"`
Match string `json:"match,omitempty" minLength:"1"`
SessionID *SessionID `json:"sessionId,omitempty" nullable:"false"`
Events []AutoPublishEvent `json:"events" nullable:"false"`
Collectives []VillageUUID `json:"collectives" nullable:"false"`
}
AutoPublishRuleRequest is the body of PUT /api/v1/settings/auto-publish/{id}. An explicit pattern names Kind and Match. A session target instead names SessionID: the server resolves that stored session's directory to its current Git repository and saves an escaped exact-folder rule for that root. The two targets are mutually exclusive. A missing session, missing directory or failed Git resolution is refused before saving, without a remote or cwd fallback. An empty Events list keeps the rule and publishes nothing. Saving installs nothing; installing remains a separate explicit request.
func (AutoPublishRuleRequest) PrepareJSONSchema ¶ added in v0.27.0
func (AutoPublishRuleRequest) PrepareJSONSchema(s *jsonschema.Schema) error
PrepareJSONSchema keeps the existing pattern body and the session-target body distinct in every generated validator, including their property presence.
func (*AutoPublishRuleRequest) UnmarshalJSON ¶ added in v0.27.0
func (r *AutoPublishRuleRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON preserves target exclusivity even when an explicit pattern property is empty. Null is not an omitted session target.
func (AutoPublishRuleRequest) Validate ¶ added in v0.25.0
func (r AutoPublishRuleRequest) Validate() error
Validate checks the mutually exclusive target and each event and collective.
type BatchCreateAnnotationsErrorResponse ¶
type BatchCreateAnnotationsErrorResponse struct {
Error string `json:"error"`
FailingIndex int `json:"failingIndex"`
}
BatchCreateAnnotationsErrorResponse is the JSON error response for POST /api/v1/annotations/batch (400). FailingIndex is the zero-based index of the first annotation that failed validation.
type BatchCreateAnnotationsRequest ¶
type BatchCreateAnnotationsRequest struct {
Annotations []CreateAnnotationRequest `json:"annotations"`
}
BatchCreateAnnotationsRequest is the JSON body for POST /api/v1/annotations/batch. All annotations are committed as a single all-or-nothing SQLite transaction.
type BatchCreateAnnotationsResponse ¶
type BatchCreateAnnotationsResponse struct {
IDs []string `json:"ids"`
}
BatchCreateAnnotationsResponse is the JSON response for POST /api/v1/annotations/batch (201 Created). IDs are returned in the same order as the request Annotations slice.
type BuiltinCommand ¶
type BuiltinCommand string
BuiltinCommand represents a built-in slash command supported by Claude Code. These are first-party commands that ship with the tool (e.g. /exit, /compact). Slash-command entries in transcripts whose name matches a BuiltinCommand are structural signals rather than user-initiated tool calls.
const ( ClaudeBuiltinCmdExit BuiltinCommand = "exit" ClaudeBuiltinCmdCompact BuiltinCommand = "compact" ClaudeBuiltinCmdClear BuiltinCommand = "clear" ClaudeBuiltinCmdNew BuiltinCommand = "new" ClaudeBuiltinCmdModel BuiltinCommand = "model" ClaudeBuiltinCmdUsage BuiltinCommand = "usage" ClaudeBuiltinCmdCost BuiltinCommand = "cost" ClaudeBuiltinCmdContext BuiltinCommand = "context" ClaudeBuiltinCmdPlugin BuiltinCommand = "plugin" ClaudeBuiltinCmdPermissions BuiltinCommand = "permissions" ClaudeBuiltinCmdLogin BuiltinCommand = "login" ClaudeBuiltinCmdResume BuiltinCommand = "resume" ClaudeBuiltinCmdPlan BuiltinCommand = "plan" ClaudeBuiltinCmdFast BuiltinCommand = "fast" ClaudeBuiltinCmdVoice BuiltinCommand = "voice" ClaudeBuiltinCmdTodos BuiltinCommand = "todos" ClaudeBuiltinCmdReloadPlugins BuiltinCommand = "reload-plugins" ClaudeBuiltinCmdSandbox BuiltinCommand = "sandbox" ClaudeBuiltinCmdConfig BuiltinCommand = "config" ClaudeBuiltinCmdStatusline BuiltinCommand = "statusline" ClaudeBuiltinCmdUpgrade BuiltinCommand = "upgrade" ClaudeBuiltinCmdExtraUsage BuiltinCommand = "extra-usage" ClaudeBuiltinCmdRateLimitOptions BuiltinCommand = "rate-limit-options" ClaudeBuiltinCmdPrivacySettings BuiltinCommand = "privacy-settings" ClaudeBuiltinCmdHelp BuiltinCommand = "help" ClaudeBuiltinCmdCommands BuiltinCommand = "commands" )
func (BuiltinCommand) IsValid ¶
func (c BuiltinCommand) IsValid() bool
IsValid returns true if the command is one of the known built-in variants. Derived from AllClaudeBuiltinCmds (single source of truth).
func (BuiltinCommand) JSONSchema ¶
func (BuiltinCommand) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (BuiltinCommand) String ¶
func (c BuiltinCommand) String() string
type CLILoginQuery ¶
type CLILoginQuery struct {
Port int `json:"port" query:"port" required:"true" minimum:"1024" maximum:"65535" description:"Local callback server port"`
State string `json:"state" query:"state" required:"true" description:"OAuth state parameter for CSRF protection"`
}
CLILoginQuery represents the query parameters for the CLI login initiation endpoint. GET /api/v1/auth/cli/login?port={port}&state={state}
Both parameters are required: Village refuses a request missing either with 400, as it does a port that is not an integer from 1024 to 65535, the range the port declares.
type CanonicalPublishGitContext ¶
type CanonicalPublishGitContext struct {
Branch *string `json:"branch"`
Remote *string `json:"remote"`
Worktree *string `json:"worktree"`
Tracking *string `json:"tracking"`
Commits []AuthoritativeCommitInfo `json:"commits" nullable:"false"`
}
type CanonicalPublishOperation ¶
type CanonicalPublishOperation struct {
Replacement CanonicalPublishReplacement `json:"replacement"`
License PublishLicenseOperation `json:"license"`
Associations PublishAssociationOperation `json:"associations"`
ContentHash TranscriptContentHash `json:"contentHash"`
}
func CanonicalizePublishRequest ¶
func CanonicalizePublishRequest(request AuthoritativePublishRequest) (CanonicalPublishOperation, error)
func DecodeCanonicalPublishOperation ¶
func DecodeCanonicalPublishOperation(data []byte) (CanonicalPublishOperation, error)
func (CanonicalPublishOperation) Validate ¶
func (operation CanonicalPublishOperation) Validate() error
type CanonicalPublishReplacement ¶
type CanonicalPublishReplacement struct {
Identity AuthoritativeSessionIdentity `json:"identity"`
Model AuthoritativeModelInfo `json:"model"`
Timestamp AuthoritativeTimestampInfo `json:"timestamp"`
Source AuthoritativeSourceInfo `json:"source"`
Git CanonicalPublishGitContext `json:"git"`
Project AuthoritativeProjectContext `json:"project"`
Stats AuthoritativeSessionStats `json:"stats"`
Quality *AuthoritativeQualityMetrics `json:"quality"`
Entries []AuthoritativeSessionEntry `json:"entries" nullable:"false"`
Subagents []AuthoritativeSubagentRef `json:"subagents" nullable:"false"`
Diagnostics AuthoritativeDiagnosticsInfo `json:"diagnostics"`
}
type ChangeBinding ¶
type ChangeBinding string
ChangeBinding states how strongly a session is tied to a change (contract §2 binding rule, spec §6.2).
const ( ChangeBindingBound ChangeBinding = "bound" ChangeBindingCandidate ChangeBinding = "candidate" )
ChangeBinding values. A session is bound when at least one of its linked commits is contained in the branch AND its recorded edits overlap the branch's changed files; one-arm matches (or git_branch equality alone) are candidates. Candidates are never silently dropped.
func (ChangeBinding) IsValid ¶
func (b ChangeBinding) IsValid() bool
IsValid reports whether b is one of the defined bindings.
func (ChangeBinding) JSONSchema ¶
func (ChangeBinding) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ChangeBinding) String ¶
func (b ChangeBinding) String() string
String returns the wire representation of the binding.
type ChangeDetailPayload ¶
type ChangeDetailPayload struct {
Branch string `json:"branch"`
BaseRef string `json:"baseRef"` // merge-base hash
DefaultBranch string `json:"defaultBranch"`
Files []FileChange `json:"files"`
Slice MapSlice `json:"slice"` // touched nodes + 1-hop
NewEdges []MapEdge `json:"newEdges"`
RemovedEdges []MapEdge `json:"removedEdges"`
NewNodes []string `json:"newNodes"` // node IDs
RemovedNodes []string `json:"removedNodes"`
Violations []EdgeViolation `json:"violations"` // NEW violations introduced by this change
Work []ChangeSession `json:"work"`
UnrecordedCommits []CommitRef `json:"unrecordedCommits"`
// Unusual holds NEUTRAL rate-elevation observations vs the project baseline
// (e.g. more retry loops per conversation than usual) — facts, never a
// verdict or grade.
Unusual []UnusualSignal `json:"unusual"`
// Frictions holds NEUTRAL recurring-friction counts keyed by (kind, file):
// "this kind of friction touched this file N times across M conversations"
// Facts are for orientation, never a verdict.
Frictions []FrictionCluster `json:"frictions"`
// Insights carries mechanical and mined insight envelopes for this change.
// It is additive alongside Unusual/Frictions above, never a replacement
// for them.
Insights []SessionInsight `json:"insights" required:"true" nullable:"false"`
LinesAdded int `json:"linesAdded"`
LinesRemoved int `json:"linesRemoved"`
OutputTokens int64 `json:"outputTokens"` // SUM of output_tokens over bound sessions
CostUsd *float64 `json:"costUsd,omitempty"`
}
ChangeDetailPayload backs the Review change-detail surface, served by GET /api/v1/review/{projectHash}/change?branch=<name>.
func NewChangeDetailPayload ¶
func NewChangeDetailPayload(branch string) *ChangeDetailPayload
NewChangeDetailPayload returns a ChangeDetailPayload with all slices (including the nested MapSlice's) initialized to empty (never-nil marshal guarantee).
func (ChangeDetailPayload) Validate ¶
func (p ChangeDetailPayload) Validate() error
Validate checks that Insights is non-nil and every entry is well-formed, including the Classification-must-be-nil rule. It also validates each UnrecordedCommit's shape. Other ChangeDetailPayload fields do not currently define validation rules here.
type ChangeDiffPayload ¶
type ChangeDiffPayload struct {
Branch string `json:"branch"`
File string `json:"file"` // the new path
OldPath *string `json:"oldPath,omitempty"`
Status FileChangeStatus `json:"status"`
Binary bool `json:"binary"`
Truncated bool `json:"truncated"`
Hunks []DiffHunk `json:"hunks"`
}
ChangeDiffPayload is the rendered unified diff of ONE changed file of a change (branch vs its merge-base with the default branch) — the lazy per-file companion to ChangeDetailPayload (contract §3, GET /review/{projectHash}/diff ?branch=&file=). Binary files come back Binary=true with no hunks; files exceeding the size cap come back Truncated.
func NewChangeDiffPayload ¶
func NewChangeDiffPayload(branch, file string) *ChangeDiffPayload
NewChangeDiffPayload returns a ChangeDiffPayload with Hunks initialized to empty (never-nil marshal guarantee).
type ChangeSession ¶
type ChangeSession struct {
SessionID string `json:"sessionId"`
Title string `json:"title"`
Harness string `json:"harness"`
StartMs *int64 `json:"startMs,omitempty"`
Binding ChangeBinding `json:"binding"` // bound = commit-in-branch AND touch overlap; candidate = one arm only
Tasks []TaskSummary `json:"tasks"`
}
ChangeSession is one recorded session behind a change, with its tasks.
func NewChangeSession ¶
func NewChangeSession(sessionID string, binding ChangeBinding) ChangeSession
NewChangeSession returns a ChangeSession with all slices initialized to empty (never-nil marshal guarantee).
type ChangeSummary ¶
type ChangeSummary struct {
Branch string `json:"branch"`
AheadCount int `json:"aheadCount"`
BehindCount int `json:"behindCount"`
FilesChanged int `json:"filesChanged"`
SessionCount int `json:"sessionCount"`
TaskCount int `json:"taskCount"`
NewEdges int `json:"newEdges"`
RemovedEdges int `json:"removedEdges"`
Violations int `json:"violations"`
LastWorkMs *int64 `json:"lastWorkMs,omitempty"`
Merged bool `json:"merged"`
MergedAtMs *int64 `json:"mergedAtMs,omitempty"`
// Reverted is true when this change was merged and later undone by a
// `git revert` on the default branch (git-native signal only).
Reverted bool `json:"reverted,omitempty"`
// Graph anchors (Changes graph): how this row attaches to lane 0
// (ReviewListPayload.RecentCommits). Open branches fork at BaseHash and
// sit at TipCommitMs; merged rows rejoin at MergeCommitHash.
BaseHash string `json:"baseHash,omitempty"` // merge-base commit hash (fork anchor; open branches)
TipCommitMs *int64 `json:"tipCommitMs,omitempty"` // branch tip committer time (row position; open branches)
MergeCommitHash string `json:"mergeCommitHash,omitempty"` // merge commit hash (join anchor; merged rows)
}
ChangeSummary is one row of the Review list: a local branch measured against the default branch.
type ChannelSubscription ¶
type ChannelSubscription struct {
Topic ChannelTopic `json:"topic"`
ID string `json:"id,omitempty"`
Axis AnnotationAxis `json:"axis,omitempty"`
}
ChannelSubscription describes a single channel subscription. Topic is always required. Additional fields are topic-specific:
- TopicSessionDetail: ID = session ID
- TopicAnnotations: Axis + ID
type ChannelTopic ¶
type ChannelTopic string
ChannelTopic identifies a subscribable data stream.
const ( TopicDashboard ChannelTopic = "dashboard" TopicSessions ChannelTopic = "sessions" TopicSessionDetail ChannelTopic = "session_detail" TopicTrends ChannelTopic = "trends" TopicQuality ChannelTopic = "quality" TopicAnnotations ChannelTopic = "annotations" TopicProjectFamiliarity ChannelTopic = "project_familiarity" TopicKickstart ChannelTopic = "kickstart" )
func (ChannelTopic) IsValid ¶
func (t ChannelTopic) IsValid() bool
IsValid reports whether t is a defined WebSocket channel topic.
func (ChannelTopic) JSONSchema ¶
func (ChannelTopic) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ChannelTopic) String ¶
func (t ChannelTopic) String() string
String returns the wire representation of the channel topic.
type ChildSessionPage ¶ added in v0.67.0
type ChildSessionPage struct {
ParentSessionID SessionID `json:"parentSessionId"`
Items []ChildSessionSummary `json:"items" nullable:"false"`
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
PerPage PageSize `json:"perPage"`
HasMore bool `json:"hasMore"`
}
ChildSessionPage is one bounded page of child (subagent) session summaries for a stored parent session.
func (ChildSessionPage) Validate ¶ added in v0.67.0
func (p ChildSessionPage) Validate() error
Validate checks page bounds, closed per-page size, and each child summary.
type ChildSessionRef ¶
type ChildSessionRef struct {
ID string `json:"id"`
StartTime time.Time `json:"startTime"`
Project string `json:"project,omitempty"`
}
ChildSessionRef is a lightweight reference to a child (subagent) session.
type ChildSessionSummary ¶ added in v0.67.0
type ChildSessionSummary struct {
ID SessionID `json:"id"`
Title string `json:"title,omitempty"`
Harness Harness `json:"harness"`
Model string `json:"model,omitempty"`
Status string `json:"status,omitempty"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
TurnCount int `json:"turnCount" minimum:"0" maximum:"9007199254740991"`
Project string `json:"project,omitempty"`
}
ChildSessionSummary is one bounded child (subagent) session entry returned by the paged child-sessions read for progressive subagent card hydration.
func (ChildSessionSummary) Validate ¶ added in v0.67.0
func (c ChildSessionSummary) Validate() error
Validate checks that the child summary has a valid session ID, known harness, and nonnegative safe-integer turn count.
type ClaudeCodeCompactionDetails ¶ added in v0.66.0
type ClaudeCodeCompactionDetails struct {
Trigger ClaudeCodeCompactionTrigger `json:"trigger"`
PreTokens *int64 `json:"preTokens,omitempty"`
PostTokens *int64 `json:"postTokens,omitempty"`
DurationMs *int64 `json:"durationMs,omitempty"`
}
ClaudeCodeCompactionDetails holds the structured facts Claude Code records in compactMetadata on a compact_boundary system entry.
type ClaudeCodeCompactionTrigger ¶ added in v0.66.0
type ClaudeCodeCompactionTrigger string
ClaudeCodeCompactionTrigger identifies how a Claude Code compaction boundary was initiated.
const ( ClaudeCodeCompactionTriggerAuto ClaudeCodeCompactionTrigger = "auto" ClaudeCodeCompactionTriggerManual ClaudeCodeCompactionTrigger = "manual" )
func NewClaudeCodeCompactionTrigger ¶ added in v0.66.0
func NewClaudeCodeCompactionTrigger(raw string) (ClaudeCodeCompactionTrigger, error)
func (ClaudeCodeCompactionTrigger) IsValid ¶ added in v0.66.0
func (v ClaudeCodeCompactionTrigger) IsValid() bool
func (ClaudeCodeCompactionTrigger) JSONSchema ¶ added in v0.66.0
func (ClaudeCodeCompactionTrigger) JSONSchema() (jsonschema.Schema, error)
func (ClaudeCodeCompactionTrigger) String ¶ added in v0.66.0
func (v ClaudeCodeCompactionTrigger) String() string
type ClientMessage ¶
type ClientMessage struct {
Type MessageType `json:"type"`
Channels []ChannelSubscription `json:"channels,omitempty"`
Preview *LocalKickstartPreviewRequest `json:"preview,omitempty"`
}
ClientMessage is sent from the browser to the server via WebSocket.
type CollectiveEvidenceCoverage ¶ added in v0.31.0
type CollectiveEvidenceCoverage string
const ( CollectiveEvidenceCoverageAvailable CollectiveEvidenceCoverage = "available" CollectiveEvidenceCoverageUnknown CollectiveEvidenceCoverage = "unknown" )
func (CollectiveEvidenceCoverage) IsValid ¶ added in v0.31.0
func (v CollectiveEvidenceCoverage) IsValid() bool
func (CollectiveEvidenceCoverage) JSONSchema ¶ added in v0.31.0
func (CollectiveEvidenceCoverage) JSONSchema() (jsonschema.Schema, error)
type CollectiveFetchAssociationResults ¶ added in v0.31.0
type CollectiveFetchAssociationResults struct {
Requested int `json:"requested" minimum:"0" maximum:"10000"`
Completed int `json:"completed" minimum:"0" maximum:"10000"`
Failed int `json:"failed" minimum:"0" maximum:"10000"`
Scopes []CollectiveFetchAssociationScopeResult `json:"scopes" maxItems:"10000" nullable:"false"`
}
func (*CollectiveFetchAssociationResults) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchAssociationResults) UnmarshalJSON(data []byte) error
type CollectiveFetchAssociationScopeResult ¶ added in v0.31.0
type CollectiveFetchAssociationScopeResult struct {
TranscriptID TranscriptID `json:"transcriptId"`
State CollectiveFetchState `json:"state"`
Commit CollectiveFetchCommit `json:"commit"`
ObservedAt *time.Time `json:"observedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
Issue *OperationIssue `json:"issue,omitempty"`
}
func (*CollectiveFetchAssociationScopeResult) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchAssociationScopeResult) UnmarshalJSON(data []byte) error
type CollectiveFetchCommit ¶ added in v0.31.0
type CollectiveFetchCommit string
const ( CollectiveFetchCommitUpdated CollectiveFetchCommit = "updated" CollectiveFetchCommitUnchanged CollectiveFetchCommit = "unchanged" CollectiveFetchCommitRetained CollectiveFetchCommit = "retained" )
func (CollectiveFetchCommit) IsValid ¶ added in v0.31.0
func (v CollectiveFetchCommit) IsValid() bool
func (CollectiveFetchCommit) JSONSchema ¶ added in v0.31.0
func (CollectiveFetchCommit) JSONSchema() (jsonschema.Schema, error)
type CollectiveFetchDomain ¶ added in v0.31.0
type CollectiveFetchDomain string
const ( CollectiveFetchDomainCatalog CollectiveFetchDomain = "catalog" CollectiveFetchDomainHistory CollectiveFetchDomain = "history" CollectiveFetchDomainAssociations CollectiveFetchDomain = "associations" )
func (CollectiveFetchDomain) IsValid ¶ added in v0.31.0
func (v CollectiveFetchDomain) IsValid() bool
func (CollectiveFetchDomain) JSONSchema ¶ added in v0.31.0
func (CollectiveFetchDomain) JSONSchema() (jsonschema.Schema, error)
type CollectiveFetchDomainResult ¶ added in v0.31.0
type CollectiveFetchDomainResult struct {
Domain CollectiveFetchDomain `json:"domain"`
Requested bool `json:"requested"`
State CollectiveFetchState `json:"state"`
Commit CollectiveFetchCommit `json:"commit"`
StartedAt *time.Time `json:"startedAt,omitempty"`
LastAttemptAt *time.Time `json:"lastAttemptAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
LastCompletedAt *time.Time `json:"lastCompletedAt,omitempty"`
LastInstalledRevision *string `json:"lastInstalledRevision,omitempty"`
Coverage CollectiveEvidenceCoverage `json:"coverage"`
SourceOutcomes []CollectiveFetchSourceResult `json:"sourceOutcomes" maxItems:"10000" nullable:"false"`
Associations *CollectiveFetchAssociationResults `json:"associations,omitempty"`
Issue *OperationIssue `json:"issue,omitempty"`
}
func (*CollectiveFetchDomainResult) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchDomainResult) UnmarshalJSON(data []byte) error
func (CollectiveFetchDomainResult) Validate ¶ added in v0.31.0
func (d CollectiveFetchDomainResult) Validate() error
type CollectiveFetchDomainSummary ¶ added in v0.31.0
type CollectiveFetchDomainSummary struct {
LastAttemptAt *time.Time `json:"lastAttemptAt,omitempty"`
LastCompletedAt *time.Time `json:"lastCompletedAt,omitempty"`
LastInstalledRevision *string `json:"lastInstalledRevision,omitempty"`
State CollectiveFetchState `json:"state"`
Coverage CollectiveEvidenceCoverage `json:"coverage"`
Issue *OperationIssue `json:"issue,omitempty"`
}
func (*CollectiveFetchDomainSummary) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchDomainSummary) UnmarshalJSON(data []byte) error
func (CollectiveFetchDomainSummary) Validate ¶ added in v0.31.0
func (s CollectiveFetchDomainSummary) Validate() error
type CollectiveFetchOutcome ¶ added in v0.31.0
type CollectiveFetchOutcome string
const ( CollectiveFetchOutcomeComplete CollectiveFetchOutcome = "complete" CollectiveFetchOutcomePartial CollectiveFetchOutcome = "partial" CollectiveFetchOutcomeFailed CollectiveFetchOutcome = "failed" )
func (CollectiveFetchOutcome) IsValid ¶ added in v0.31.0
func (v CollectiveFetchOutcome) IsValid() bool
func (CollectiveFetchOutcome) JSONSchema ¶ added in v0.31.0
func (CollectiveFetchOutcome) JSONSchema() (jsonschema.Schema, error)
type CollectiveFetchReport ¶ added in v0.31.0
type CollectiveFetchReport struct {
Scope CollectiveObservationScope `json:"scope"`
InvocationID VillageUUID `json:"invocationId"`
CacheRevision string `json:"cacheRevision" pattern:"^(0|[1-9][0-9]{0,19})$"`
Outcome CollectiveFetchOutcome `json:"outcome"`
Domains []CollectiveFetchDomainResult `json:"domains" minItems:"3" maxItems:"3" nullable:"false"`
Issues []OperationIssue `json:"issues" maxItems:"10000" nullable:"false"`
}
func (*CollectiveFetchReport) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchReport) UnmarshalJSON(data []byte) error
func (CollectiveFetchReport) Validate ¶ added in v0.31.0
func (r CollectiveFetchReport) Validate() error
type CollectiveFetchSourceResult ¶ added in v0.31.0
type CollectiveFetchSourceResult struct {
Source CollectiveObservationSource `json:"source"`
Outcome CollectiveSourceOutcome `json:"outcome"`
ObservedAt *time.Time `json:"observedAt,omitempty"`
Complete bool `json:"complete"`
Issue *OperationIssue `json:"issue,omitempty"`
}
func (*CollectiveFetchSourceResult) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchSourceResult) UnmarshalJSON(data []byte) error
type CollectiveFetchState ¶ added in v0.31.0
type CollectiveFetchState string
const ( CollectiveFetchStateComplete CollectiveFetchState = "complete" CollectiveFetchStateFailed CollectiveFetchState = "failed" CollectiveFetchStateCancelled CollectiveFetchState = "cancelled" CollectiveFetchStateSuperseded CollectiveFetchState = "superseded" CollectiveFetchStateNotRequested CollectiveFetchState = "not_requested" )
func (CollectiveFetchState) IsValid ¶ added in v0.31.0
func (v CollectiveFetchState) IsValid() bool
func (CollectiveFetchState) JSONSchema ¶ added in v0.31.0
func (CollectiveFetchState) JSONSchema() (jsonschema.Schema, error)
type CollectiveFetchSummary ¶ added in v0.31.0
type CollectiveFetchSummary struct {
LastCompletedFetchAt *time.Time `json:"lastCompletedFetchAt,omitempty"`
LastAttemptAt *time.Time `json:"lastAttemptAt,omitempty"`
LatestReport *CollectiveFetchReport `json:"latestReport,omitempty"`
Catalog CollectiveFetchDomainSummary `json:"catalog"`
History CollectiveFetchDomainSummary `json:"history"`
Associations CollectiveFetchDomainSummary `json:"associations"`
}
func (*CollectiveFetchSummary) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveFetchSummary) UnmarshalJSON(data []byte) error
func (CollectiveFetchSummary) Validate ¶ added in v0.31.0
func (s CollectiveFetchSummary) Validate() error
type CollectiveObservation ¶ added in v0.31.0
type CollectiveObservation struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
AcceptanceMode *VillageGroupAcceptanceMode `json:"acceptanceMode,omitempty"`
DataAccess *VillageGroupDataAccess `json:"dataAccess,omitempty"`
Reasons []CollectiveObservationReason `json:"reasons" nullable:"false" maxItems:"4"`
ObservedAt time.Time `json:"observedAt"`
State CollectiveObservationState `json:"state"`
}
func (*CollectiveObservation) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveObservation) UnmarshalJSON(data []byte) error
func (CollectiveObservation) Validate ¶ added in v0.31.0
func (o CollectiveObservation) Validate() error
type CollectiveObservationReason ¶ added in v0.31.0
type CollectiveObservationReason string
const ( CollectiveObservationReasonMembership CollectiveObservationReason = "membership" CollectiveObservationReasonContribution CollectiveObservationReason = "contribution" CollectiveObservationReasonOrganization CollectiveObservationReason = "organization" CollectiveObservationReasonExplicit CollectiveObservationReason = "explicit" )
func (CollectiveObservationReason) IsValid ¶ added in v0.31.0
func (v CollectiveObservationReason) IsValid() bool
func (CollectiveObservationReason) JSONSchema ¶ added in v0.31.0
func (CollectiveObservationReason) JSONSchema() (jsonschema.Schema, error)
type CollectiveObservationResponse ¶ added in v0.31.0
type CollectiveObservationResponse struct {
Scope CollectiveObservationScope `json:"scope"`
CacheRevision string `json:"cacheRevision" pattern:"^(0|[1-9][0-9]{0,19})$"`
Collectives []CollectiveObservation `json:"collectives" maxItems:"10000" nullable:"false"`
Fetch CollectiveFetchSummary `json:"fetch"`
}
func (*CollectiveObservationResponse) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveObservationResponse) UnmarshalJSON(data []byte) error
func (CollectiveObservationResponse) Validate ¶ added in v0.31.0
func (r CollectiveObservationResponse) Validate() error
type CollectiveObservationScope ¶ added in v0.31.0
type CollectiveObservationScope struct {
VillageURL string `json:"villageUrl" maxLength:"1024"`
UserID VillageUUID `json:"userId"`
}
CollectiveObservationScope identifies private evidence, never credentials or authority. The caller selects its authenticated scope before validating tokens.
func NormalizeCollectiveObservationScope ¶ added in v0.31.0
func NormalizeCollectiveObservationScope(raw string, userID VillageUUID) (CollectiveObservationScope, error)
func (*CollectiveObservationScope) UnmarshalJSON ¶ added in v0.31.0
func (v *CollectiveObservationScope) UnmarshalJSON(data []byte) error
func (CollectiveObservationScope) Validate ¶ added in v0.31.0
func (s CollectiveObservationScope) Validate() error
type CollectiveObservationSource ¶ added in v0.31.0
type CollectiveObservationSource string
const ( CollectiveObservationSourceMembership CollectiveObservationSource = "membership" CollectiveObservationSourceContributionDiscovery CollectiveObservationSource = "contribution-discovery" CollectiveObservationSourceOrganization CollectiveObservationSource = "organization" CollectiveObservationSourceExplicit CollectiveObservationSource = "explicit" CollectiveObservationSourceSubmissions CollectiveObservationSource = "submissions" CollectiveObservationSourceAttempts CollectiveObservationSource = "attempts" CollectiveObservationSourceAssociations CollectiveObservationSource = "associations" )
func (CollectiveObservationSource) IsValid ¶ added in v0.31.0
func (v CollectiveObservationSource) IsValid() bool
func (CollectiveObservationSource) JSONSchema ¶ added in v0.31.0
func (CollectiveObservationSource) JSONSchema() (jsonschema.Schema, error)
type CollectiveObservationState ¶ added in v0.31.0
type CollectiveObservationState string
const ( CollectiveObservationStateObserved CollectiveObservationState = "observed" CollectiveObservationStateInvalidated CollectiveObservationState = "invalidated" )
func (CollectiveObservationState) IsValid ¶ added in v0.31.0
func (v CollectiveObservationState) IsValid() bool
func (CollectiveObservationState) JSONSchema ¶ added in v0.31.0
func (CollectiveObservationState) JSONSchema() (jsonschema.Schema, error)
type CollectiveOperation ¶ added in v0.31.0
type CollectiveOperation string
const ( CollectiveOperationPublish CollectiveOperation = "publish" CollectiveOperationFetch CollectiveOperation = "fetch" CollectiveOperationPull CollectiveOperation = "pull" )
func (CollectiveOperation) IsValid ¶ added in v0.31.0
func (v CollectiveOperation) IsValid() bool
func (CollectiveOperation) JSONSchema ¶ added in v0.31.0
func (CollectiveOperation) JSONSchema() (jsonschema.Schema, error)
type CollectiveSourceOutcome ¶ added in v0.31.0
type CollectiveSourceOutcome string
const ( CollectiveSourceDisclosed CollectiveSourceOutcome = "disclosed" CollectiveSourceNotDisclosed CollectiveSourceOutcome = "not_disclosed" CollectiveSourceFailed CollectiveSourceOutcome = "failed" )
func (CollectiveSourceOutcome) IsValid ¶ added in v0.31.0
func (v CollectiveSourceOutcome) IsValid() bool
func (CollectiveSourceOutcome) JSONSchema ¶ added in v0.31.0
func (CollectiveSourceOutcome) JSONSchema() (jsonschema.Schema, error)
type CommandInvocation ¶ added in v0.17.0
CommandInvocation records that a turn invoked a skill or a user-defined slash command rather than typing a prompt. Name is slash-prefixed, for example "/superpowers:brainstorming". Args is the text that followed the command on the same line and may be empty. A harness that records a bare command name gets the slash added by the producer before construction; the constructor does not add it.
Built-in harness commands (see BuiltinCommand) are structural signals and are never emitted as a CommandInvocation.
Compatibility: the field is optional and safely ignorable. The invocation name is already present in the turn's content text, so a consumer that drops the field loses a structured duplicate, not meaning, provenance, or safety. Under docs/content-capability-negotiation.md that is an additive minor bump with no content-capability token.
func NewCommandInvocation ¶ added in v0.17.0
func NewCommandInvocation(name, args string) (CommandInvocation, error)
NewCommandInvocation validates and constructs a CommandInvocation. Name must be a single slash-prefixed token that is not a built-in harness command. Args is carried as given.
func (CommandInvocation) Validate ¶ added in v0.17.0
func (c CommandInvocation) Validate() error
Validate reports whether c would be accepted by NewCommandInvocation.
type CommitInfo ¶
type CommitInfo struct {
Hash string `json:"hash"` // commit SHA-1 (full or abbreviated)
Message string `json:"message"` // commit message first line
AuthorName string `json:"authorName"` // author display name
AuthorEmail string `json:"authorEmail"` // author email (used for attribution filtering)
CommitTime int64 `json:"commitTime"` // committer date, Unix millis
AuthorTime int64 `json:"authorTime"` // author date, Unix millis
// Repository is the canonical repository the commit belongs to (remote URL
// or owner/name, as the enclosing metadata defines remote identity: the
// GitContext remote for a session's git context, or the publish
// replacement's git remote). Absent or empty means the commit belongs to
// the session's own git_remote. Only a commit recorded in a repository
// other than the session's working repository (a polyrepo root session, a
// subagent worktree) carries it, so a reader cannot derive the value from
// anything else it receives.
Repository string `` /* 333-byte string literal not displayed */
}
CommitInfo records a single git commit linked to a session.
type CommitRef ¶
type CommitRef struct {
Hash string `json:"hash" yaml:"hash"`
Subject string `json:"subject" yaml:"subject"`
TimeMs *int64 `json:"timeMs,omitempty" yaml:"timeMs,omitempty"`
HasSession bool `json:"hasSession" yaml:"hasSession"` // compatibility mirror of len(SessionIDs) > 0
// SessionIDs names authoritative session_commits bindings in the same
// strictly increasing rank order as ReviewListPayload.Sessions.
SessionIDs []SessionID `json:"sessionIds" yaml:"sessionIds" required:"true" nullable:"false"`
// Associations keeps each SessionIDs binding as a first-class durable
// relationship with its conclusion, confidence, and atomic observations. It
// mirrors SessionIDs one-for-one in the same rank order:
// Associations[i].SessionID == SessionIDs[i] for every i.
Associations []SessionAssociation `json:"associations" yaml:"associations" required:"true" nullable:"false"`
}
CommitRef is lightweight commit metadata for time strips and rail panels.
func NewCommitRef ¶
NewCommitRef returns commit metadata with non-nil session ID and association arrays.
type Confidence ¶
type Confidence string
Confidence classifies how strongly the evidence behind a derived relationship (a session<->commit association, or a ghost-commit rewrite resolution) supports its conclusion.
const ( ConfidenceHigh Confidence = "high" ConfidenceMedium Confidence = "medium" ConfidenceLow Confidence = "low" )
Confidence values.
func (Confidence) IsValid ¶
func (c Confidence) IsValid() bool
IsValid reports whether c is one of the defined confidence levels.
func (Confidence) JSONSchema ¶
func (Confidence) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (Confidence) String ¶
func (c Confidence) String() string
String returns the wire representation of the confidence level.
func (Confidence) Validate ¶
func (c Confidence) Validate() error
Validate rejects values that cannot cross the confidence wire boundary.
type ContentCapability ¶ added in v0.1.1
type ContentCapability string
ContentCapability identifies an optional transcript-content behavior that a client must negotiate before emitting evidence that older servers may lose.
const ( // ContentCapabilityObservedModelV1 guarantees exact observedModel survival // through publish, typed migration, canonical rewrite, and re-emission. Its // meaning is immutable; an incompatible contract requires a new token. ContentCapabilityObservedModelV1 ContentCapability = "observed_model_v1" ContentCapabilityDetailedUsageV1 ContentCapability = "detailed_usage_v1" ContentCapabilityNativeMetadataV1 ContentCapability = "native_metadata_v1" // ContentCapabilitySessionGraphProvenanceV1 guarantees preservation of // durable session relationships, retained history, submission counts, and // per-block provenance. ContentCapabilitySessionGraphProvenanceV1 ContentCapability = "session_graph_provenance_v1" // ContentCapabilityToolNamespaceV1 guarantees exact separate namespace // presence and value survival, including an explicitly recorded empty string. ContentCapabilityToolNamespaceV1 ContentCapability = "tool_namespace_v1" // ContentCapabilityRetainedUnknownV1 guarantees complete redacted unknown // payload, source location, order, and partial-interpretation preservation. ContentCapabilityRetainedUnknownV1 ContentCapability = "retained_unknown_v1" // ContentCapabilityThinkingLevelV1 guarantees validated, byte-exact // preservation of thinkingLevel/thinkingLevelRaw (and their absence) on the // session detail and every turn. ContentCapabilityThinkingLevelV1 ContentCapability = "thinking_level_v1" // ContentCapabilityContentPartsV1 guarantees validated, ordered // preservation of TurnDetail.contentParts through storage, typed migration, // rewrite, serving, and publication, including the published // not_published image shape. ContentCapabilityContentPartsV1 ContentCapability = "content_parts_v1" )
func KnownContentCapabilities ¶ added in v0.1.1
func KnownContentCapabilities(advertised []ContentCapability) []ContentCapability
KnownContentCapabilities filters unknown discovery tokens, removes duplicates, and returns known tokens in canonical lexicographic order.
func MissingContentCapabilities ¶ added in v0.1.1
func MissingContentCapabilities(advertised, required []ContentCapability) []ContentCapability
MissingContentCapabilities returns required tokens absent from discovery. Unknown discovery tokens are ignored and omitted and empty lists are equal.
func RequiredContentCapabilities ¶ added in v0.1.1
func RequiredContentCapabilities(payload SessionDetailPayload) []ContentCapability
RequiredContentCapabilities scans root and nested turns for optional evidence. The session-level Model seed is legacy metadata and does not require a capability. An observedModel on any assistant turn, including a nested subagent turn, requires observed_model_v1. A thinkingLevel, thinkingLevelRaw, or non-empty thinkingLevelHistory on the detail, or a thinkingLevel or thinkingLevelRaw on any main or earlier-history turn, requires thinking_level_v1. A non-empty ContentParts list on any main or earlier-history turn, text-only or image-bearing, requires content_parts_v1.
func (ContentCapability) IsValid ¶ added in v0.1.1
func (c ContentCapability) IsValid() bool
IsValid reports whether c belongs to the closed capability inventory.
func (ContentCapability) JSONSchema ¶ added in v0.1.1
func (ContentCapability) JSONSchema() (jsonschema.Schema, error)
JSONSchema deliberately leaves discovery tokens forward-open. Go producers still use Validate and AllContentCapabilities as their closed inventory.
func (ContentCapability) Validate ¶ added in v0.1.1
func (c ContentCapability) Validate() error
Validate rejects capability identifiers outside the canonical inventory.
type ContentCapabilityAdvertisementInput ¶ added in v0.19.0
type ContentCapabilityAdvertisementInput struct {
JSON string `yaml:"json"`
}
type ContentCapabilityDetailInput ¶ added in v0.19.0
type ContentCapabilityExpected ¶ added in v0.19.0
type ContentCapabilityExpected struct {
Capabilities []ContentCapability `yaml:"capabilities,omitempty"`
Known []ContentCapability `yaml:"known,omitempty"`
Missing []ContentCapability `yaml:"missing,omitempty"`
Accepted bool `yaml:"accepted,omitempty"`
ErrorContains string `yaml:"error_contains,omitempty"`
}
type ContentCapabilityFixtureNames ¶ added in v0.19.0
type ContentCapabilityProducerInput ¶ added in v0.19.0
type ContentCapabilityProducerInput struct {
Tokens []ContentCapability `yaml:"tokens"`
}
type ContentCapabilitySessionGraphFixtures ¶ added in v0.19.0
type ContentCapabilitySessionGraphFixtures struct {
RequiredNames ContentCapabilityFixtureNames `yaml:"required_names"`
Derivation testcase.Corpus[ContentCapabilityDetailInput, ContentCapabilityExpected] `yaml:"derivation"`
Reader testcase.Corpus[ContentCapabilityAdvertisementInput, ContentCapabilityExpected] `yaml:"reader"`
Producer testcase.Corpus[ContentCapabilityProducerInput, ContentCapabilityExpected] `yaml:"producer"`
}
func DecodeContentCapabilitySessionGraphFixtures ¶ added in v0.19.0
func DecodeContentCapabilitySessionGraphFixtures(data []byte) (ContentCapabilitySessionGraphFixtures, error)
DecodeContentCapabilitySessionGraphFixtures strictly decodes a supplied corpus. Generators use this seam to consume the same YAML bytes.
func LoadContentCapabilitySessionGraphFixtures ¶ added in v0.19.0
func LoadContentCapabilitySessionGraphFixtures() (ContentCapabilitySessionGraphFixtures, error)
LoadContentCapabilitySessionGraphFixtures exposes the canonical source corpus used by Go validation and by generated TypeScript fixture consumers.
type ContentKind ¶
type ContentKind string
ContentKind discriminates the concrete payload carried inside a TranscriptContent envelope. It exists so the village can dispatch on the kind without sniffing the payload, and so future kinds (e.g. raw-jsonl passthrough) can be added without changing the envelope shape.
const ContentKindSessionDetail ContentKind = "session_detail"
ContentKindSessionDetail marks an envelope whose SessionDetail field carries a normalized SessionDetailPayload. It is the only kind peasant currently emits.
func (ContentKind) IsValid ¶
func (k ContentKind) IsValid() bool
IsValid reports whether k is a defined content envelope kind.
func (ContentKind) JSONSchema ¶
func (ContentKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ContentKind) String ¶
func (k ContentKind) String() string
String returns the bare kind string for serialization/log boundaries.
type ContentOrigin ¶ added in v0.19.0
type ContentOrigin string
const ( ContentOriginSubmittedInput ContentOrigin = "submitted_input" ContentOriginHarnessContext ContentOrigin = "harness_context" ContentOriginAgentOutput ContentOrigin = "agent_output" ContentOriginAgentCommunication ContentOrigin = "agent_communication" ContentOriginToolActivity ContentOrigin = "tool_activity" ContentOriginSystemControl ContentOrigin = "system_control" ContentOriginGeneratedSummary ContentOrigin = "generated_summary" ContentOriginUnknown ContentOrigin = "unknown" )
func NewContentOrigin ¶ added in v0.19.0
func NewContentOrigin(raw string) (ContentOrigin, error)
func (ContentOrigin) IsValid ¶ added in v0.19.0
func (v ContentOrigin) IsValid() bool
func (ContentOrigin) JSONSchema ¶ added in v0.19.0
func (ContentOrigin) JSONSchema() (jsonschema.Schema, error)
type ContentOwnership ¶ added in v0.19.0
type ContentOwnership string
const ( ContentOwnershipLocal ContentOwnership = "local" ContentOwnershipInherited ContentOwnership = "inherited" ContentOwnershipUncertain ContentOwnership = "uncertain" )
func NewContentOwnership ¶ added in v0.19.0
func NewContentOwnership(raw string) (ContentOwnership, error)
func (ContentOwnership) IsValid ¶ added in v0.19.0
func (v ContentOwnership) IsValid() bool
func (ContentOwnership) JSONSchema ¶ added in v0.19.0
func (ContentOwnership) JSONSchema() (jsonschema.Schema, error)
type ContentPartDetailFixtureExpected ¶ added in v0.45.0
type ContentPartDetailFixtureExpected struct {
Accepted bool `yaml:"accepted"`
ErrorContains string `yaml:"errorContains,omitempty"`
}
ContentPartDetailFixtureExpected is the accepted outcome and, for a rejection, a substring naming the rule that must refuse.
type ContentPartDetailFixtureInput ¶ added in v0.45.0
type ContentPartDetailFixtureInput struct {
Mode string `yaml:"mode"`
Detail string `yaml:"detail"`
}
ContentPartDetailFixtureInput is one whole detail payload plus the payload mode under test. Detail is a JSON object so a fixture case exercises the raw decoder as well as the payload validator.
type ContentPartDetailFixtures ¶ added in v0.45.0
type ContentPartDetailFixtures struct {
RequiredNames []string `yaml:"requiredCaseNames"`
Cases testcase.Corpus[ContentPartDetailFixtureInput, ContentPartDetailFixtureExpected] `yaml:"cases"`
}
ContentPartDetailFixtures is the detail-level local/published matrix with its exact required-name manifest.
func LoadContentPartDetailFixtures ¶ added in v0.45.0
func LoadContentPartDetailFixtures() (ContentPartDetailFixtures, error)
LoadContentPartDetailFixtures loads the canonical detail-level local/published matrix and proves its exact case-name inventory.
type ContentPartFixtureExpected ¶ added in v0.45.0
type ContentPartFixtureExpected struct {
Accepted bool `yaml:"accepted"`
ErrorContains string `yaml:"errorContains,omitempty"`
}
ContentPartFixtureExpected is the accepted outcome and, for a rejection, a substring naming the rule that must refuse.
type ContentPartFixtureInput ¶ added in v0.45.0
ContentPartFixtureInput is one ordered part plus the validation mode under test. Part is a JSON object so a fixture case exercises the real decoder as well as the validator.
type ContentPartsFixtures ¶ added in v0.45.0
type ContentPartsFixtures struct {
RequiredNames []string `yaml:"requiredCaseNames"`
Cases testcase.Corpus[ContentPartFixtureInput, ContentPartFixtureExpected] `yaml:"cases"`
}
ContentPartsFixtures is the canonical local/published image-part matrix with its exact required-name manifest.
func LoadContentPartsFixtures ¶ added in v0.45.0
func LoadContentPartsFixtures() (ContentPartsFixtures, error)
LoadContentPartsFixtures loads the canonical ordered content-part matrix and proves its exact case-name inventory. The manifest is independent of the corpus so a count-preserving rename still fails.
type ContentProvenance ¶ added in v0.19.0
type ContentProvenance struct {
Origin ContentOrigin `json:"origin" yaml:"origin"`
Actor ActorOrigin `json:"actor" yaml:"actor"`
Delivery DeliveryOrigin `json:"delivery" yaml:"delivery"`
Ownership ContentOwnership `json:"ownership" yaml:"ownership"`
Evidence EvidenceKind `json:"evidence" yaml:"evidence"`
InputModality InputModality `json:"inputModality" yaml:"inputModality"`
SubmissionRef SubmissionRef `json:"submissionRef,omitempty" yaml:"submissionRef"`
}
func (ContentProvenance) Validate ¶ added in v0.19.0
func (p ContentProvenance) Validate() error
type ContractVersion ¶
type ContractVersion string
ContractVersion is the semantic version of a peasant/village WIRE contract. It is a newtype over string so that the version flows through the codebase typed rather than stringly. The same value-type carries BOTH axes (push and pull): they share one semver shape and one comparison/classification machinery, and the field/constant NAME disambiguates the axis (PushContractVersion vs PullContractVersion). See the PushContractVersion alias below.
It tracks the push/village wire SEPARATELY from:
- MetadataSchemaVersion (the on-disk {sessionId}--metadata.json structure), and
- ingest.CurrentIndexVersion (the local indexer evolution),
mirroring the CurrentIndexVersion precedent: a single canonical constant (defaults.PublishSchemaVersion) is the source of truth, bumped on a breaking change to the push wire format.
const ( // LegacyPullContractVersion is the pull envelope every released CLI before // the public owner reads: LegacyPullTranscriptInfo, LegacyPullListResponse // and LegacyPullAnnotation. Village serves it by default, with people // anonymous to the caller blanked. LegacyPullContractVersion ContractVersion = "0.2.0" // PublicOwnerPullContractVersion is the envelope that carries people as // VillagePublicOwner: PullTranscriptInfo, PullListResponse and // PullAnnotation. Village serves it to a client that asks for it. PublicOwnerPullContractVersion ContractVersion = "0.3.0" )
func (ContractVersion) String ¶
func (v ContractVersion) String() string
String returns the bare semver string for serialization boundaries (OpenAPI filenames, JSON tags handled by the marshaller, CLI output).
type ContributionTraversalIdentity ¶ added in v0.31.0
type ContributionTraversalIdentity struct {
Scope CollectiveObservationScope `json:"scope"`
Incarnation VillageUUID `json:"incarnation"`
Kind LocalContributionEvidenceKind `json:"kind"`
Generation string `json:"generation"`
}
ContributionTraversalIdentity is codec input, not an authorization token or a server revision. Generation belongs ONLY to the selected category payload and coverage, never a cache revision, poll timestamp, or joined catalog label.
func ParseContributionTraversalRevision ¶ added in v0.31.0
func ParseContributionTraversalRevision(token ContributionTraversalRevision) (ContributionTraversalIdentity, error)
type ContributionTraversalRevision ¶ added in v0.31.0
type ContributionTraversalRevision string
func EncodeContributionTraversalRevision ¶ added in v0.31.0
func EncodeContributionTraversalRevision(identity ContributionTraversalIdentity) (ContributionTraversalRevision, error)
func (ContributionTraversalRevision) JSONSchema ¶ added in v0.31.0
func (ContributionTraversalRevision) JSONSchema() (jsonschema.Schema, error)
type ContributorBreakdown ¶ added in v0.42.0
type ContributorBreakdown struct {
ContributorID string `json:"contributorId"`
Sessions int `json:"sessions" minimum:"0" maximum:"9007199254740991"`
ActiveWeeks int `json:"activeWeeks" minimum:"0" maximum:"9007199254740991"`
TotalTokens int `json:"totalTokens" minimum:"0" maximum:"9007199254740991"`
TotalDurationMins int `json:"totalDurationMins" minimum:"0" maximum:"9007199254740991"`
TotalTurns int `json:"totalTurns" minimum:"0" maximum:"9007199254740991"`
TotalToolCalls int `json:"totalToolCalls" minimum:"0" maximum:"9007199254740991"`
SessionsWithCommit int `json:"sessionsWithCommit" minimum:"0" maximum:"9007199254740991"`
TotalCommits int `json:"totalCommits" minimum:"0" maximum:"9007199254740991"`
Outcomes OutcomeDistribution `json:"outcomes"`
FirstSeen *string `json:"firstSeen"`
LastSeen *string `json:"lastSeen"`
}
ContributorBreakdown is one contributor's tally inside the analytics bundle. FirstSeen and LastSeen are day keys (YYYY-MM-DD), null when the contributor has no dated session.
type ConversationTurnSpan ¶ added in v0.51.0
type ConversationTurnSpan struct {
// Before is the number of conversation turns in every earlier segment of
// the session, including segments on earlier directory pages. It starts at 0.
Before int `json:"before" minimum:"0" maximum:"9007199254740991"`
// Count is the number of conversation turns in this segment. It may be 0.
Count int `json:"count" minimum:"0" maximum:"9007199254740991"`
}
ConversationTurnSpan is a pair of counts, never a turn identity. A reader's range for the segment is Before+1 through Before+Count.
type CookedTurn ¶ added in v0.54.0
CookedTurn describes one stored row's membership and its identity in the served partition. A removed row has ServedPosition -1 and no DisplayNumber.
func CookTranscriptRows ¶ added in v0.54.0
func CookTranscriptRows(turns []TranscriptCookTurn, harness Harness) ([]CookedTurn, error)
CookTranscriptRows filters, deduplicates and numbers one partition using the same exact-name rule as the whole-document reader. Pi skips the legacy prefilter. A refusal returns no partial verdicts.
type CreateAnnotationRequest ¶
type CreateAnnotationRequest struct {
SessionID string `json:"sessionId"`
TypeID string `json:"typeId"`
Value string `json:"value"`
IsPrimary bool `json:"isPrimary"`
Confidence *float64 `json:"confidence,omitempty"`
Reason *string `json:"reason,omitempty"`
AnnotatorName string `json:"annotatorName,omitempty"`
// Entry-level targeting — if set, creates an annotation_target_entry row.
// TargetEntryEndIndex defaults to TargetEntryIndex+1 (single-entry span) when omitted.
TargetEntryIndex *int `json:"targetEntryIndex,omitempty"`
TargetEntryEndIndex *int `json:"targetEntryEndIndex,omitempty"`
// Meta-annotation targeting — if set, creates an annotation_target_annotation row.
TargetAnnotationID *string `json:"targetAnnotationId,omitempty"`
}
CreateAnnotationRequest is the JSON body for POST /api/v1/annotations. Target selection rules (mutually exclusive):
- Session-level: SessionID set, no entry/annotation fields.
- Entry-level: SessionID + TargetEntryIndex set; TargetEntryEndIndex optional (defaults to index+1).
- Meta-annotation: TargetAnnotationID set (annotation on annotation).
type CreateAnnotationResponse ¶
type CreateAnnotationResponse struct {
ID string `json:"id"`
}
CreateAnnotationResponse is the JSON response for POST /api/v1/annotations (201 Created).
type DashboardPayload ¶
type DashboardPayload struct {
TotalSessions int `json:"totalSessions"`
TotalTokens int `json:"totalTokens"`
AvgDurationMins float64 `json:"avgDurationMins"`
HarnessBreakdown map[Harness]int `json:"harnessBreakdown"`
// AvgTurnsPerSession is the mean conversationTurnCount per session.
AvgTurnsPerSession float64 `json:"avgTurnsPerSession"`
AcceptanceRate float64 `json:"acceptanceRate"`
}
DashboardPayload is the data sent on the dashboard WebSocket channel.
type DayStats ¶
type DayStats struct {
Date string `json:"date"` // "2006-01-02" format
Tokens int `json:"tokens"`
Sessions int `json:"sessions"`
}
DayStats holds aggregated data for a single day in trends.
type DecayLevel ¶
type DecayLevel string
DecayLevel classifies how recently a file was engaged.
const ( DecayFresh DecayLevel = "fresh" DecayFading DecayLevel = "fading" DecayStale DecayLevel = "stale" DecayUnexplored DecayLevel = "unexplored" )
func (DecayLevel) IsValid ¶
func (d DecayLevel) IsValid() bool
IsValid reports whether d is a defined familiarity decay level.
func (DecayLevel) JSONSchema ¶
func (DecayLevel) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (DecayLevel) String ¶
func (d DecayLevel) String() string
type DeliveryOrigin ¶ added in v0.19.0
type DeliveryOrigin string
const ( DeliveryOriginSessionAdmission DeliveryOrigin = "session_admission" DeliveryOriginGuardianReview DeliveryOrigin = "guardian_review" DeliveryOriginSubagentDelivery DeliveryOrigin = "subagent_delivery" DeliveryOriginInheritedContext DeliveryOrigin = "inherited_context" DeliveryOriginToolDelivery DeliveryOrigin = "tool_delivery" DeliveryOriginSystemLifecycle DeliveryOrigin = "system_lifecycle" DeliveryOriginUnknown DeliveryOrigin = "unknown" )
func NewDeliveryOrigin ¶ added in v0.19.0
func NewDeliveryOrigin(raw string) (DeliveryOrigin, error)
func (DeliveryOrigin) IsValid ¶ added in v0.19.0
func (v DeliveryOrigin) IsValid() bool
func (DeliveryOrigin) JSONSchema ¶ added in v0.19.0
func (DeliveryOrigin) JSONSchema() (jsonschema.Schema, error)
type DiagnosticEntry ¶
type DiagnosticEntry struct {
ErrorType string `json:"errorType"` // e.g. "parse_error", "permission_denied", "copy_failed"
Location string `json:"location"` // e.g. "line 47", "debug/tool_output_3.json"
Message string `json:"message"` // Human-readable description
Remediation string `json:"remediation"` // Actionable fix suggestion
}
DiagnosticEntry is a structured error object recorded during ingestion or processing.
type DiagnosticsInfo ¶
type DiagnosticsInfo struct {
Warnings []DiagnosticEntry `json:"warnings"`
Partial *bool `json:"partial,omitempty"` // true if any file copy failed; nil if not determined
}
DiagnosticsInfo records issues encountered during ingestion.
type DiffHunk ¶
type DiffHunk struct {
OldStart int `json:"oldStart"`
OldLines int `json:"oldLines"`
NewStart int `json:"newStart"`
NewLines int `json:"newLines"`
Header string `json:"header,omitempty"`
Lines []DiffLine `json:"lines"`
// Attribution (the mission climax): the recorded conversation that wrote
// most of this hunk's added lines, resolved via git blame → commit →
// session. Empty when the hunk's new lines trace to no recorded session
// (hand-written, or authored outside this tool).
SessionID string `json:"sessionId,omitempty"`
SessionTitle string `json:"sessionTitle,omitempty"`
}
DiffHunk is one "@@ -oldStart,oldLines +newStart,newLines @@" section. Line numbers in the gutter are derivable from OldStart/NewStart plus position.
type DiffLine ¶
type DiffLine struct {
Kind DiffLineKind `json:"kind"`
Text string `json:"text"`
}
DiffLine is one line within a hunk. Kind is "context" | "add" | "del"; Text excludes the leading +/-/space marker.
type DiffLineKind ¶
type DiffLineKind string
DiffLineKind classifies a unified-diff line.
const ( DiffLineKindContext DiffLineKind = "context" DiffLineKindAdd DiffLineKind = "add" DiffLineKindDelete DiffLineKind = "del" )
func (DiffLineKind) IsValid ¶
func (k DiffLineKind) IsValid() bool
IsValid reports whether k is a canonical diff line kind.
func (DiffLineKind) JSONSchema ¶
func (DiffLineKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (DiffLineKind) String ¶
func (k DiffLineKind) String() string
String returns the wire representation of the diff line kind.
func (DiffLineKind) Validate ¶
func (k DiffLineKind) Validate() error
Validate rejects values that cannot cross a diff-line wire boundary.
type DigestItemKind ¶ added in v0.17.0
type DigestItemKind string
DigestItemKind is the closed set of item kinds in a PromptDigest chain.
const ( // DigestItemSession marks where one recorded session began. DigestItemSession DigestItemKind = "session" // DigestItemPrompt is one human-typed user turn. DigestItemPrompt DigestItemKind = "prompt" // DigestItemSkill marks a skill or user slash-command invocation at the // position it happened. DigestItemSkill DigestItemKind = "skill" // DigestItemCommit anchors the chain to a commit in the pull request. DigestItemCommit DigestItemKind = "commit" )
func (DigestItemKind) IsValid ¶ added in v0.17.0
func (k DigestItemKind) IsValid() bool
IsValid reports whether k is a known kind.
func (DigestItemKind) JSONSchema ¶ added in v0.17.0
func (DigestItemKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (DigestItemKind) String ¶ added in v0.17.0
func (k DigestItemKind) String() string
type DurableGraphFixtures ¶ added in v0.19.0
type DurableGraphFixtures struct {
RoundTrip testcase.Corpus[durableJSONInput, durableRoundTripExpected] `yaml:"round_trip"`
Counts testcase.Corpus[durableJSONInput, durableCountExpected] `yaml:"counts"`
InvalidCounts testcase.Corpus[durableJSONInput, durableErrorExpected] `yaml:"invalid_counts"`
Mirrors testcase.Corpus[DurableMirrorInput, durableMirrorExpected] `yaml:"mirrors"`
Digest testcase.Corpus[durableDigestInput, durableDigestExpected] `yaml:"digest"`
RequiredNames []string `yaml:"required_names"`
}
func (DurableGraphFixtures) Validate ¶ added in v0.19.0
func (c DurableGraphFixtures) Validate() error
type DurableMirrorInput ¶ added in v0.19.0
type DurableMirrorInput struct {
Surface string `yaml:"surface"`
DetailCount *int64 `yaml:"detail_count"`
MetadataCount *int64 `yaml:"metadata_count"`
DetailConversationCount *int64 `yaml:"detail_conversation_count"`
MetadataConversationCount *int64 `yaml:"metadata_conversation_count"`
DetailDisplayedCount *int64 `yaml:"detail_displayed_count"`
MetadataDisplayedCount *int64 `yaml:"metadata_displayed_count"`
Parent string `yaml:"parent"`
GraphParent string `yaml:"graph_parent"`
DetailRoot string `yaml:"detail_root"`
MetadataRoot string `yaml:"metadata_root"`
ProjectedMainCount bool `yaml:"projected_main_count"`
DetailTurnCount int `yaml:"detail_turn_count"`
MetadataTurnCount int `yaml:"metadata_turn_count"`
}
DurableMirrorInput describes two copies of one session's facts. Surface selects the pair under test: empty is the publication projection (session detail beside metadata); local_row, village_collective and village_my_share are grouped rows, where "detail" is the session copy and "metadata" is the route copy.
type EarlierHistorySection ¶ added in v0.19.0
type EarlierHistorySection struct {
State EarlierHistoryState `json:"state" yaml:"state"`
Turns []TurnDetail `json:"turns" yaml:"turns" nullable:"false"`
NativeMetadata []NativeMetadataRecord `json:"nativeMetadata,omitempty" yaml:"nativeMetadata"`
}
func (EarlierHistorySection) Validate ¶ added in v0.19.0
func (s EarlierHistorySection) Validate() error
type EarlierHistoryState ¶ added in v0.19.0
type EarlierHistoryState string
const ( EarlierHistoryUncertainMigrated EarlierHistoryState = "uncertain_migrated" EarlierHistoryUncertainUnresolved EarlierHistoryState = "uncertain_unresolved" )
func NewEarlierHistoryState ¶ added in v0.19.0
func NewEarlierHistoryState(raw string) (EarlierHistoryState, error)
func (EarlierHistoryState) IsValid ¶ added in v0.19.0
func (v EarlierHistoryState) IsValid() bool
func (EarlierHistoryState) JSONSchema ¶ added in v0.19.0
func (EarlierHistoryState) JSONSchema() (jsonschema.Schema, error)
type EdgeViolation ¶
type EdgeViolation struct {
Kind EdgeViolationKind `json:"kind"`
From string `json:"from"`
To string `json:"to"`
}
EdgeViolation flags an edge that breaks the layering discipline.
type EdgeViolationKind ¶
type EdgeViolationKind string
EdgeViolationKind classifies a structural violation on the map.
const ( EdgeViolationCycle EdgeViolationKind = "cycle" EdgeViolationWrongWay EdgeViolationKind = "wrong_way" )
EdgeViolationKind values (mirrors codegraph's violation kinds).
func (EdgeViolationKind) IsValid ¶
func (k EdgeViolationKind) IsValid() bool
IsValid reports whether k is one of the defined violation kinds.
func (EdgeViolationKind) JSONSchema ¶
func (EdgeViolationKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (EdgeViolationKind) String ¶
func (k EdgeViolationKind) String() string
String returns the wire representation of the violation kind.
type EntryType ¶
type EntryType string
EntryType classifies a single entry within an agent session transcript.
const ( EntryTypeText EntryType = "text" EntryTypeToolUse EntryType = "tool_use" EntryTypeToolResult EntryType = "tool_result" EntryTypeThinking EntryType = "thinking" EntryTypeSystem EntryType = "system" EntryTypeError EntryType = "error" EntryTypeResult EntryType = "result" // EntryTypeImage is a source entry that carries an ordered image block. EntryTypeImage EntryType = "image" )
func (EntryType) JSONSchema ¶
func (EntryType) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type EvidenceKind ¶ added in v0.19.0
type EvidenceKind string
const ( EvidenceNativeTyped EvidenceKind = "native_typed" EvidenceLifecycleTyped EvidenceKind = "lifecycle_typed" EvidenceExistingAdapter EvidenceKind = "existing_adapter" EvidenceRetainedLastGood EvidenceKind = "retained_last_good" EvidenceUnknown EvidenceKind = "unknown" EvidenceConflict EvidenceKind = "conflict" )
func NewEvidenceKind ¶ added in v0.19.0
func NewEvidenceKind(raw string) (EvidenceKind, error)
func (EvidenceKind) IsValid ¶ added in v0.19.0
func (v EvidenceKind) IsValid() bool
func (EvidenceKind) JSONSchema ¶ added in v0.19.0
func (EvidenceKind) JSONSchema() (jsonschema.Schema, error)
type ExchangeCodeRequest ¶
ExchangeCodeRequest is the JSON body sent to the village CLI auth exchange endpoint. POST /api/v1/auth/cli/exchange
type ExchangeCodeResponse ¶
type ExchangeCodeResponse struct {
APIKey string `json:"api_key"`
KeyID string `json:"key_id"`
UserID string `json:"user_id"`
Username string `json:"username"`
}
ExchangeCodeResponse is the JSON response from the village CLI auth exchange endpoint.
type FamiliarityPayload ¶
type FamiliarityPayload struct {
ProjectHash ProjectHash `json:"projectHash"`
FamiliarityPct float64 `json:"familiarityPct"` // % of source files engaged
UnexploredCount int `json:"unexploredCount"` // source files with 0 engagement
FreshnessDays *int `json:"freshnessDays"` // days since last learning session
Files []FileFamiliarity `json:"files"`
Trails []WalkthroughTrail `json:"trails"`
Suggestions []ReviewSuggestion `json:"suggestions"`
}
FamiliarityPayload is the data sent on the project_familiarity WebSocket channel.
type FileChange ¶
type FileChange struct {
Path string `json:"path"`
Status FileChangeStatus `json:"status"`
OldPath *string `json:"oldPath,omitempty"`
LinesAdded int `json:"linesAdded"`
LinesRemoved int `json:"linesRemoved"`
}
FileChange is one file-level delta of a change (branch vs merge-base). LinesAdded/LinesRemoved are the per-file numstat churn (0 for binary files or when numstat is unavailable) — the change-weight treemap's sizing input Always present; 0 is meaningful, so no omitempty.
type FileChangeStatus ¶
type FileChangeStatus string
FileChangeStatus classifies a file-level delta using Git's canonical one-letter status tokens.
const ( FileChangeStatusModified FileChangeStatus = "M" FileChangeStatusAdded FileChangeStatus = "A" FileChangeStatusDeleted FileChangeStatus = "D" FileChangeStatusRenamed FileChangeStatus = "R" )
func (FileChangeStatus) IsValid ¶
func (s FileChangeStatus) IsValid() bool
IsValid reports whether s is a canonical file change status.
func (FileChangeStatus) JSONSchema ¶
func (FileChangeStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (FileChangeStatus) String ¶
func (s FileChangeStatus) String() string
String returns the wire representation of the file change status.
func (FileChangeStatus) Validate ¶
func (s FileChangeStatus) Validate() error
Validate rejects values that cannot cross a file-change wire boundary.
type FileFamiliarity ¶
type FileFamiliarity struct {
Path string `json:"path"`
Depth int `json:"depth"` // 0=unexplored, 1=touched, 2=engaged, 3=deep
SessionCount int `json:"sessionCount"`
TotalTurns int `json:"totalTurns"`
HumanTurns int `json:"humanTurns"`
LastEngagedAt *string `json:"lastEngagedAt"` // ISO 8601, nil if never
DaysSince *int `json:"daysSince"` // nil if never engaged
DecayLevel DecayLevel `json:"decayLevel"`
IsSourceFile bool `json:"isSourceFile"` // true for relevant source files, false for config/generated
}
FileFamiliarity represents familiarity data for a single file.
type FrictionCluster ¶
type FrictionCluster struct {
Kind string `json:"kind"` // signal slug, e.g. "retryLoop"
Label string `json:"label"` // plain, neutral (e.g. "retry loops")
File string `json:"file"` // repo-relative path
Count int `json:"count"` // occurrences (retry-loop tasks touching this file)
Sessions int `json:"sessions"` // distinct conversations those occurrences span
}
FrictionCluster is a NEUTRAL count of a recurring friction signal keyed to a file: "this kind of friction touched this file N times across M conversations". A fact for orientation — the surface shows, it does not grade Kind is a stable slug ("retryLoop") so more kinds can be added without a breaking change.
type GitContext ¶
type GitContext struct {
Branch *string `json:"branch,omitempty"` // Current git branch
Remote *string `json:"remote,omitempty"` // Git remote URL
Worktree *string `json:"worktree,omitempty"` // Worktree path (if applicable)
Tracking *string `json:"tracking,omitempty"` // Upstream tracking branch (e.g. "origin/main")
Commits []CommitInfo `json:"commits,omitempty"` // Commits produced during this session (v4+)
Associations []PublishedAssociation `json:"associations,omitempty"` // Durable observed session-to-commit relationships
}
GitContext holds git repository state at the time of the session.
func (GitContext) Validate ¶
func (g GitContext) Validate() error
Validate checks request-local published association invariants. Associations are optional for publishers that predate this contract. When supplied, IDs and observed hashes are each unique so a request cannot introduce either an ambiguous durable identity or a same-relationship alias.
type Harness ¶
Harness identifies the coding tool or AI-assisted development environment that is driving the model interaction. Re-exported from bestiary.
type HeaderETagInputs ¶ added in v0.54.0
type HeaderETagInputs struct {
Representation string
ContractVersion PushContractVersion
Kind ContentKind
Canonical bool
OmittedImages int
FlaggedTurns []TranscriptFlaggedTurn
RetainedEvidence *TranscriptRetainedState
ContentHashWord TranscriptContentHashWord
RetainedOwnerVisibility TranscriptRetainedOwnerVisibility
}
HeaderETagInputs contains the facts that may change a header independently of the served turn representation. Declaration order is pinned by a test.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
}
HealthResponse is the JSON response for GET /api/v1/health.
type HelperContextSummary ¶ added in v0.19.0
type HelperContextSummary struct {
GroupID string `json:"groupId" yaml:"groupId"`
OwnerStatus RelationshipNavigationStatus `json:"ownerStatus" yaml:"ownerStatus"`
}
func (HelperContextSummary) Validate ¶ added in v0.19.0
func (s HelperContextSummary) Validate() error
type HelperGroupSummary ¶ added in v0.19.0
type HelperGroupSummary struct {
GroupID string `json:"groupId" yaml:"groupId"`
Purpose SessionPurpose `json:"purpose" yaml:"purpose"`
HelperThreadCount int `json:"helperThreadCount" yaml:"helperThreadCount" minimum:"0" maximum:"9007199254740991"`
MemberScope string `json:"memberScope" yaml:"memberScope"`
}
func (HelperGroupSummary) Validate ¶ added in v0.19.0
func (s HelperGroupSummary) Validate() error
type HostSlug ¶
type HostSlug string
HostSlug is a sanitized, filesystem-safe identifier derived from git remote. Contains [a-zA-Z0-9._<>-] characters. The <> characters support redaction placeholders like <USER> and <PATH> in redacted slugs.
func NewHostSlug ¶
NewHostSlug validates and constructs a HostSlug.
func (HostSlug) JSONSchema ¶
func (HostSlug) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type IDCasing ¶
IDCasing is one entry of the id_casings axis: a named transform of values.uuid_lower (lower / upper / mixed).
type ImageMediaType ¶ added in v0.45.0
type ImageMediaType string
ImageMediaType is the closed set of recorded image media types. A source image whose declared type is outside this set is recorded as an unsupported omission instead of carrying an arbitrary media string.
const ( ImageMediaTypePNG ImageMediaType = "image/png" ImageMediaTypeJPEG ImageMediaType = "image/jpeg" )
func (ImageMediaType) IsValid ¶ added in v0.45.0
func (m ImageMediaType) IsValid() bool
IsValid reports whether the media type belongs to the closed recorded set.
func (ImageMediaType) JSONSchema ¶ added in v0.45.0
func (ImageMediaType) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ImageMediaType) String ¶ added in v0.45.0
func (m ImageMediaType) String() string
type ImagePart ¶ added in v0.45.0
type ImagePart struct {
// Ref is the lowercase 64-hex content address of the stored image. It is
// present for an inline local image and may be present for a missing local
// image; it is always absent from a published transcript.
Ref string `` /* 209-byte string literal not displayed */
// MediaType is the recorded image/png or image/jpeg type. It is absent for
// an unsupported source type, which cannot be represented in this closed
// set, and for a published transcript.
MediaType ImageMediaType `` /* 150-byte string literal not displayed */
// ByteSize is the exact stored byte size. Zero means unset or no bytes, and
// an explicit zero is accepted as unset; a published transcript never
// carries a nonzero size.
ByteSize int `` /* 201-byte string literal not displayed */
// Width and Height are the optional recorded pixel dimensions. Zero means
// unset or unknown, and an explicit zero is accepted as unset; a published
// transcript never carries a nonzero dimension.
Width int `` /* 205-byte string literal not displayed */
Height int `` /* 208-byte string literal not displayed */
// OmittedReason says why no bytes are carried. The empty value means local
// bytes are present. unsupported wins over too_large for a non-recorded
// media type.
OmittedReason OmittedReason `` /* 193-byte string literal not displayed */
}
ImagePart is one ordered image block of a turn. The local shape names the content-addressed reference and the recorded metadata; the published shape carries only the omission reason, never bytes, a reference, a media type, a size, or dimensions.
type ImagePartMode ¶ added in v0.45.0
type ImagePartMode string
ImagePartMode selects which image-part shape a caller is validating. Local is the durable/local-detail shape: an accepted image names its content reference and byte size. Published is the bounded publication shape: a published transcript never carries bytes, a reference, media type, size, or dimensions, and instead says the image was not published. The same ImagePart struct carries both shapes so one type describes the ordered content list end to end. A payload's mode is selected by the caller; it is never inferred from the parts themselves.
const ( // ImagePartModeLocal validates the durable local-detail image shape. ImagePartModeLocal ImagePartMode = "local" // ImagePartModePublished validates the publication image shape. ImagePartModePublished ImagePartMode = "published" )
type InputModality ¶ added in v0.19.0
type InputModality string
const ( InputModalityNone InputModality = "none" InputModalityText InputModality = "text" InputModalityMedia InputModality = "media" InputModalityUserAction InputModality = "user_action" InputModalityMixed InputModality = "mixed" InputModalityUnknown InputModality = "unknown" )
func NewInputModality ¶ added in v0.19.0
func NewInputModality(raw string) (InputModality, error)
func (InputModality) IsValid ¶ added in v0.19.0
func (v InputModality) IsValid() bool
func (InputModality) JSONSchema ¶ added in v0.19.0
func (InputModality) JSONSchema() (jsonschema.Schema, error)
type InsightClassification ¶
type InsightClassification struct {
Category string `json:"category" yaml:"category"`
Cause string `json:"cause" yaml:"cause"`
SeverityScope string `json:"severityScope" yaml:"severityScope"`
SeverityLocus string `json:"severityLocus" yaml:"severityLocus"`
Resolution string `json:"resolution" yaml:"resolution"`
}
InsightClassification is the reserved taxonomy tuple (category x cause x severity(scope, locus) x resolution). Its bare string fields keep the wire shape stable for future closed sets. The current contract requires SessionInsight.Classification to remain nil; see SessionInsight.Validate.
type InsightEvidence ¶
type InsightEvidence struct {
SessionID SessionID `json:"sessionId" yaml:"sessionId" required:"true"`
EntryIndex *int `json:"entryIndex,omitempty" yaml:"entryIndex,omitempty"`
File string `json:"file,omitempty" yaml:"file,omitempty"`
CommitHash string `json:"commitHash,omitempty" yaml:"commitHash,omitempty"`
}
InsightEvidence is one traceability pointer for a SessionInsight: the recorded session (and, when known, the turn / file / commit) that grounds it. Every mechanical insight carries at least one.
func (InsightEvidence) Validate ¶
func (e InsightEvidence) Validate() error
Validate checks that the evidence item carries a traceable session identity.
type InsightKind ¶
type InsightKind string
InsightKind classifies a SessionInsight.
const ( InsightKindDecision InsightKind = "decision" InsightKindFriction InsightKind = "friction" InsightKindUnusual InsightKind = "unusual" InsightKindRetryLoop InsightKind = "retry_loop" )
InsightKind values.
func (InsightKind) IsValid ¶
func (k InsightKind) IsValid() bool
IsValid reports whether k is one of the defined insight kinds.
func (InsightKind) JSONSchema ¶
func (InsightKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (InsightKind) String ¶
func (k InsightKind) String() string
String returns the wire representation of the insight kind.
func (InsightKind) Validate ¶
func (k InsightKind) Validate() error
Validate rejects values that cannot cross the insight-kind wire boundary.
type InsightProvenance ¶
type InsightProvenance string
InsightProvenance classifies how a SessionInsight was produced: mechanical (rule-derived) or mined.
const ( InsightProvenanceMechanical InsightProvenance = "mechanical" InsightProvenanceMined InsightProvenance = "mined" )
InsightProvenance values.
func (InsightProvenance) IsValid ¶
func (p InsightProvenance) IsValid() bool
IsValid reports whether p is one of the defined insight provenances.
func (InsightProvenance) JSONSchema ¶
func (InsightProvenance) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (InsightProvenance) String ¶
func (p InsightProvenance) String() string
String returns the wire representation of the insight provenance.
func (InsightProvenance) Validate ¶
func (p InsightProvenance) Validate() error
Validate rejects values that cannot cross the insight-provenance wire boundary.
type InteractionType ¶
type InteractionType string
InteractionType classifies how deeply a session engaged with a file.
const ( InteractionMentioned InteractionType = "mentioned" InteractionRead InteractionType = "read" InteractionDiscussed InteractionType = "discussed" InteractionQuestioned InteractionType = "questioned" )
func (InteractionType) IsValid ¶
func (i InteractionType) IsValid() bool
IsValid reports whether i is a defined interaction type.
func (InteractionType) JSONSchema ¶
func (InteractionType) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (InteractionType) String ¶
func (i InteractionType) String() string
type InterpretationDiagnostics ¶ added in v0.24.0
type InterpretationDiagnostics struct {
Partial bool `json:"partial"`
}
InterpretationDiagnostics is durable interpretation state, independent of conversational outcome. Partial means retained evidence was not interpreted; it does not authorize loss of that evidence or imply damaged input is valid.
type InvalidRefCategory ¶
type InvalidRefCategory struct {
Category string `yaml:"category"`
ErrContains string `yaml:"err_contains"`
Cases []InvalidRefSubcase `yaml:"cases"`
}
InvalidRefCategory is a group of explicit reject cases sharing an expected error substring (attached to the category; a case may override it).
type InvalidRefSubcase ¶
type InvalidRefSubcase struct {
Name string `yaml:"name"`
Input string `yaml:"input,omitempty"`
Template string `yaml:"template,omitempty"`
ErrContains string `yaml:"err_contains,omitempty"` // overrides category default
}
InvalidRefSubcase is one reject case. Exactly one of Input/Template is set.
type LegacyPullAnnotation ¶ added in v0.33.1
type LegacyPullAnnotation struct {
AnnotationSummary
AuthorUserID string `json:"authorUserId"`
AuthorUsername string `json:"authorUsername"`
}
LegacyPullAnnotation is pull envelope 0.2.0's annotation row. An author anonymous to the caller is AuthorUserID "" with AuthorUsername "anon". The embedded summary's targetProjectHash and targetFilePath are left absent when the annotated transcript's owner is anonymous to the caller, exactly as on PullAnnotation; the response carries no owner, so Village enforces that.
func LegacyPullAnnotationFrom ¶ added in v0.33.1
func LegacyPullAnnotationFrom(annotation PullAnnotation) LegacyPullAnnotation
LegacyPullAnnotationFrom renders a 0.3.0 annotation row in the 0.2.0 shape.
func (LegacyPullAnnotation) Validate ¶ added in v0.33.1
func (a LegacyPullAnnotation) Validate() error
Validate checks the blanking rule on the author.
type LegacyPullListResponse ¶ added in v0.33.1
type LegacyPullListResponse struct {
Transcripts []LegacyPullTranscriptInfo `json:"transcripts"`
Page int `json:"page"`
Limit int `json:"limit"`
Total int `json:"total"`
}
LegacyPullListResponse is pull envelope 0.2.0's paginated listing.
func LegacyPullListResponseFrom ¶ added in v0.33.1
func LegacyPullListResponseFrom(list PullListResponse) LegacyPullListResponse
LegacyPullListResponseFrom renders a 0.3.0 listing in the 0.2.0 shape.
func (LegacyPullListResponse) Validate ¶ added in v0.33.1
func (r LegacyPullListResponse) Validate() error
Validate checks every listed transcript.
type LegacyPullTranscriptInfo ¶ added in v0.33.1
type LegacyPullTranscriptInfo struct {
TranscriptID TranscriptID `json:"transcriptId"`
LocalID string `json:"localId,omitempty"`
OwnerUserID string `json:"ownerUserId"`
OwnerUsername string `json:"ownerUsername"`
Title string `json:"title,omitempty"`
Harness Harness `json:"harness,omitempty"`
ProjectName string `json:"projectName,omitempty"`
Visibility Visibility `json:"visibility"`
License License `json:"license,omitempty"`
ContentHash string `json:"contentHash,omitempty"`
ContractVersion ContractVersion `json:"contractVersion,omitempty"`
PublishedAt int64 `json:"publishedAt"`
UpdatedAt int64 `json:"updatedAt"`
AnnotationCount int `json:"annotationCount"`
}
LegacyPullTranscriptInfo is pull envelope 0.2.0's metadata view of one pullable transcript, frozen byte-for-byte from the shape released before the public owner (schema v0.32.0). Village serves it to clients that do not ask for a newer envelope, and must build it with LegacyPullTranscriptInfoFrom rather than its own structs.
Blanking rule: a person anonymous to the caller is OwnerUserID "" with OwnerUsername "anon", and ProjectName is omitted beside them. A profile carries the real id and username. Validate refuses any other pairing.
func LegacyPullTranscriptInfoFrom ¶ added in v0.33.1
func LegacyPullTranscriptInfoFrom(info PullTranscriptInfo) LegacyPullTranscriptInfo
LegacyPullTranscriptInfoFrom renders a 0.3.0 transcript in the 0.2.0 shape, applying the blanking rule. It is the only way Village should build one.
func (LegacyPullTranscriptInfo) Validate ¶ added in v0.33.1
func (p LegacyPullTranscriptInfo) Validate() error
Validate checks the blanking rule: an empty owner id comes with "anon" and no project name, and an owner id comes with a username.
type License ¶
type License string
License is the content license a contributor selects for a published transcript. Closed menu: the village `licenses` table (its migration 026) carries each license's obligations, and the peasant local store mirrors the set in a CHECK (migration v37). This is the single source of truth for the menu on the publish/pull wire.
func (License) JSONSchema ¶
func (License) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type LocalAnnotationRow ¶ added in v0.64.0
type LocalAnnotationRow struct {
AnnotationSummary
// Owner is whose artifact this annotation is in the local store. It is
// absent when this server does not project owners; {"kind":"unknown"} means
// the owner is projected but withheld.
Owner *LocalArtifactIdentity `json:"owner,omitempty" nullable:"false"`
// Author is who wrote the annotation, kept distinct from the owner and
// from the producer. It uses the same absence rule as Owner.
Author *LocalArtifactIdentity `json:"author,omitempty" nullable:"false"`
}
LocalAnnotationRow is the local annotation read envelope. It embeds the shared AnnotationSummary unchanged and adds the local owner and author as optional, role-distinct projections. It never changes AnnotationSummary itself or the Village pull envelope's PullAnnotation.Author.
func (LocalAnnotationRow) Validate ¶ added in v0.64.0
func (r LocalAnnotationRow) Validate() error
Validate checks the shared annotation summary and both optional identity projections against their declared kinds.
type LocalArtifactIdentity ¶ added in v0.64.0
type LocalArtifactIdentity struct {
Kind LocalArtifactIdentityKind `json:"kind"`
// LocalOwnerID is this data directory's local owner identifier, 1 to 64
// bytes. It is set exactly for kind local.
LocalOwnerID *string `json:"localOwnerId,omitempty" minLength:"1" maxLength:"64" nullable:"false"`
// VillageURL is the normalized full Village base URL, using the same
// grammar as CollectiveObservationScope.villageUrl. It is set for kind
// village or foreign.
VillageURL *string `json:"villageUrl,omitempty" maxLength:"1024" nullable:"false"`
// UserID is the stable Village user UUID, under the same userId spelling
// the claim entry and prompt account use. It is set for kind village or
// foreign.
UserID *VillageUUID `json:"userId,omitempty" nullable:"false"`
// ClaimID is the claim entry that links this artifact to the Village
// account. It is set exactly for kind village.
ClaimID *string `json:"claimId,omitempty" minLength:"1" maxLength:"64" nullable:"false"`
// Username is the display snapshot. It is omitted when the Village
// withheld it, and it must not be empty when present.
Username *string `json:"username,omitempty" minLength:"1" nullable:"false"`
}
LocalArtifactIdentity names the owner or author of a local read row without merging either role into the other or into the producer.
An absent owner field means this server does not project owners at all. {"kind":"unknown"} means the server projects owners but withholds this one; a client must not read either as the local holder. The two are deliberately distinct wire states.
LocalOwnerID is set exactly for kind local. VillageURL, UserID, and ClaimID are set for kind village; ClaimID joins the row to the entry that explains it. VillageURL and UserID are set for kind foreign. Username is a display snapshot that may be omitted when the Village withheld it, but an empty username is refused. Kind unknown carries no identity at all.
func (*LocalArtifactIdentity) Validate ¶ added in v0.64.0
func (i *LocalArtifactIdentity) Validate() error
Validate checks the identity fields against the declared kind.
type LocalArtifactIdentityKind ¶ added in v0.64.0
type LocalArtifactIdentityKind string
LocalArtifactIdentityKind says whose artifact a local read row describes.
const ( // LocalArtifactIdentityKindLocal: this data directory's local owner. LocalArtifactIdentityKindLocal LocalArtifactIdentityKind = "local" // LocalArtifactIdentityKindVillage: the Village account that claimed the // local artifact. A claim outlives the sign-in that made it, so this is the // account that owns the artifact now, not necessarily the account selected // in this process. LocalArtifactIdentityKindVillage LocalArtifactIdentityKind = "village" // LocalArtifactIdentityKindForeign: a pulled artifact's manifest owner. A // foreign artifact is never claimed and never becomes local. The identity // carries the owner's recorded Village URL, user UUID, and display // snapshot; Village transcript reads keep using VillagePublicOwner for the // same person. No local read emits this kind today. The local annotation // read (LocalAnnotationRow.Owner and LocalAnnotationRow.Author) is the read // that will emit it once it projects a pulled annotation's manifest owner. LocalArtifactIdentityKindForeign LocalArtifactIdentityKind = "foreign" // LocalArtifactIdentityKindUnknown: the owner is projected but withheld, or // a pulled row's manifest owner is empty. It carries no identity and is // never a local fallback. LocalArtifactIdentityKindUnknown LocalArtifactIdentityKind = "unknown" )
func (LocalArtifactIdentityKind) IsValid ¶ added in v0.64.0
func (k LocalArtifactIdentityKind) IsValid() bool
IsValid reports whether k is a member of the artifact identity menu.
func (LocalArtifactIdentityKind) JSONSchema ¶ added in v0.64.0
func (LocalArtifactIdentityKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalArtifactIdentityKind) String ¶ added in v0.64.0
func (k LocalArtifactIdentityKind) String() string
String returns the wire representation of the artifact identity kind.
type LocalClaimEntry ¶ added in v0.64.0
type LocalClaimEntry struct {
// ID is the stable claim entry identifier.
ID string `json:"id" minLength:"1" maxLength:"64"`
// LocalOwnerID is the local owner the claim belongs to.
LocalOwnerID string `json:"localOwnerId" minLength:"1" maxLength:"64"`
// VillageURL is the normalized full Village base URL, using the same
// grammar as CollectiveObservationScope.villageUrl.
VillageURL string `json:"villageUrl" maxLength:"1024"`
// UserID is the stable Village user UUID, never the username. It is the
// same value CollectiveObservationScope.userId carries.
UserID VillageUUID `json:"userId"`
// Username is the display snapshot recorded at claim time. It is never
// identity and may differ between entries for one Village user UUID. It
// must name a person, so an empty value is refused rather than shown.
Username string `json:"username" minLength:"1"`
// Source says why this entry exists.
Source LocalClaimSource `json:"source"`
// ClaimedAt is when this entry was appended. Later automatic claims join
// the newest automatic entry instead of moving or restamping it. It is
// display data only: insertion order is the sole claim order key, so a
// clock step never reorders the log.
ClaimedAt time.Time `json:"claimedAt"`
}
LocalClaimEntry is one entry in the local claim log. The account identity reuses CollectiveObservationScope's field names and grammar: a normalized full Village base URL plus a stable Village user UUID. Username is a display snapshot only, never identity, so a rename or a reused username never adds a second account.
Entries are newest first by insertion order: the store's monotonically increasing rowid descending, never ClaimedAt and never the random entry id. A clock step can place an older ClaimedAt after a newer one, so time is display data only and never an order key. A status read returns only the most recent LocalOwnerRecentClaimLimit entries.
func (LocalClaimEntry) Validate ¶ added in v0.64.0
func (e LocalClaimEntry) Validate() error
Validate checks the entry identifier, the owner link, the account scope, the display snapshot, the source, and the claim time.
type LocalClaimSource ¶ added in v0.64.0
type LocalClaimSource string
LocalClaimSource says why one claim entry exists.
const ( // LocalClaimSourceManual: the person ran an explicit claim command. LocalClaimSourceManual LocalClaimSource = "manual" // LocalClaimSourceSignInPrompt: the person answered the sign-in claim // prompt. LocalClaimSourceSignInPrompt LocalClaimSource = "sign_in_prompt" // LocalClaimSourceAutomatic: a harvest claimed sessions that had no stored // row and no saved pair under peasant-sync/ before this run, whatever // status the pipeline reports. A session first stored while still active is // included. Forced reprocessing, the web one-session ingest, harvest index // --all, and a database rebuild from saved copies never claim. An automatic // claim reuses this account's entry only while that automatic entry is the // newest entry of the whole log for this local owner, by insertion order; // otherwise it appends a new entry. Updated, reindexed, and rebuilt rows are // never claimed automatically. LocalClaimSourceAutomatic LocalClaimSource = "automatic" )
func (LocalClaimSource) IsValid ¶ added in v0.64.0
func (s LocalClaimSource) IsValid() bool
IsValid reports whether s is a member of the claim-source set.
func (LocalClaimSource) JSONSchema ¶ added in v0.64.0
func (LocalClaimSource) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalClaimSource) String ¶ added in v0.64.0
func (s LocalClaimSource) String() string
String returns the wire representation of the claim source.
type LocalCollectiveSuggestion ¶ added in v0.25.0
type LocalCollectiveSuggestion struct {
Reason LocalCollectiveSuggestionReason `json:"reason"`
Match string `json:"match"`
}
LocalCollectiveSuggestion is the server's reason to suggest one collective. Match is what matched: the linked repository's schema.RemoteLabel for a linked_repository suggestion, or the organization login for a linked_github_org suggestion.
type LocalCollectiveSuggestionReason ¶ added in v0.25.0
type LocalCollectiveSuggestionReason string
LocalCollectiveSuggestionReason is why the server suggests a collective for a session.
const ( // LocalCollectiveSuggestionLinkedRepository: the collective links the session's // repository. LocalCollectiveSuggestionLinkedRepository LocalCollectiveSuggestionReason = "linked_repository" // LocalCollectiveSuggestionLinkedGithubOrg: the collective links the GitHub // organization that owns the session's repository. LocalCollectiveSuggestionLinkedGithubOrg LocalCollectiveSuggestionReason = "linked_github_org" )
func (LocalCollectiveSuggestionReason) IsValid ¶ added in v0.25.0
func (r LocalCollectiveSuggestionReason) IsValid() bool
func (LocalCollectiveSuggestionReason) JSONSchema ¶ added in v0.25.0
func (LocalCollectiveSuggestionReason) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalCollectiveSuggestionReason) String ¶ added in v0.25.0
func (r LocalCollectiveSuggestionReason) String() string
type LocalConfirmedContributionOutcome ¶ added in v0.31.0
type LocalConfirmedContributionOutcome string
const ( LocalConfirmedContributionPublished LocalConfirmedContributionOutcome = "published" LocalConfirmedContributionSubmitted LocalConfirmedContributionOutcome = "submitted" )
func (LocalConfirmedContributionOutcome) IsValid ¶ added in v0.31.0
func (v LocalConfirmedContributionOutcome) IsValid() bool
func (LocalConfirmedContributionOutcome) JSONSchema ¶ added in v0.31.0
func (LocalConfirmedContributionOutcome) JSONSchema() (jsonschema.Schema, error)
type LocalConfirmedContributionReceipt ¶ added in v0.31.0
type LocalConfirmedContributionReceipt struct {
ReceiptID string `json:"receiptId" minLength:"1" maxLength:"256"`
Operation CollectiveOperation `json:"operation"`
TranscriptID TranscriptID `json:"transcriptId"`
CollectiveID *VillageUUID `json:"collectiveId,omitempty"`
ConfirmedAt time.Time `json:"confirmedAt"`
Outcome LocalConfirmedContributionOutcome `json:"outcome"`
SourceReceiptID *string `json:"sourceReceiptId,omitempty" maxLength:"256"`
}
func (*LocalConfirmedContributionReceipt) UnmarshalJSON ¶ added in v0.31.0
func (v *LocalConfirmedContributionReceipt) UnmarshalJSON(data []byte) error
func (LocalConfirmedContributionReceipt) Validate ¶ added in v0.31.0
func (r LocalConfirmedContributionReceipt) Validate() error
type LocalContributionEvidenceKind ¶ added in v0.31.0
type LocalContributionEvidenceKind string
const ( LocalContributionEvidenceRemoteAttempts LocalContributionEvidenceKind = "remote-attempts" LocalContributionEvidenceReceipts LocalContributionEvidenceKind = "receipts" LocalContributionEvidenceOperationDiagnostics LocalContributionEvidenceKind = "operation-diagnostics" )
func (LocalContributionEvidenceKind) IsValid ¶ added in v0.31.0
func (v LocalContributionEvidenceKind) IsValid() bool
func (LocalContributionEvidenceKind) JSONSchema ¶ added in v0.31.0
func (LocalContributionEvidenceKind) JSONSchema() (jsonschema.Schema, error)
type LocalContributionHistoryQuery ¶ added in v0.31.0
type LocalContributionHistoryQuery struct {
Kind LocalContributionEvidenceKind `json:"kind"`
CollectiveID *VillageUUID `json:"collectiveId,omitempty"`
Page int `json:"page"`
Limit int `json:"limit"`
Revision *ContributionTraversalRevision `json:"revision,omitempty"`
}
type LocalContributionHistoryResponse ¶ added in v0.31.0
type LocalContributionHistoryResponse struct {
Scope CollectiveObservationScope `json:"scope"`
Kind LocalContributionEvidenceKind `json:"kind"`
TraversalRevision ContributionTraversalRevision `json:"traversalRevision"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
Limit int `json:"limit" minimum:"1" maximum:"200"`
Total int64 `json:"total" minimum:"0" maximum:"9007199254740991"`
Coverage CollectiveEvidenceCoverage `json:"coverage"`
RemoteAttempts []LocalRemoteContributionAttempt `json:"remoteAttempts,omitempty" maxItems:"200" nullable:"false"`
Receipts []LocalConfirmedContributionReceipt `json:"receipts,omitempty" maxItems:"200" nullable:"false"`
OperationDiagnostics []LocalOperationDiagnostic `json:"operationDiagnostics,omitempty" maxItems:"200" nullable:"false"`
}
func (LocalContributionHistoryResponse) MarshalJSON ¶ added in v0.31.0
func (r LocalContributionHistoryResponse) MarshalJSON() ([]byte, error)
func (*LocalContributionHistoryResponse) UnmarshalJSON ¶ added in v0.31.0
func (r *LocalContributionHistoryResponse) UnmarshalJSON(data []byte) error
func (LocalContributionHistoryResponse) Validate ¶ added in v0.31.0
func (r LocalContributionHistoryResponse) Validate() error
type LocalContributionTraversalConflict ¶ added in v0.31.0
type LocalContributionTraversalConflict struct {
CurrentTraversalRevision ContributionTraversalRevision `json:"currentTraversalRevision"`
Issue OperationIssue `json:"issue"`
}
type LocalHelperMembersPayload ¶ added in v0.19.0
type LocalHelperMembersPayload struct {
Members []LocalSessionListItem `json:"members" nullable:"false"`
NextItems []LocalSessionListItem `json:"nextItems" nullable:"false"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
PerPage PageSize `json:"perPage"`
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
Revision string `json:"revision" minLength:"1"`
}
LocalHelperMembersPayload is a page of saved helper sessions selected by an opaque scope returned from the originating grouped query. It carries the same offset fields as every other local list page.
func (*LocalHelperMembersPayload) UnmarshalJSON ¶ added in v0.19.0
func (p *LocalHelperMembersPayload) UnmarshalJSON(raw []byte) error
UnmarshalJSON preserves required member-page presence before Go zero values can turn a missing or null total into a measured zero.
func (LocalHelperMembersPayload) Validate ¶ added in v0.19.0
func (p LocalHelperMembersPayload) Validate() error
Validate checks a typed, non-null member page and every row mirror.
type LocalKickstartAnswers ¶ added in v0.49.0
type LocalKickstartAnswers struct {
Revision uint64 `json:"revision" minimum:"0"`
Values map[string]LocalSettingValue `json:"values,omitempty" nullable:"false"`
SelectedIDs []string `json:"selectedIds,omitempty" nullable:"false"`
Resolutions map[string]LocalKickstartResolution `json:"resolutions,omitempty" nullable:"false"`
ConnectAnswer LocalKickstartConnectAnswer `json:"connectAnswer,omitempty"`
}
LocalKickstartAnswers is the PATCH body: one stop's answers, the tree's selected ids, conflict resolutions, or the connect offer. revision is the session revision the caller last rendered.
func (*LocalKickstartAnswers) UnmarshalJSON ¶ added in v0.49.0
func (a *LocalKickstartAnswers) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown answer field.
func (LocalKickstartAnswers) Validate ¶ added in v0.49.0
func (a LocalKickstartAnswers) Validate() error
Validate checks resolutions and the connect token. Field keys stay open: Peasant owns that set and refuses an unknown key.
type LocalKickstartCloseReason ¶ added in v0.49.0
type LocalKickstartCloseReason string
LocalKickstartCloseReason is why a session ended. committed moves the page to the finish panel. expired offers to reopen. There is no replaced reason.
const ( LocalKickstartClosedCommitted LocalKickstartCloseReason = "committed" LocalKickstartClosedExpired LocalKickstartCloseReason = "expired" )
func NewLocalKickstartCloseReason ¶ added in v0.49.0
func NewLocalKickstartCloseReason(raw string) (LocalKickstartCloseReason, error)
NewLocalKickstartCloseReason refuses a token outside the menu.
func (LocalKickstartCloseReason) IsValid ¶ added in v0.49.0
func (v LocalKickstartCloseReason) IsValid() bool
func (LocalKickstartCloseReason) JSONSchema ¶ added in v0.49.0
func (LocalKickstartCloseReason) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartCloseReason) String ¶ added in v0.49.0
func (v LocalKickstartCloseReason) String() string
func (*LocalKickstartCloseReason) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartCloseReason) UnmarshalJSON(data []byte) error
type LocalKickstartCommitRefusal ¶ added in v0.49.0
type LocalKickstartCommitRefusal struct {
Error string `json:"error" minLength:"1"`
Conflicts []LocalKickstartConflict `json:"conflicts" nullable:"false"`
}
LocalKickstartCommitRefusal is the 409 body when a commit finds conflict rows. Nothing was written. The rows are the same mine/theirs rows the review stop shows.
func (*LocalKickstartCommitRefusal) UnmarshalJSON ¶ added in v0.49.0
func (r *LocalKickstartCommitRefusal) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown refusal field.
func (LocalKickstartCommitRefusal) Validate ¶ added in v0.49.0
func (r LocalKickstartCommitRefusal) Validate() error
Validate checks the refusal names the reason and at least one row.
type LocalKickstartCommitted ¶ added in v0.49.0
type LocalKickstartCommitted struct {
// Saved is always true on a successful commit, including when ingest fails.
Saved bool `json:"saved"`
ConfigPath string `json:"configPath" minLength:"1"`
Ingest LocalKickstartIngest `json:"ingest"`
NextSteps []LocalKickstartNextStep `json:"nextSteps" nullable:"false"`
Diagnostics []string `json:"diagnostics,omitempty" nullable:"false"`
}
LocalKickstartCommitted is the commit success body. NextSteps uses the closed finish menu. Diagnostics are the selection-conflict lines. The body has no reset control and no hook-install flag.
func (*LocalKickstartCommitted) UnmarshalJSON ¶ added in v0.49.0
func (c *LocalKickstartCommitted) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown commit field.
func (LocalKickstartCommitted) Validate ¶ added in v0.49.0
func (c LocalKickstartCommitted) Validate() error
Validate checks the path, the ingest, and every next step.
type LocalKickstartConflict ¶ added in v0.49.0
type LocalKickstartConflict struct {
Field string `json:"field" minLength:"1"`
Stop string `json:"stop" minLength:"1"`
Label string `json:"label" minLength:"1"`
Mine LocalSettingValue `json:"mine"`
Theirs LocalSettingValue `json:"theirs"`
}
LocalKickstartConflict is one answered field whose file value moved. mine is the draft. theirs is the file. The page offers those two sides and no third.
func (*LocalKickstartConflict) UnmarshalJSON ¶ added in v0.49.0
func (c *LocalKickstartConflict) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown conflict field.
func (LocalKickstartConflict) Validate ¶ added in v0.49.0
func (c LocalKickstartConflict) Validate() error
Validate checks the row names both sides.
type LocalKickstartConnect ¶ added in v0.49.0
type LocalKickstartConnect struct {
Offered bool `json:"offered"`
AfterStop string `json:"afterStop,omitempty"`
Prompt string `json:"prompt,omitempty"`
Skip string `json:"skip,omitempty"`
}
LocalKickstartConnect is the boundary offer, already evaluated. The client renders it on the stop after afterStop and never recomputes the condition.
func (*LocalKickstartConnect) UnmarshalJSON ¶ added in v0.49.0
func (c *LocalKickstartConnect) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown connect field.
func (LocalKickstartConnect) Validate ¶ added in v0.49.0
func (c LocalKickstartConnect) Validate() error
Validate checks that an offered connect names the stop it follows.
type LocalKickstartConnectAnswer ¶ added in v0.49.0
type LocalKickstartConnectAnswer string
LocalKickstartConnectAnswer is the boundary offer's accept or skip. It is not a stop field and it never enters the configuration file.
const ( LocalKickstartConnectAccept LocalKickstartConnectAnswer = "accept" LocalKickstartConnectSkip LocalKickstartConnectAnswer = "skip" )
func NewLocalKickstartConnectAnswer ¶ added in v0.49.0
func NewLocalKickstartConnectAnswer(raw string) (LocalKickstartConnectAnswer, error)
NewLocalKickstartConnectAnswer refuses a token outside the menu.
func (LocalKickstartConnectAnswer) IsValid ¶ added in v0.49.0
func (v LocalKickstartConnectAnswer) IsValid() bool
func (LocalKickstartConnectAnswer) JSONSchema ¶ added in v0.49.0
func (LocalKickstartConnectAnswer) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartConnectAnswer) String ¶ added in v0.49.0
func (v LocalKickstartConnectAnswer) String() string
func (*LocalKickstartConnectAnswer) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartConnectAnswer) UnmarshalJSON(data []byte) error
type LocalKickstartDiff ¶ added in v0.49.0
type LocalKickstartDiff struct {
File string `json:"file" minLength:"1"`
Hunks []LocalKickstartHunk `json:"hunks" nullable:"false"`
Truncated bool `json:"truncated,omitempty"`
}
LocalKickstartDiff is the structured before-to-after document diff. The client maps hunks onto the review diff and renders nothing itself. Truncated means the server omitted hunks past its bound; the per-field conflict rows are never truncated.
func (*LocalKickstartDiff) UnmarshalJSON ¶ added in v0.49.0
func (d *LocalKickstartDiff) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown diff field.
func (LocalKickstartDiff) Validate ¶ added in v0.49.0
func (d LocalKickstartDiff) Validate() error
Validate checks the file label and every hunk.
type LocalKickstartDiffLine ¶ added in v0.49.0
type LocalKickstartDiffLine struct {
Type LocalKickstartDiffLineType `json:"type"`
OldNo int `json:"oldNo,omitempty" minimum:"0"`
NewNo int `json:"newNo,omitempty" minimum:"0"`
Text string `json:"text"`
}
LocalKickstartDiffLine is one structured diff line. oldNo and newNo are omitted on a line that has no number on that side.
func (*LocalKickstartDiffLine) UnmarshalJSON ¶ added in v0.49.0
func (l *LocalKickstartDiffLine) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown diff-line field.
func (LocalKickstartDiffLine) Validate ¶ added in v0.49.0
func (l LocalKickstartDiffLine) Validate() error
Validate checks the line type and refuses negative numbers; zero denotes an omitted side.
type LocalKickstartDiffLineType ¶ added in v0.49.0
type LocalKickstartDiffLineType string
LocalKickstartDiffLineType is one line in the structured config diff. The tokens are the ones the review diff renders: add, del, and ctx.
const ( LocalKickstartDiffAdd LocalKickstartDiffLineType = "add" LocalKickstartDiffDel LocalKickstartDiffLineType = "del" LocalKickstartDiffCtx LocalKickstartDiffLineType = "ctx" )
func NewLocalKickstartDiffLineType ¶ added in v0.49.0
func NewLocalKickstartDiffLineType(raw string) (LocalKickstartDiffLineType, error)
NewLocalKickstartDiffLineType refuses a token outside the menu.
func (LocalKickstartDiffLineType) IsValid ¶ added in v0.49.0
func (v LocalKickstartDiffLineType) IsValid() bool
func (LocalKickstartDiffLineType) JSONSchema ¶ added in v0.49.0
func (LocalKickstartDiffLineType) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartDiffLineType) String ¶ added in v0.49.0
func (v LocalKickstartDiffLineType) String() string
func (*LocalKickstartDiffLineType) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartDiffLineType) UnmarshalJSON(data []byte) error
type LocalKickstartErrorCode ¶ added in v0.50.0
type LocalKickstartErrorCode string
LocalKickstartErrorCode is the machine-readable reason a kickstart route refused a request or could not finish it. Every non-2xx body a kickstart route writes beyond the shared 403 refusal (host or origin) and the commit 409 carries exactly one of these in LocalKickstartErrorResponse.Code. The set is closed: a client parses the token with NewLocalKickstartErrorCode and never compares strings.
Each token answers with one HTTP status, whichever route raised it. The grouping below follows that status.
const ( // LocalKickstartErrorBodyMissing: the open or patch request has no body. LocalKickstartErrorBodyMissing LocalKickstartErrorCode = "kickstart_body_missing" // LocalKickstartErrorBodyInvalid: the body is not one JSON object of the declared shape. LocalKickstartErrorBodyInvalid LocalKickstartErrorCode = "kickstart_body_invalid" // LocalKickstartErrorScopeInvalid: the scope is neither full nor selection. LocalKickstartErrorScopeInvalid LocalKickstartErrorCode = "kickstart_scope_invalid" // LocalKickstartErrorAnswersInvalid: the patch body carries no mutation or a malformed one. LocalKickstartErrorAnswersInvalid LocalKickstartErrorCode = "kickstart_answers_invalid" // LocalKickstartErrorSessionCommitting: the session is being saved, so a patch, rescan, or second save was not applied. LocalKickstartErrorSessionCommitting LocalKickstartErrorCode = "kickstart_session_committing" // LocalKickstartErrorRevisionAhead: the patch revision is ahead of the session. LocalKickstartErrorRevisionAhead LocalKickstartErrorCode = "kickstart_revision_ahead" // LocalKickstartErrorAnswerRefused: the field refused the answer. LocalKickstartErrorAnswerRefused LocalKickstartErrorCode = "kickstart_answer_refused" // LocalKickstartErrorScanNotDone: the tree answer arrived before the discovery scan finished. LocalKickstartErrorScanNotDone LocalKickstartErrorCode = "kickstart_scan_not_done" // LocalKickstartErrorFieldUnknown: the key names no setup field. LocalKickstartErrorFieldUnknown LocalKickstartErrorCode = "kickstart_field_unknown" // LocalKickstartErrorFieldOutOfScope: the field is not part of this scope's stops. LocalKickstartErrorFieldOutOfScope LocalKickstartErrorCode = "kickstart_field_out_of_scope" // LocalKickstartErrorFieldHidden: the field is hidden in the session's current view, so an answer to it is refused. LocalKickstartErrorFieldHidden LocalKickstartErrorCode = "kickstart_field_hidden" // LocalKickstartErrorTreeAnswerShape: the tree is answered with selectedIds, never with a value. LocalKickstartErrorTreeAnswerShape LocalKickstartErrorCode = "kickstart_tree_answer_shape" // LocalKickstartErrorConnectOutOfScope: this scope has no connect offer to answer. LocalKickstartErrorConnectOutOfScope LocalKickstartErrorCode = "kickstart_connect_out_of_scope" // LocalKickstartErrorConnectNotConnected: accept was sent while this computer is not signed in to village. LocalKickstartErrorConnectNotConnected LocalKickstartErrorCode = "kickstart_connect_not_connected" // LocalKickstartErrorConnectUnknown: the connect answer is neither accept nor skip. LocalKickstartErrorConnectUnknown LocalKickstartErrorCode = "kickstart_connect_unknown" // LocalKickstartErrorCommitRefused: the save was refused because an answer is not acceptable, for example a scan that has not finished. LocalKickstartErrorCommitRefused LocalKickstartErrorCode = "kickstart_commit_refused" // LocalKickstartErrorSessionNotFound: no live session has the id. LocalKickstartErrorSessionNotFound LocalKickstartErrorCode = "kickstart_session_not_found" // LocalKickstartErrorPreviewRowNotFound: the session's forest holds no such row. LocalKickstartErrorPreviewRowNotFound LocalKickstartErrorCode = "kickstart_preview_row_not_found" LocalKickstartErrorPreviewCaptureNotFound LocalKickstartErrorCode = "kickstart_preview_capture_not_found" LocalKickstartErrorPreviewSourceChanged LocalKickstartErrorCode = "kickstart_preview_source_changed" LocalKickstartErrorPreviewLateResult LocalKickstartErrorCode = "kickstart_preview_late_result" LocalKickstartErrorPreviewCapacity LocalKickstartErrorCode = "kickstart_preview_capacity" LocalKickstartErrorPreviewOutOfOrder LocalKickstartErrorCode = "kickstart_preview_out_of_order" // LocalKickstartErrorFailed: a defect the server has no narrower token for. LocalKickstartErrorFailed LocalKickstartErrorCode = "kickstart_failed" // LocalKickstartErrorStatusUnreadable: the status route could not inspect the configuration file. LocalKickstartErrorStatusUnreadable LocalKickstartErrorCode = "kickstart_status_unreadable" // LocalKickstartErrorConfigUnreadable: the configuration file could not be read. LocalKickstartErrorConfigUnreadable LocalKickstartErrorCode = "kickstart_config_unreadable" // LocalKickstartErrorConfigUnwritable: the configuration file could not be written; the previous file is unchanged. LocalKickstartErrorConfigUnwritable LocalKickstartErrorCode = "kickstart_config_unwritable" // LocalKickstartErrorSessionUnbuildable: the session's draft could not be built or rebuilt. LocalKickstartErrorSessionUnbuildable LocalKickstartErrorCode = "kickstart_session_unbuildable" // LocalKickstartErrorAnswerUnencodable: an accepted tree answer could not be encoded. LocalKickstartErrorAnswerUnencodable LocalKickstartErrorCode = "kickstart_answer_unencodable" // LocalKickstartErrorPreviewUnreadable: the session's transcript could not be read for the preview. LocalKickstartErrorPreviewUnreadable LocalKickstartErrorCode = "kickstart_preview_unreadable" // LocalKickstartErrorContractBreach: the answer the server built breaks this contract, so it was not sent. The token is the // local server's shared contract-breach code and is not prefixed kickstart_, so it keeps one spelling across local code sets. // A second local code set that needs it declares its own constant by conversion from this one, // for example MyCode(schema.LocalKickstartErrorContractBreach), and never retypes the string. LocalKickstartErrorContractBreach LocalKickstartErrorCode = "publishing_contract_breach" LocalKickstartErrorUnavailable LocalKickstartErrorCode = "kickstart_unavailable" // LocalKickstartErrorConfigBusy: another change holds the configuration file. LocalKickstartErrorConfigBusy LocalKickstartErrorCode = "kickstart_config_busy" // LocalKickstartErrorConfigChanging: the configuration file kept changing during the save. LocalKickstartErrorConfigChanging LocalKickstartErrorCode = "kickstart_config_changing" )
func NewLocalKickstartErrorCode ¶ added in v0.50.0
func NewLocalKickstartErrorCode(raw string) (LocalKickstartErrorCode, error)
NewLocalKickstartErrorCode refuses a token outside the menu.
func (LocalKickstartErrorCode) HTTPStatus ¶ added in v0.50.0
func (v LocalKickstartErrorCode) HTTPStatus() int
HTTPStatus is the HTTP status the code answers with, whichever route raises it: 400, 404, 500, or 503. A value outside the closed set has no status and returns 0, which is not a valid status to write, so a caller that builds a code from untrusted input parses it with NewLocalKickstartErrorCode first.
func (LocalKickstartErrorCode) IsValid ¶ added in v0.50.0
func (v LocalKickstartErrorCode) IsValid() bool
func (LocalKickstartErrorCode) JSONSchema ¶ added in v0.50.0
func (LocalKickstartErrorCode) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartErrorCode) String ¶ added in v0.50.0
func (v LocalKickstartErrorCode) String() string
func (*LocalKickstartErrorCode) UnmarshalJSON ¶ added in v0.50.0
func (v *LocalKickstartErrorCode) UnmarshalJSON(data []byte) error
type LocalKickstartErrorResponse ¶ added in v0.50.0
type LocalKickstartErrorResponse struct {
Error string `json:"error" minLength:"1"`
Code LocalKickstartErrorCode `json:"code"`
}
LocalKickstartErrorResponse is the body of every non-2xx kickstart answer except the shared 403 refusal (host or origin) and the commit 409. Error is prose that names what went wrong and how to recover; a client shows it and decides nothing from it. Code is the closed token a client branches on. Unlike the shared local error body, the code is always present and always one of AllLocalKickstartErrorCodes.
func (*LocalKickstartErrorResponse) UnmarshalJSON ¶ added in v0.50.0
func (r *LocalKickstartErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown error field.
func (LocalKickstartErrorResponse) Validate ¶ added in v0.50.0
func (r LocalKickstartErrorResponse) Validate() error
Validate checks the prose is present and the code belongs to the closed set.
type LocalKickstartEvent ¶ added in v0.49.0
type LocalKickstartEvent struct {
Kind LocalKickstartEventKind `json:"kind"`
SessionID string `json:"sessionId" minLength:"1"`
Revision uint64 `json:"revision" minimum:"0"`
Reason LocalKickstartCloseReason `json:"reason,omitempty"`
View *LocalKickstartSession `json:"view,omitempty"`
Scan *LocalKickstartScan `json:"scan,omitempty"`
Ingest *LocalKickstartIngest `json:"ingest,omitempty"`
Committed *LocalKickstartCommitted `json:"committed,omitempty"`
}
LocalKickstartEvent is the server message data for the kickstart topic. SessionID identifies the kickstart session, not a stored transcript node. One event carries one session id. A view, when present, is that session's snapshot and no other. Subscribe yields one such snapshot per session id; the event itself is that one snapshot, not a map of sessions.
func (*LocalKickstartEvent) UnmarshalJSON ¶ added in v0.49.0
func (e *LocalKickstartEvent) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown event field.
func (LocalKickstartEvent) Validate ¶ added in v0.49.0
func (e LocalKickstartEvent) Validate() error
Validate checks the kind, the one session id, and that the carried object matches the kind. A view whose id differs from sessionId is a second snapshot and is refused.
type LocalKickstartEventKind ¶ added in v0.49.0
type LocalKickstartEventKind string
LocalKickstartEventKind is the live-topic discriminator. session, answers, and conflicts each carry the full view. They stay separate so a consumer can tell which mutation produced the snapshot. scan and ingest carry only their own object. closed ends the session.
const ( LocalKickstartEventSession LocalKickstartEventKind = "session" LocalKickstartEventAnswers LocalKickstartEventKind = "answers" LocalKickstartEventConflicts LocalKickstartEventKind = "conflicts" LocalKickstartEventScan LocalKickstartEventKind = "scan" LocalKickstartEventIngest LocalKickstartEventKind = "ingest" LocalKickstartEventClosed LocalKickstartEventKind = "closed" )
func NewLocalKickstartEventKind ¶ added in v0.49.0
func NewLocalKickstartEventKind(raw string) (LocalKickstartEventKind, error)
NewLocalKickstartEventKind refuses a token outside the menu.
func (LocalKickstartEventKind) IsValid ¶ added in v0.49.0
func (v LocalKickstartEventKind) IsValid() bool
func (LocalKickstartEventKind) JSONSchema ¶ added in v0.49.0
func (LocalKickstartEventKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartEventKind) String ¶ added in v0.49.0
func (v LocalKickstartEventKind) String() string
func (*LocalKickstartEventKind) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartEventKind) UnmarshalJSON(data []byte) error
type LocalKickstartField ¶ added in v0.49.0
type LocalKickstartField struct {
Key string `json:"key" minLength:"1"`
Kind LocalKickstartFieldKind `json:"kind"`
Label string `json:"label" minLength:"1"`
Description string `json:"description,omitempty"`
Value LocalSettingValue `json:"value"`
Options []LocalKickstartOption `json:"options,omitempty" nullable:"false"`
Example []LocalKickstartLine `json:"example,omitempty" nullable:"false"`
Refusal *LocalSettingRefusal `json:"refusal,omitempty"`
}
LocalKickstartField is one answerable control. Value reuses LocalSettingValue. Refusal reuses LocalSettingRefusal. Peasant owns the key set; an unknown key is a server refusal, not a second menu here.
func (*LocalKickstartField) UnmarshalJSON ¶ added in v0.49.0
func (f *LocalKickstartField) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown field property.
func (LocalKickstartField) Validate ¶ added in v0.49.0
func (f LocalKickstartField) Validate() error
Validate checks the control, its value, and any options or example lines.
type LocalKickstartFieldKind ¶ added in v0.49.0
type LocalKickstartFieldKind string
LocalKickstartFieldKind is the control shape of one field. The server owns visibility, options, and validity; the client switches on this token only to choose a control.
const ( LocalKickstartFieldToggle LocalKickstartFieldKind = "toggle" LocalKickstartFieldChoice LocalKickstartFieldKind = "choice" LocalKickstartFieldAction LocalKickstartFieldKind = "action" LocalKickstartFieldTree LocalKickstartFieldKind = "tree" LocalKickstartFieldNotice LocalKickstartFieldKind = "notice" )
func NewLocalKickstartFieldKind ¶ added in v0.49.0
func NewLocalKickstartFieldKind(raw string) (LocalKickstartFieldKind, error)
NewLocalKickstartFieldKind refuses a token outside the menu.
func (LocalKickstartFieldKind) IsValid ¶ added in v0.49.0
func (v LocalKickstartFieldKind) IsValid() bool
func (LocalKickstartFieldKind) JSONSchema ¶ added in v0.49.0
func (LocalKickstartFieldKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartFieldKind) String ¶ added in v0.49.0
func (v LocalKickstartFieldKind) String() string
func (*LocalKickstartFieldKind) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartFieldKind) UnmarshalJSON(data []byte) error
type LocalKickstartGuide ¶ added in v0.49.0
type LocalKickstartGuide struct {
Intro string `json:"intro,omitempty"`
Hints []string `json:"hints,omitempty" nullable:"false"`
}
LocalKickstartGuide is the stop's intro and hints. An example reuses LocalKickstartLine; this struct does not grow an example field.
func (*LocalKickstartGuide) UnmarshalJSON ¶ added in v0.49.0
func (g *LocalKickstartGuide) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown guide field.
func (LocalKickstartGuide) Validate ¶ added in v0.49.0
func (g LocalKickstartGuide) Validate() error
Validate checks that a present hint list is not null.
type LocalKickstartHunk ¶ added in v0.49.0
type LocalKickstartHunk struct {
Header string `json:"header" minLength:"1"`
Lines []LocalKickstartDiffLine `json:"lines" nullable:"false"`
}
LocalKickstartHunk is one contiguous change. Header is the verbatim range text, for example "-18,7 +18,10".
func (*LocalKickstartHunk) UnmarshalJSON ¶ added in v0.49.0
func (h *LocalKickstartHunk) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown hunk field.
func (LocalKickstartHunk) Validate ¶ added in v0.49.0
func (h LocalKickstartHunk) Validate() error
Validate checks the header and every line.
type LocalKickstartIngest ¶ added in v0.49.0
type LocalKickstartIngest struct {
State LocalKickstartIngestState `json:"state"`
Note string `json:"note,omitempty"`
Error string `json:"error,omitempty"`
New int `json:"new" minimum:"0"`
Updated int `json:"updated" minimum:"0"`
}
LocalKickstartIngest is the import progress. New and Updated are counts of sessions the import has written, not a page.
func (*LocalKickstartIngest) UnmarshalJSON ¶ added in v0.49.0
func (n *LocalKickstartIngest) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown ingest field.
func (LocalKickstartIngest) Validate ¶ added in v0.49.0
func (n LocalKickstartIngest) Validate() error
Validate checks the state and the counts.
type LocalKickstartIngestState ¶ added in v0.49.0
type LocalKickstartIngestState string
LocalKickstartIngestState is the import started at the end of a commit. busy means an import is already running and the finish panel offers import now. The ingest status route is only the reconnect fallback.
const ( LocalKickstartIngestIdle LocalKickstartIngestState = "idle" LocalKickstartIngestRunning LocalKickstartIngestState = "running" LocalKickstartIngestBusy LocalKickstartIngestState = "busy" LocalKickstartIngestFailed LocalKickstartIngestState = "failed" )
func NewLocalKickstartIngestState ¶ added in v0.49.0
func NewLocalKickstartIngestState(raw string) (LocalKickstartIngestState, error)
NewLocalKickstartIngestState refuses a token outside the menu.
func (LocalKickstartIngestState) IsValid ¶ added in v0.49.0
func (v LocalKickstartIngestState) IsValid() bool
func (LocalKickstartIngestState) JSONSchema ¶ added in v0.49.0
func (LocalKickstartIngestState) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartIngestState) String ¶ added in v0.49.0
func (v LocalKickstartIngestState) String() string
func (*LocalKickstartIngestState) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartIngestState) UnmarshalJSON(data []byte) error
type LocalKickstartLine ¶ added in v0.49.0
type LocalKickstartLine struct {
Kind LocalKickstartLineKind `json:"kind"`
Text string `json:"text"`
}
LocalKickstartLine is one typed preview or example line.
func (*LocalKickstartLine) UnmarshalJSON ¶ added in v0.49.0
func (l *LocalKickstartLine) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown line field.
func (LocalKickstartLine) Validate ¶ added in v0.49.0
func (l LocalKickstartLine) Validate() error
Validate checks the line kind.
type LocalKickstartLineKind ¶ added in v0.49.0
type LocalKickstartLineKind string
LocalKickstartLineKind is one typed preview or example line. A future guide example reuses this set; it does not invent a second line type.
const ( LocalKickstartLineText LocalKickstartLineKind = "text" LocalKickstartLineLabel LocalKickstartLineKind = "label" LocalKickstartLineBefore LocalKickstartLineKind = "before" LocalKickstartLineAfter LocalKickstartLineKind = "after" LocalKickstartLineSpacer LocalKickstartLineKind = "spacer" )
func NewLocalKickstartLineKind ¶ added in v0.49.0
func NewLocalKickstartLineKind(raw string) (LocalKickstartLineKind, error)
NewLocalKickstartLineKind refuses a token outside the menu.
func (LocalKickstartLineKind) IsValid ¶ added in v0.49.0
func (v LocalKickstartLineKind) IsValid() bool
func (LocalKickstartLineKind) JSONSchema ¶ added in v0.49.0
func (LocalKickstartLineKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartLineKind) String ¶ added in v0.49.0
func (v LocalKickstartLineKind) String() string
func (*LocalKickstartLineKind) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartLineKind) UnmarshalJSON(data []byte) error
type LocalKickstartNextStep ¶ added in v0.49.0
type LocalKickstartNextStep string
LocalKickstartNextStep is one finish action. The web list is these five. The terminal list is the first four; that filter belongs to the terminal, not to a second wire set.
const ( LocalKickstartNextStepConfig LocalKickstartNextStep = "config" LocalKickstartNextStepWebStart LocalKickstartNextStep = "web-start" LocalKickstartNextStepVillageLogin LocalKickstartNextStep = "village-login" LocalKickstartNextStepVillagePush LocalKickstartNextStep = "village-push" LocalKickstartNextStepAutoPublish LocalKickstartNextStep = "auto-publish-settings" )
func NewLocalKickstartNextStep ¶ added in v0.49.0
func NewLocalKickstartNextStep(raw string) (LocalKickstartNextStep, error)
NewLocalKickstartNextStep refuses a token outside the menu.
func (LocalKickstartNextStep) IsValid ¶ added in v0.49.0
func (v LocalKickstartNextStep) IsValid() bool
func (LocalKickstartNextStep) JSONSchema ¶ added in v0.49.0
func (LocalKickstartNextStep) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartNextStep) String ¶ added in v0.49.0
func (v LocalKickstartNextStep) String() string
func (*LocalKickstartNextStep) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartNextStep) UnmarshalJSON(data []byte) error
type LocalKickstartNode ¶ added in v0.49.0
type LocalKickstartNode struct {
ID string `json:"id" minLength:"1"`
ParentID string `json:"parentId,omitempty"`
Kind LocalKickstartNodeKind `json:"kind"`
State LocalKickstartNodeState `json:"state"`
Label string `json:"label" minLength:"1"`
// SessionID identifies a stored transcript, not the kickstart session carried by events.
SessionID string `json:"sessionId,omitempty"`
Harness string `json:"harness,omitempty"`
ChildCount int `json:"childCount,omitempty" minimum:"0"`
Locked bool `json:"locked,omitempty"`
}
LocalKickstartNode is one forest row. State is server-supplied. Locked is a boolean, not a fourth state: a locked row is disabled, and the page does not recompute either fact.
func (*LocalKickstartNode) UnmarshalJSON ¶ added in v0.49.0
func (n *LocalKickstartNode) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown node field.
func (LocalKickstartNode) Validate ¶ added in v0.49.0
func (n LocalKickstartNode) Validate() error
Validate checks the kind, the state, and that locked was not smuggled in as a state token. The state check is the closed set; locked is only a bool.
type LocalKickstartNodeKind ¶ added in v0.49.0
type LocalKickstartNodeKind string
LocalKickstartNodeKind is one row in the selection forest.
const ( LocalKickstartNodeProject LocalKickstartNodeKind = "project" LocalKickstartNodeGroup LocalKickstartNodeKind = "group" LocalKickstartNodeBranch LocalKickstartNodeKind = "branch" LocalKickstartNodeSession LocalKickstartNodeKind = "session" )
func NewLocalKickstartNodeKind ¶ added in v0.49.0
func NewLocalKickstartNodeKind(raw string) (LocalKickstartNodeKind, error)
NewLocalKickstartNodeKind refuses a token outside the menu.
func (LocalKickstartNodeKind) IsValid ¶ added in v0.49.0
func (v LocalKickstartNodeKind) IsValid() bool
func (LocalKickstartNodeKind) JSONSchema ¶ added in v0.49.0
func (LocalKickstartNodeKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartNodeKind) String ¶ added in v0.49.0
func (v LocalKickstartNodeKind) String() string
func (*LocalKickstartNodeKind) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartNodeKind) UnmarshalJSON(data []byte) error
type LocalKickstartNodeState ¶ added in v0.49.0
type LocalKickstartNodeState string
LocalKickstartNodeState is the server-computed selection of one row and its descendants. locked is not a state; it is a separate boolean.
const ( LocalKickstartNodeNone LocalKickstartNodeState = "none" LocalKickstartNodeSome LocalKickstartNodeState = "some" LocalKickstartNodeAll LocalKickstartNodeState = "all" )
func NewLocalKickstartNodeState ¶ added in v0.49.0
func NewLocalKickstartNodeState(raw string) (LocalKickstartNodeState, error)
NewLocalKickstartNodeState refuses a token outside the menu.
func (LocalKickstartNodeState) IsValid ¶ added in v0.49.0
func (v LocalKickstartNodeState) IsValid() bool
func (LocalKickstartNodeState) JSONSchema ¶ added in v0.49.0
func (LocalKickstartNodeState) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartNodeState) String ¶ added in v0.49.0
func (v LocalKickstartNodeState) String() string
func (*LocalKickstartNodeState) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartNodeState) UnmarshalJSON(data []byte) error
type LocalKickstartOpenRequest ¶ added in v0.49.0
type LocalKickstartOpenRequest struct {
Scope LocalKickstartScope `json:"scope"`
}
LocalKickstartOpenRequest opens or joins the session for one scope.
func (*LocalKickstartOpenRequest) UnmarshalJSON ¶ added in v0.49.0
func (r *LocalKickstartOpenRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown field on the open body.
func (LocalKickstartOpenRequest) Validate ¶ added in v0.49.0
func (r LocalKickstartOpenRequest) Validate() error
Validate checks that the body names a published scope.
type LocalKickstartOption ¶ added in v0.49.0
type LocalKickstartOption struct {
Value string `json:"value"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
}
LocalKickstartOption is one choice. Value is the stable wire token.
func (*LocalKickstartOption) UnmarshalJSON ¶ added in v0.49.0
func (o *LocalKickstartOption) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown option field.
func (LocalKickstartOption) Validate ¶ added in v0.49.0
func (o LocalKickstartOption) Validate() error
Validate checks the token and the label. An empty token is allowed when that is a meaningful choice; the label is what the page shows.
type LocalKickstartOverwrite ¶ added in v0.49.0
type LocalKickstartOverwrite struct {
Key string `json:"key" minLength:"1"`
Previous LocalSettingValue `json:"previous"`
Revision uint64 `json:"revision" minimum:"0"`
}
LocalKickstartOverwrite names one field a stale write replaced, and the revision at which the replaced value was set.
func (*LocalKickstartOverwrite) UnmarshalJSON ¶ added in v0.49.0
func (o *LocalKickstartOverwrite) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown overwrite field.
func (LocalKickstartOverwrite) Validate ¶ added in v0.49.0
func (o LocalKickstartOverwrite) Validate() error
Validate checks the field key and the previous JSON value.
type LocalKickstartPatchResult ¶ added in v0.49.0
type LocalKickstartPatchResult struct {
Revision uint64 `json:"revision" minimum:"0"`
Stale bool `json:"stale"`
Overwritten []LocalKickstartOverwrite `json:"overwritten,omitempty" nullable:"false"`
View *LocalKickstartSession `json:"view,omitempty"`
}
LocalKickstartPatchResult is the PATCH response. A stale write is applied and reported; it is not a separate status. Overwritten names only the fields that changed after the caller's revision, so a stale result may legitimately carry none.
func (LocalKickstartPatchResult) MarshalJSON ¶ added in v0.49.0
func (r LocalKickstartPatchResult) MarshalJSON() ([]byte, error)
MarshalJSON preserves a supplied empty overwritten list distinctly from an omitted list.
func (*LocalKickstartPatchResult) UnmarshalJSON ¶ added in v0.49.0
func (r *LocalKickstartPatchResult) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown patch-result field.
func (LocalKickstartPatchResult) Validate ¶ added in v0.49.0
func (r LocalKickstartPatchResult) Validate() error
Validate checks that a stale result names only fields that were replaced, and that a current result names nothing. A stale request may replace no field at all: another tab can advance the revision while this caller edits a field nobody touched, so stale is true with an absent or empty overwritten list. An entry appears only for a field changed after the caller's revision.
type LocalKickstartPreview ¶ added in v0.49.0
type LocalKickstartPreview struct {
Lines []LocalKickstartLine `json:"lines" nullable:"false"`
}
LocalKickstartPreview is the bounded typed lines for one forest row.
func (*LocalKickstartPreview) UnmarshalJSON ¶ added in v0.49.0
func (p *LocalKickstartPreview) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown preview field.
func (LocalKickstartPreview) Validate ¶ added in v0.49.0
func (p LocalKickstartPreview) Validate() error
Validate checks every line.
type LocalKickstartPreviewCloseReason ¶ added in v0.58.0
type LocalKickstartPreviewCloseReason string
const ( LocalKickstartPreviewClosedByClient LocalKickstartPreviewCloseReason = "closed_by_client" LocalKickstartPreviewReplaced LocalKickstartPreviewCloseReason = "replaced" LocalKickstartPreviewSessionClosed LocalKickstartPreviewCloseReason = "session_closed" LocalKickstartPreviewRescanned LocalKickstartPreviewCloseReason = "rescanned" LocalKickstartPreviewIdle LocalKickstartPreviewCloseReason = "idle" LocalKickstartPreviewEvicted LocalKickstartPreviewCloseReason = "evicted" LocalKickstartPreviewShutdown LocalKickstartPreviewCloseReason = "shutdown" LocalKickstartPreviewSourceChanged LocalKickstartPreviewCloseReason = "source_changed" LocalKickstartPreviewLateResult LocalKickstartPreviewCloseReason = "late_result" LocalKickstartPreviewUnreadable LocalKickstartPreviewCloseReason = "unreadable" LocalKickstartPreviewOutOfOrder LocalKickstartPreviewCloseReason = "out_of_order" LocalKickstartPreviewSlowClient LocalKickstartPreviewCloseReason = "slow_client" LocalKickstartPreviewRowNotFound LocalKickstartPreviewCloseReason = "row_not_found" LocalKickstartPreviewNotSessionRow LocalKickstartPreviewCloseReason = "not_a_session_row" LocalKickstartPreviewNoTurns LocalKickstartPreviewCloseReason = "no_turns" LocalKickstartPreviewCapacity LocalKickstartPreviewCloseReason = "capacity" )
func NewLocalKickstartPreviewCloseReason ¶ added in v0.58.0
func NewLocalKickstartPreviewCloseReason(raw string) (LocalKickstartPreviewCloseReason, error)
func (LocalKickstartPreviewCloseReason) IsValid ¶ added in v0.58.0
func (v LocalKickstartPreviewCloseReason) IsValid() bool
func (LocalKickstartPreviewCloseReason) JSONSchema ¶ added in v0.58.0
func (LocalKickstartPreviewCloseReason) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartPreviewCloseReason) String ¶ added in v0.58.0
func (v LocalKickstartPreviewCloseReason) String() string
func (*LocalKickstartPreviewCloseReason) UnmarshalJSON ¶ added in v0.58.0
func (v *LocalKickstartPreviewCloseReason) UnmarshalJSON(data []byte) error
type LocalKickstartPreviewContinuation ¶ added in v0.58.0
type LocalKickstartPreviewContinuation string
const ( LocalKickstartPreviewContinuationMore LocalKickstartPreviewContinuation = "more" LocalKickstartPreviewContinuationEnd LocalKickstartPreviewContinuation = "end" LocalKickstartPreviewContinuationCut LocalKickstartPreviewContinuation = "cut" )
func NewLocalKickstartPreviewContinuation ¶ added in v0.58.0
func NewLocalKickstartPreviewContinuation(raw string) (LocalKickstartPreviewContinuation, error)
func (LocalKickstartPreviewContinuation) IsValid ¶ added in v0.58.0
func (v LocalKickstartPreviewContinuation) IsValid() bool
func (LocalKickstartPreviewContinuation) JSONSchema ¶ added in v0.58.0
func (LocalKickstartPreviewContinuation) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartPreviewContinuation) String ¶ added in v0.58.0
func (v LocalKickstartPreviewContinuation) String() string
func (*LocalKickstartPreviewContinuation) UnmarshalJSON ¶ added in v0.58.0
func (v *LocalKickstartPreviewContinuation) UnmarshalJSON(data []byte) error
type LocalKickstartPreviewCutReason ¶ added in v0.58.0
type LocalKickstartPreviewCutReason string
const ( LocalKickstartPreviewCutSourceBudget LocalKickstartPreviewCutReason = "source_budget" LocalKickstartPreviewCutSerializedBudget LocalKickstartPreviewCutReason = "serialized_budget" LocalKickstartPreviewCutTurnBudget LocalKickstartPreviewCutReason = "turn_budget" LocalKickstartPreviewCutOversizedRecord LocalKickstartPreviewCutReason = "oversized_record" LocalKickstartPreviewCutOriginNotResumable LocalKickstartPreviewCutReason = "origin_not_resumable" )
func NewLocalKickstartPreviewCutReason ¶ added in v0.58.0
func NewLocalKickstartPreviewCutReason(raw string) (LocalKickstartPreviewCutReason, error)
func (LocalKickstartPreviewCutReason) IsValid ¶ added in v0.58.0
func (v LocalKickstartPreviewCutReason) IsValid() bool
func (LocalKickstartPreviewCutReason) JSONSchema ¶ added in v0.58.0
func (LocalKickstartPreviewCutReason) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartPreviewCutReason) String ¶ added in v0.58.0
func (v LocalKickstartPreviewCutReason) String() string
func (*LocalKickstartPreviewCutReason) UnmarshalJSON ¶ added in v0.58.0
func (v *LocalKickstartPreviewCutReason) UnmarshalJSON(data []byte) error
type LocalKickstartPreviewDirectory ¶ added in v0.58.0
type LocalKickstartPreviewDirectory struct {
SessionID SessionID `json:"sessionId"`
Revision string `json:"revision" minLength:"1"`
Complete bool `json:"complete"`
LoadedSegments int `json:"loadedSegments" minimum:"0" maximum:"9007199254740991"`
LoadedTurns int `json:"loadedTurns" minimum:"0" maximum:"9007199254740991"`
LoadedConversationTurns *int `json:"loadedConversationTurns,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
SourceBytesLoaded *int `` /* 251-byte string literal not displayed */
SourceBytesTotal *int `` /* 236-byte string literal not displayed */
TotalSegments *int `json:"totalSegments,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
TotalTurns *int `json:"totalTurns,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
TotalConversationTurns *int `json:"totalConversationTurns,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
Segments []TranscriptSegmentRef `json:"segments" nullable:"false"`
}
LocalKickstartPreviewDirectory grows until the capture ends. Sent refs and segments are immutable; hasNewer records what was known at send time.
func (*LocalKickstartPreviewDirectory) UnmarshalJSON ¶ added in v0.58.0
func (d *LocalKickstartPreviewDirectory) UnmarshalJSON(data []byte) error
UnmarshalJSON rejects undeclared fields and null directory counters.
type LocalKickstartPreviewEvent ¶ added in v0.58.0
type LocalKickstartPreviewEvent struct {
Kind LocalKickstartPreviewEventKind `json:"kind"`
SessionID string `json:"sessionId"`
RequestID string `json:"requestId,omitempty"`
CaptureID string `json:"captureId,omitempty"`
Seq uint32 `json:"seq" minimum:"0" maximum:"4294967295"`
Header *SessionDetailPayload `json:"header,omitempty"`
Directory *LocalKickstartPreviewDirectory `json:"directory,omitempty"`
Segment *LocalKickstartPreviewSegment `json:"segment,omitempty"`
Continuation LocalKickstartPreviewContinuation `json:"continuation,omitempty"`
CutReason LocalKickstartPreviewCutReason `json:"cutReason,omitempty"`
Lines []LocalKickstartLine `json:"lines,omitempty"`
Reason LocalKickstartPreviewCloseReason `json:"reason,omitempty"`
Code LocalKickstartErrorCode `json:"code,omitempty"`
// Message is a fixed actionable sentence, never source text, paths, or
// identifiers the requester did not supply.
Message string `json:"message,omitempty"`
}
func (*LocalKickstartPreviewEvent) UnmarshalJSON ¶ added in v0.58.0
func (frame *LocalKickstartPreviewEvent) UnmarshalJSON(data []byte) error
UnmarshalJSON rejects undeclared event fields without echoing source content.
func (LocalKickstartPreviewEvent) Validate ¶ added in v0.58.0
func (frame LocalKickstartPreviewEvent) Validate() error
Validate checks the event's discriminated shape without echoing private data.
type LocalKickstartPreviewEventKind ¶ added in v0.58.0
type LocalKickstartPreviewEventKind string
const ( LocalKickstartPreviewOpened LocalKickstartPreviewEventKind = "opened" LocalKickstartPreviewSegmentEvent LocalKickstartPreviewEventKind = "segment" LocalKickstartPreviewClosed LocalKickstartPreviewEventKind = "closed" )
func NewLocalKickstartPreviewEventKind ¶ added in v0.58.0
func NewLocalKickstartPreviewEventKind(raw string) (LocalKickstartPreviewEventKind, error)
func (LocalKickstartPreviewEventKind) IsValid ¶ added in v0.58.0
func (v LocalKickstartPreviewEventKind) IsValid() bool
func (LocalKickstartPreviewEventKind) JSONSchema ¶ added in v0.58.0
func (LocalKickstartPreviewEventKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartPreviewEventKind) String ¶ added in v0.58.0
func (v LocalKickstartPreviewEventKind) String() string
func (*LocalKickstartPreviewEventKind) UnmarshalJSON ¶ added in v0.58.0
func (v *LocalKickstartPreviewEventKind) UnmarshalJSON(data []byte) error
type LocalKickstartPreviewOp ¶ added in v0.58.0
type LocalKickstartPreviewOp string
const ( LocalKickstartPreviewOpen LocalKickstartPreviewOp = "open" LocalKickstartPreviewMore LocalKickstartPreviewOp = "more" LocalKickstartPreviewClose LocalKickstartPreviewOp = "close" )
func NewLocalKickstartPreviewOp ¶ added in v0.58.0
func NewLocalKickstartPreviewOp(raw string) (LocalKickstartPreviewOp, error)
func (LocalKickstartPreviewOp) IsValid ¶ added in v0.58.0
func (v LocalKickstartPreviewOp) IsValid() bool
func (LocalKickstartPreviewOp) JSONSchema ¶ added in v0.58.0
func (LocalKickstartPreviewOp) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartPreviewOp) String ¶ added in v0.58.0
func (v LocalKickstartPreviewOp) String() string
func (*LocalKickstartPreviewOp) UnmarshalJSON ¶ added in v0.58.0
func (v *LocalKickstartPreviewOp) UnmarshalJSON(data []byte) error
type LocalKickstartPreviewRequest ¶ added in v0.58.0
type LocalKickstartPreviewRequest struct {
Op LocalKickstartPreviewOp `json:"op"`
RequestID string `json:"requestId" minLength:"1" maxLength:"32" pattern:"^[A-Za-z0-9_-]+$"`
SessionID string `json:"sessionId" minLength:"1" maxLength:"128" pattern:"^[A-Za-z0-9_-]+$"`
NodeID string `json:"nodeId,omitempty" maxLength:"512"`
CaptureID string `json:"captureId,omitempty" minLength:"22" maxLength:"22" pattern:"^[A-Za-z0-9_-]{21}[AQgw]$"`
After uint32 `json:"after,omitempty" minimum:"0" maximum:"4294967295"`
}
LocalKickstartPreviewRequest addresses a capture on the current connection.
func (*LocalKickstartPreviewRequest) UnmarshalJSON ¶ added in v0.58.0
func (r *LocalKickstartPreviewRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON rejects fields that cannot belong to a preview request.
func (LocalKickstartPreviewRequest) Validate ¶ added in v0.58.0
func (r LocalKickstartPreviewRequest) Validate() error
type LocalKickstartPreviewSegment ¶ added in v0.58.0
type LocalKickstartPreviewSegment struct {
TranscriptSegment
NativeMetadata []NativeMetadataRecord `json:"nativeMetadata,omitempty"`
RetainedUnknown []RetainedUnknownRecord `json:"retainedUnknown,omitempty"`
}
func (*LocalKickstartPreviewSegment) UnmarshalJSON ¶ added in v0.58.0
func (s *LocalKickstartPreviewSegment) UnmarshalJSON(data []byte) error
UnmarshalJSON preserves the canonical segment's required promoted fields.
type LocalKickstartPreviewState ¶ added in v0.58.0
type LocalKickstartPreviewState struct {
SessionID string
CaptureID string
Seq uint32
Header *SessionDetailPayload
Directory *LocalKickstartPreviewDirectory
Segments []LocalKickstartPreviewSegment
Continuation LocalKickstartPreviewContinuation
Closed *LocalKickstartPreviewEvent
}
func MergeLocalKickstartPreview ¶ added in v0.58.0
func MergeLocalKickstartPreview(held LocalKickstartPreviewState, frame LocalKickstartPreviewEvent) (LocalKickstartPreviewState, error)
MergeLocalKickstartPreview applies an ordered frame without mutating held data. As the producer-side merge, it verifies each turn's declared pre-bound byte length with TranscriptTurnByteLength: equality for untruncated turns and a lower bound for truncated turns. The TypeScript consumer checks declared lengths and their sum but does not duplicate the Go-only byte measure.
type LocalKickstartResolution ¶ added in v0.49.0
type LocalKickstartResolution string
LocalKickstartResolution chooses which side of one conflict row to keep. mine is the draft. theirs is the file as it is now. The words keep-mine and take-theirs are page copy, not wire tokens.
const ( LocalKickstartResolutionMine LocalKickstartResolution = "mine" LocalKickstartResolutionTheirs LocalKickstartResolution = "theirs" )
func NewLocalKickstartResolution ¶ added in v0.49.0
func NewLocalKickstartResolution(raw string) (LocalKickstartResolution, error)
NewLocalKickstartResolution refuses a token outside the menu.
func (LocalKickstartResolution) IsValid ¶ added in v0.49.0
func (v LocalKickstartResolution) IsValid() bool
func (LocalKickstartResolution) JSONSchema ¶ added in v0.49.0
func (LocalKickstartResolution) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartResolution) String ¶ added in v0.49.0
func (v LocalKickstartResolution) String() string
func (*LocalKickstartResolution) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartResolution) UnmarshalJSON(data []byte) error
type LocalKickstartScan ¶ added in v0.49.0
type LocalKickstartScan struct {
State LocalKickstartScanState `json:"state"`
Phase string `json:"phase,omitempty"`
Notice string `` /* 336-byte string literal not displayed */
Done int `json:"done" minimum:"0"`
Total int `json:"total" minimum:"0"`
Error string `json:"error,omitempty"`
LockedNodes int `json:"lockedNodes,omitempty" minimum:"0"`
DroppedSelections int `json:"droppedSelections,omitempty" minimum:"0"`
DroppedLabels []string `json:"droppedLabels,omitempty" nullable:"false" maxItems:"3"`
}
LocalKickstartScan is the discovery job. DroppedLabels names at most LocalKickstartDroppedLabelsMax vanished choices; the count is DroppedSelections. Phase is server prose for the step a running scan is on, not a closed set. Notice is separate server prose: it says which harness folders a finished scan could not read, so a scan that listed fewer sessions than expected explains itself, and it never travels in Phase. The forest is not in this object.
func (*LocalKickstartScan) UnmarshalJSON ¶ added in v0.49.0
func (s *LocalKickstartScan) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown scan field.
func (LocalKickstartScan) Validate ¶ added in v0.49.0
func (s LocalKickstartScan) Validate() error
Validate checks the state and the vanished-choice bound.
type LocalKickstartScanState ¶ added in v0.49.0
type LocalKickstartScanState string
LocalKickstartScanState is the discovery job. Progress is pushed; this token is the phase the push reports.
const ( LocalKickstartScanIdle LocalKickstartScanState = "idle" LocalKickstartScanRunning LocalKickstartScanState = "running" LocalKickstartScanDone LocalKickstartScanState = "done" LocalKickstartScanError LocalKickstartScanState = "error" )
func NewLocalKickstartScanState ¶ added in v0.49.0
func NewLocalKickstartScanState(raw string) (LocalKickstartScanState, error)
NewLocalKickstartScanState refuses a token outside the menu.
func (LocalKickstartScanState) IsValid ¶ added in v0.49.0
func (v LocalKickstartScanState) IsValid() bool
func (LocalKickstartScanState) JSONSchema ¶ added in v0.49.0
func (LocalKickstartScanState) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartScanState) String ¶ added in v0.49.0
func (v LocalKickstartScanState) String() string
func (*LocalKickstartScanState) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartScanState) UnmarshalJSON(data []byte) error
type LocalKickstartScope ¶ added in v0.49.0
type LocalKickstartScope string
LocalKickstartScope is the answer set a session collects. full is the whole wizard. selection is the standalone selection page. The informal label "kickstart" is not a token.
const ( LocalKickstartScopeFull LocalKickstartScope = "full" LocalKickstartScopeSelection LocalKickstartScope = "selection" )
func NewLocalKickstartScope ¶ added in v0.49.0
func NewLocalKickstartScope(raw string) (LocalKickstartScope, error)
NewLocalKickstartScope refuses a token outside the menu.
func (LocalKickstartScope) IsValid ¶ added in v0.49.0
func (v LocalKickstartScope) IsValid() bool
func (LocalKickstartScope) JSONSchema ¶ added in v0.49.0
func (LocalKickstartScope) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartScope) String ¶ added in v0.49.0
func (v LocalKickstartScope) String() string
func (*LocalKickstartScope) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartScope) UnmarshalJSON(data []byte) error
type LocalKickstartSession ¶ added in v0.49.0
type LocalKickstartSession struct {
ID string `json:"id" minLength:"1"`
Scope LocalKickstartScope `json:"scope"`
Revision uint64 `json:"revision" minimum:"0"`
OpenedAt string `json:"openedAt" minLength:"1"`
Stops []LocalKickstartStop `json:"stops" nullable:"false"`
Conflicts []LocalKickstartConflict `json:"conflicts" nullable:"false"`
Connect LocalKickstartConnect `json:"connect"`
Scan LocalKickstartScan `json:"scan"`
Village LocalKickstartVillage `json:"village"`
}
LocalKickstartSession is the reconnect snapshot and the live view. The forest is not here; the page loads it from the tree route.
func (*LocalKickstartSession) UnmarshalJSON ¶ added in v0.49.0
func (s *LocalKickstartSession) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown session field, including a tree, a page, or a reset control.
func (LocalKickstartSession) Validate ¶ added in v0.49.0
func (s LocalKickstartSession) Validate() error
Validate checks the snapshot and that it does not carry the forest.
type LocalKickstartStatus ¶ added in v0.49.0
type LocalKickstartStatus struct {
Configured bool `json:"configured"`
ActiveSessionID string `json:"activeSessionId,omitempty"`
}
LocalKickstartStatus is the first-run redirect hook. configured is the only status flag. activeSessionId, when present, is the one full-scope session id, not a directory and not a per-scope map.
func (*LocalKickstartStatus) UnmarshalJSON ¶ added in v0.49.0
func (s *LocalKickstartStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses a field other than configured and activeSessionId.
func (LocalKickstartStatus) Validate ¶ added in v0.49.0
func (s LocalKickstartStatus) Validate() error
Validate checks the redirect hook. An empty active session id is absence, not a third status.
type LocalKickstartStop ¶ added in v0.49.0
type LocalKickstartStop struct {
Key string `json:"key" minLength:"1"`
Kind LocalKickstartStopKind `json:"kind"`
Title string `json:"title" minLength:"1"`
Visible bool `json:"visible"`
HiddenBecause string `json:"hiddenBecause,omitempty"`
Guide LocalKickstartGuide `json:"guide"`
Fields []LocalKickstartField `json:"fields" nullable:"false"`
Summary *LocalKickstartSummary `json:"summary,omitempty"`
Diff *LocalKickstartDiff `json:"diff,omitempty"`
}
LocalKickstartStop is one step. HiddenBecause is a diagnostic token; the review copy is Summary. The connect offer is not a field of the stop.
func (*LocalKickstartStop) UnmarshalJSON ¶ added in v0.49.0
func (s *LocalKickstartStop) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown stop field.
func (LocalKickstartStop) Validate ¶ added in v0.49.0
func (s LocalKickstartStop) Validate() error
Validate checks the stop and its fields. A hidden stop may still be sent so the client does not decide visibility.
type LocalKickstartStopKind ¶ added in v0.49.0
type LocalKickstartStopKind string
LocalKickstartStopKind is the layout of one stop. The flow key is the identity; this token only chooses the layout.
const ( LocalKickstartStopConnection LocalKickstartStopKind = "connection" LocalKickstartStopConfig LocalKickstartStopKind = "config" LocalKickstartStopReview LocalKickstartStopKind = "review" LocalKickstartStopIngest LocalKickstartStopKind = "ingest" )
func NewLocalKickstartStopKind ¶ added in v0.49.0
func NewLocalKickstartStopKind(raw string) (LocalKickstartStopKind, error)
NewLocalKickstartStopKind refuses a token outside the menu.
func (LocalKickstartStopKind) IsValid ¶ added in v0.49.0
func (v LocalKickstartStopKind) IsValid() bool
func (LocalKickstartStopKind) JSONSchema ¶ added in v0.49.0
func (LocalKickstartStopKind) JSONSchema() (jsonschema.Schema, error)
func (LocalKickstartStopKind) String ¶ added in v0.49.0
func (v LocalKickstartStopKind) String() string
func (*LocalKickstartStopKind) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartStopKind) UnmarshalJSON(data []byte) error
type LocalKickstartSummary ¶ added in v0.49.0
type LocalKickstartSummary struct {
Values []string `json:"values" nullable:"false"`
Effects []string `json:"effects" nullable:"false"`
}
LocalKickstartSummary is the review stop's derived explanation. The client renders these rows and composes no sentence.
func (*LocalKickstartSummary) UnmarshalJSON ¶ added in v0.49.0
func (s *LocalKickstartSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown summary field.
func (LocalKickstartSummary) Validate ¶ added in v0.49.0
func (s LocalKickstartSummary) Validate() error
Validate checks both lists are present.
type LocalKickstartTree ¶ added in v0.49.0
type LocalKickstartTree struct {
Nodes []LocalKickstartNode `json:"nodes" nullable:"false"`
}
LocalKickstartTree is the whole forest; its size is len(Nodes). There is no cursor.
func (*LocalKickstartTree) UnmarshalJSON ¶ added in v0.49.0
func (t *LocalKickstartTree) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown tree field, including a page or a cursor.
func (LocalKickstartTree) Validate ¶ added in v0.49.0
func (t LocalKickstartTree) Validate() error
Validate checks every node.
type LocalKickstartVillage ¶ added in v0.49.0
type LocalKickstartVillage struct {
Connected bool `json:"connected"`
URL string `json:"url,omitempty"`
// UserID is an optional opaque account identifier, even when connected.
UserID string `json:"userId,omitempty" description:"Optional opaque account identifier; may be absent even when connected"`
}
LocalKickstartVillage is the sign-in fact the server already evaluated.
func (*LocalKickstartVillage) UnmarshalJSON ¶ added in v0.49.0
func (v *LocalKickstartVillage) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses an unknown village field.
func (LocalKickstartVillage) Validate ¶ added in v0.49.0
func (v LocalKickstartVillage) Validate() error
Validate accepts an optional account identifier, matching SyncAuthResponse.
type LocalOperationDiagnostic ¶ added in v0.31.0
type LocalOperationDiagnostic struct {
OperationID VillageUUID `json:"operationId"`
Operation CollectiveOperation `json:"operation"`
TranscriptID *TranscriptID `json:"transcriptId,omitempty"`
CollectiveID *VillageUUID `json:"collectiveId,omitempty"`
AttemptedAt time.Time `json:"attemptedAt"`
Outcome LocalOperationDiagnosticOutcome `json:"outcome"`
Issue OperationIssue `json:"issue"`
}
func (*LocalOperationDiagnostic) UnmarshalJSON ¶ added in v0.31.0
func (v *LocalOperationDiagnostic) UnmarshalJSON(data []byte) error
func (LocalOperationDiagnostic) Validate ¶ added in v0.31.0
func (d LocalOperationDiagnostic) Validate() error
type LocalOperationDiagnosticOutcome ¶ added in v0.31.0
type LocalOperationDiagnosticOutcome string
const ( LocalOperationDiagnosticFailed LocalOperationDiagnosticOutcome = "failed" LocalOperationDiagnosticUncertain LocalOperationDiagnosticOutcome = "uncertain" )
func (LocalOperationDiagnosticOutcome) IsValid ¶ added in v0.31.0
func (v LocalOperationDiagnosticOutcome) IsValid() bool
func (LocalOperationDiagnosticOutcome) JSONSchema ¶ added in v0.31.0
func (LocalOperationDiagnosticOutcome) JSONSchema() (jsonschema.Schema, error)
type LocalOwner ¶ added in v0.64.0
type LocalOwner struct {
// ID is the stable local owner identifier generated once per data directory.
ID string `json:"id" minLength:"1" maxLength:"64"`
// CreatedAt is when this directory's local owner was first created.
CreatedAt time.Time `json:"createdAt"`
}
LocalOwner is the one permanent owner of a peasant data directory. It is not a Village account, a username, or an email address: it is created once for the directory and survives every sign-out and sign-in. A store holds exactly one local owner for its whole life.
func (LocalOwner) Validate ¶ added in v0.64.0
func (o LocalOwner) Validate() error
Validate checks the local owner identity and creation time.
type LocalOwnerClaimPrompt ¶ added in v0.64.0
type LocalOwnerClaimPrompt struct {
// State is the computed prompt state.
State LocalOwnerPromptState `json:"state"`
// Account is the selected account scope: a normalized full Village base URL
// plus a stable Village user UUID. It is present exactly when signed in.
Account *CollectiveObservationScope `json:"account,omitempty" nullable:"false"`
// DecidedAt is when the prompt was declined or a claim decision completed.
// It is absent while the prompt is not applicable or still due.
DecidedAt *time.Time `json:"decidedAt,omitempty" nullable:"false"`
}
LocalOwnerClaimPrompt is the claim prompt's per-account state. The server computes it from the selected account and the decision recorded for this local owner plus account scope, so two surfaces never ask differently.
Account is present exactly when a Village account is selected, and absent for not_applicable. DecidedAt is present exactly when the state is settled (declined or completed) and absent for not_applicable and due. A successful explicit claim records completed for the local owner plus account scope, including when it moves nothing, and replaces an earlier decline.
func (LocalOwnerClaimPrompt) Validate ¶ added in v0.64.0
func (p LocalOwnerClaimPrompt) Validate() error
Validate checks the closed state, the account scope, and the decided time against the state.
type LocalOwnerClaimRequest ¶ added in v0.64.0
type LocalOwnerClaimRequest struct {
All bool `json:"all"`
}
LocalOwnerClaimRequest is the claim control's body. all=false claims only unclaimed sessions and annotations; all=true claims every local session and annotation. An explicit claim appends a new entry and never rewrites history.
type LocalOwnerClaimResult ¶ added in v0.64.0
type LocalOwnerClaimResult struct {
// Status is the recomputed local owner status after the claim.
Status LocalOwnerStatus `json:"status"`
// Claimed is how many artifacts this action claimed.
Claimed int `json:"claimed" minimum:"0"`
// AlreadyClaimed is how many requested artifacts already named the selected
// account, under both the default and all requests. It never counts an
// artifact merely because it has a non-null pointer to another account.
AlreadyClaimed int `json:"alreadyClaimed" minimum:"0"`
// ClaimID is the entry this action appended. Every explicit claim appends
// one, so a claim that moved nothing still records its decision and returns
// the id. It is always present.
ClaimID string `json:"claimId" minLength:"1" maxLength:"64"`
}
LocalOwnerClaimResult is the claim route's answer: the same status the read and decline routes return, plus what this claim did.
func (LocalOwnerClaimResult) Validate ¶ added in v0.64.0
func (r LocalOwnerClaimResult) Validate() error
Validate checks the nested status, the non-negative counts, and the entry id.
type LocalOwnerOwnership ¶ added in v0.64.0
type LocalOwnerOwnership struct {
Sessions LocalOwnerOwnershipCounts `json:"sessions"`
Annotations LocalOwnerOwnershipCounts `json:"annotations"`
}
LocalOwnerOwnership is the local artifact ownership partition the claim control shows. Each kind partitions into unclaimed, mine, and others, and the three add up to total.
func (LocalOwnerOwnership) Validate ¶ added in v0.64.0
func (o LocalOwnerOwnership) Validate() error
Validate checks both partitions.
type LocalOwnerOwnershipCounts ¶ added in v0.64.0
type LocalOwnerOwnershipCounts struct {
// Total is every artifact of this kind the local store holds.
Total int `json:"total" minimum:"0"`
// Unclaimed is how many of them have no owner pointer.
Unclaimed int `json:"unclaimed" minimum:"0"`
// Mine is how many of them name an entry of the selected account. It is 0
// signed out, because there is no selected account to own an artifact.
Mine int `json:"mine" minimum:"0"`
// Others is how many of them name another account's entry.
Others int `json:"others" minimum:"0"`
}
LocalOwnerOwnershipCounts is the ownership partition of one local artifact kind.
func (LocalOwnerOwnershipCounts) Validate ¶ added in v0.64.0
func (c LocalOwnerOwnershipCounts) Validate() error
Validate checks that the partition is complete and non-negative.
type LocalOwnerPromptState ¶ added in v0.64.0
type LocalOwnerPromptState string
LocalOwnerPromptState is the server-computed claim prompt state for the signed-in account.
const ( // LocalOwnerPromptStateNotApplicable: no Village account is selected, so // there is no account scope to prompt for. LocalOwnerPromptStateNotApplicable LocalOwnerPromptState = "not_applicable" // LocalOwnerPromptStateDue: an account is selected and no decision exists // for this local owner plus account scope. LocalOwnerPromptStateDue LocalOwnerPromptState = "due" // LocalOwnerPromptStateDeclined: the person chose "not now" for this local // owner plus account scope. A decline writes no claim entry. LocalOwnerPromptStateDeclined LocalOwnerPromptState = "declined" // LocalOwnerPromptStateCompleted: a claim decision was completed for this // local owner plus account scope, including a claim action that found // nothing left to claim. A successful explicit claim (all true or false) // records this state with the same state write as the prompt and replaces // an earlier decline, so the read reports completed afterwards and a later // sign-in does not prompt again. LocalOwnerPromptStateCompleted LocalOwnerPromptState = "completed" )
func (LocalOwnerPromptState) IsValid ¶ added in v0.64.0
func (s LocalOwnerPromptState) IsValid() bool
IsValid reports whether s is a member of the prompt-state set.
func (LocalOwnerPromptState) JSONSchema ¶ added in v0.64.0
func (LocalOwnerPromptState) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalOwnerPromptState) String ¶ added in v0.64.0
func (s LocalOwnerPromptState) String() string
String returns the wire representation of the prompt state.
type LocalOwnerStatus ¶ added in v0.64.0
type LocalOwnerStatus struct {
Owner LocalOwner `json:"owner"`
// Claims is the most recent LocalOwnerRecentClaimLimit claim entries,
// newest first by insertion order (rowid descending). claimedAt is display
// data only and never decides the order. It is never null; an installation
// with no claims answers [].
Claims []LocalClaimEntry `json:"claims" nullable:"false"`
// TotalClaims is the number of entries in the whole append-only log, not
// only the page Claims carries. It never decides whether a cursor is
// present.
TotalClaims int `json:"totalClaims" minimum:"0"`
// NextBefore is the cursor for the next older page. It is the id of the
// last (oldest) entry in Claims and is present exactly when an older entry
// exists, found by reading one row past the page. A page shorter than
// LocalOwnerRecentClaimLimit never carries a cursor. The server decides
// presence; a client sends the value back as before.
NextBefore *string `json:"nextBefore,omitempty" minLength:"1" maxLength:"64" nullable:"false"`
// Prompt is the server-computed claim prompt state for the selected
// account.
Prompt LocalOwnerClaimPrompt `json:"prompt"`
// Ownership is the ownership partition of local sessions and annotations.
Ownership LocalOwnerOwnership `json:"ownership"`
}
LocalOwnerStatus is the local owner read: the one local owner, the most recent claim entries, the full claim total, the claim prompt state, and the artifact ownership counts. This is a local read and makes no network call.
func (LocalOwnerStatus) Validate ¶ added in v0.64.0
func (s LocalOwnerStatus) Validate() error
Validate checks the owner, the bounded non-null claim page, the total and cursor, the prompt, the ownership counts, and that every returned claim belongs to this owner. It never compares claimedAt: write order is the only claim order key and a clock step must not invalidate a page.
type LocalPublication ¶ added in v0.25.0
type LocalPublication struct {
SessionID string `json:"sessionId"`
State LocalPublicationState `json:"state"`
// TranscriptID, TranscriptURL, and PublishedAt are present exactly when
// State is published. PublishedAt is when Village last accepted this
// session's content, by a first publish or an update; a client counts the
// turns recorded after it to say about how many turns are new. The count
// is approximate: it compares this computer's turn times with Village's
// accept time.
TranscriptID *TranscriptID `json:"transcriptId,omitempty" nullable:"false"`
TranscriptURL string `json:"transcriptUrl,omitempty"`
PublishedAt *time.Time `json:"publishedAt,omitempty" nullable:"false"`
// LastAttempt is the most recent failed attempt, absent when none is
// recorded.
LastAttempt *LocalPublicationAttemptFailure `json:"lastAttempt,omitempty" nullable:"false"`
// AutoPublish reports that an executable Peasant upload hook can publish
// this session on a commit or push. Rule-required hooks need an active rule
// for that repository and event; removing or pausing the last binding makes
// the retained hook dormant. Separately installed terminal hooks have their
// own consent. False when the saved ingestion and push selection leaves the
// session out or when rules cannot be read. When the saved selection itself
// cannot be determined, the enclosing operation reports a failure with an
// actionable cause rather than reporting a fabricated false.
AutoPublish bool `` /* 605-byte string literal not displayed */
// OutsideSelection reports whether the saved ingestion and push selection
// leaves this session out. It describes future ingests and upload-hook
// eligibility only: it is not a browsing permission, so that selection
// leaves an otherwise eligible stored session listed, resolvable by
// identifier, and counted, with outsideSelection true. The value is never
// fabricated: when the saved selection cannot be determined, the enclosing
// operation reports a failure with an actionable cause rather than omitting
// the row or guessing.
OutsideSelection bool `` /* 496-byte string literal not displayed */
// Audience lists the collectives the transcript is shared with. It is
// present on a published row exactly when the request asked for
// include=audience, as [] when the transcript is shared with no
// collective, and never on an unpublished row.
Audience *[]LocalPublicationAudienceMember `json:"audience,omitempty" nullable:"false"`
}
LocalPublication is the durable publication state of one local session for the Village account this computer is signed in to: the stored credential's Village and user. A publication recorded for another account is not reported, and a signed-out computer reports every session unpublished.
func (LocalPublication) Validate ¶ added in v0.25.0
func (p LocalPublication) Validate() error
Validate checks the state pairing and the audience of one publication row.
type LocalPublicationAttemptFailure ¶ added in v0.25.0
type LocalPublicationAttemptFailure struct {
AttemptedAt time.Time `json:"attemptedAt"`
Message string `json:"message"`
}
LocalPublicationAttemptFailure is the most recent failed publish attempt recorded for a session. A client compares AttemptedAt with the publication's PublishedAt to tell whether the failure is newer than the last success.
type LocalPublicationAudienceMember ¶ added in v0.25.0
type LocalPublicationAudienceMember struct {
CollectiveID VillageUUID `json:"collectiveId"`
Name string `json:"name"`
Status VillageShareStatus `json:"status"`
}
LocalPublicationAudienceMember is one collective a published transcript is shared with. Status is the collective's current share status: approved means its members can read the transcript, pending means the collective's owner has not approved it yet.
type LocalPublicationState ¶ added in v0.25.0
type LocalPublicationState string
LocalPublicationState is whether a local session has a publication on Village.
const ( // LocalPublicationUnpublished: no publication of this session is recorded. LocalPublicationUnpublished LocalPublicationState = "unpublished" // LocalPublicationPublished: Village holds a transcript of this session. LocalPublicationPublished LocalPublicationState = "published" )
func (LocalPublicationState) IsValid ¶ added in v0.25.0
func (s LocalPublicationState) IsValid() bool
func (LocalPublicationState) JSONSchema ¶ added in v0.25.0
func (LocalPublicationState) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalPublicationState) String ¶ added in v0.25.0
func (s LocalPublicationState) String() string
type LocalPublicationsResponse ¶ added in v0.25.0
type LocalPublicationsResponse struct {
Publications []LocalPublication `json:"publications" nullable:"false"`
}
LocalPublicationsResponse is the response of GET /api/v1/publications. It holds one row per requested session that exists on this computer; an identifier that names no session is omitted.
func (LocalPublicationsResponse) Validate ¶ added in v0.25.0
func (r LocalPublicationsResponse) Validate() error
Validate checks every row and that each session appears once.
type LocalRemoteContributionAttempt ¶ added in v0.31.0
type LocalRemoteContributionAttempt struct {
CollectiveID VillageUUID `json:"collectiveId"`
TranscriptID TranscriptID `json:"transcriptId"`
Attempt VillageShareEvent `json:"attempt"`
FirstSeenAt time.Time `json:"firstSeenAt"`
}
LocalRemoteContributionAttempt is retained owner-history evidence. Attempt is a projection of a server attempt, not an immutable status-change event. The enclosing storage scope supplies the Village URL and authenticated user.
func (*LocalRemoteContributionAttempt) UnmarshalJSON ¶ added in v0.31.0
func (v *LocalRemoteContributionAttempt) UnmarshalJSON(data []byte) error
func (LocalRemoteContributionAttempt) Validate ¶ added in v0.31.0
func (attempt LocalRemoteContributionAttempt) Validate() error
type LocalSessionListItem ¶ added in v0.19.0
type LocalSessionListItem struct {
Kind SessionListItemKind `json:"kind"`
Transcript *LocalSessionRow `json:"transcript,omitempty"`
Context *HelperContextSummary `json:"context,omitempty"`
HelperGroups []HelperGroupSummary `json:"helperGroups,omitempty" nullable:"false"`
}
LocalSessionListItem is exactly one transcript row or owner context container, with zero or more collapsed helper groups.
func (LocalSessionListItem) Validate ¶ added in v0.19.0
func (i LocalSessionListItem) Validate() error
Validate checks the discriminated item arm and every nested route row/group.
type LocalSessionListPayload ¶ added in v0.19.0
type LocalSessionListPayload struct {
Items []LocalSessionListItem `json:"items" nullable:"false"`
NextItems []LocalSessionListItem `json:"nextItems" nullable:"false"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
PerPage PageSize `json:"perPage"`
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
Revision string `json:"revision" minLength:"1"`
OrdinarySessionTotal int `json:"ordinarySessionTotal" minimum:"0" maximum:"9007199254740991"`
HelperThreadTotal int `json:"helperThreadTotal" minimum:"0" maximum:"9007199254740991"`
}
LocalSessionListPayload is the opt-in grouped REST list response. It carries the shared offset page fields plus the grouped-only counts.
func (LocalSessionListPayload) Validate ¶ added in v0.19.0
func (p LocalSessionListPayload) Validate() error
Validate checks non-null collection and pagination/count boundaries.
type LocalSessionPage ¶ added in v0.42.0
type LocalSessionPage = OffsetPage[LocalSessionRow]
LocalSessionPage is the flat offset page of concrete route rows.
type LocalSessionRow ¶ added in v0.19.0
type LocalSessionRow struct {
Session SessionSummary `json:"session"`
Sync *LocalSyncSummary `json:"sync,omitempty"`
Matches []SearchResult `json:"matches,omitempty" nullable:"false"`
Title string `json:"title,omitempty"`
}
LocalSessionRow is one concrete local route row. Sync and Matches retain the existing route-specific data instead of coercing every route into one shape. Title is the stored session title; the search variant omits it because its match rows already carry the matched content.
func (LocalSessionRow) Validate ¶ added in v0.19.0
func (r LocalSessionRow) Validate() error
Validate checks route-variant identity and count mirrors without deriving one metric from another.
type LocalSetting ¶ added in v0.25.0
type LocalSetting struct {
// Key is the setting's dotted configuration path, for example
// push.concurrency.
Key string `json:"key" minLength:"1"`
Kind LocalSettingKind `json:"kind"`
// Value is what the configuration file names for the key, or null when
// the file does not name it. A choice value may lie outside Options when
// the server still accepts it from an existing file but no longer offers
// it; Effective then names what applies.
Value LocalSettingValue `json:"value"`
// Effective is the value that applies now: normally Value when the key is
// set, otherwise the server's default, and it can differ from Value when
// something outside the file, such as an environment variable, overrides
// it. It is null only when no value applies. A client shows Effective, so
// an unset key never reads as off or blank when its default is on or
// filled.
Effective LocalSettingValue `json:"effective"`
// Options is the menu of a choice setting; an option may be the empty
// string when that is a meaningful setting. Other kinds have none.
Options []string `json:"options,omitempty" nullable:"false"`
// Editable reports that PATCH /api/v1/settings accepts this key. A key
// that changes another way, such as village.connected through sign-in and
// sign-out, is shown but not editable.
Editable bool `json:"editable"`
// InPeasantConfig reports that the terminal editor `peasant config` can
// also change this setting.
InPeasantConfig bool `json:"inPeasantConfig"`
// Description is Peasant's product text for the setting.
Description string `json:"description,omitempty"`
}
LocalSetting is one Peasant setting with its metadata.
func (LocalSetting) Validate ¶ added in v0.25.0
func (s LocalSetting) Validate() error
Validate checks the key, the kind, the options, and that the value matches the kind.
type LocalSettingKind ¶ added in v0.25.0
type LocalSettingKind string
LocalSettingKind is the JSON type of one setting's value. Peasant owns the key set, each key's description, and which keys are editable; this contract owns the value shapes.
const ( // LocalSettingBoolean: the value is a JSON boolean. LocalSettingBoolean LocalSettingKind = "boolean" // LocalSettingInteger: the value is a JSON integer. LocalSettingInteger LocalSettingKind = "integer" // LocalSettingString: the value is a JSON string. LocalSettingString LocalSettingKind = "string" // LocalSettingStringList: the value is a JSON array of strings. LocalSettingStringList LocalSettingKind = "string_list" // LocalSettingChoice: the value is one of the setting's options. LocalSettingChoice LocalSettingKind = "choice" // LocalSettingStructured: the value is the key's configuration value as a // JSON object or array, for example a list of custom redaction patterns. // It is only for a list or map of records; Peasant owns its shape. A key // whose value fits another kind uses that kind. LocalSettingStructured LocalSettingKind = "structured" )
func (LocalSettingKind) IsValid ¶ added in v0.25.0
func (k LocalSettingKind) IsValid() bool
func (LocalSettingKind) JSONSchema ¶ added in v0.25.0
func (LocalSettingKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalSettingKind) String ¶ added in v0.25.0
func (k LocalSettingKind) String() string
type LocalSettingRefusal ¶ added in v0.25.0
type LocalSettingRefusal struct {
Key string `json:"key" minLength:"1"`
Error string `json:"error" minLength:"1"`
}
LocalSettingRefusal is the body of a refused setting update: the key and why it was not changed. A refused update changes nothing.
func (LocalSettingRefusal) Validate ¶ added in v0.25.0
func (r LocalSettingRefusal) Validate() error
Validate checks that the refusal names the key and the reason.
type LocalSettingUpdateRequest ¶ added in v0.25.0
type LocalSettingUpdateRequest struct {
Key string `json:"key" minLength:"1"`
Value LocalSettingValue `json:"value"`
}
LocalSettingUpdateRequest is the body of PATCH /api/v1/settings. One request changes one key; a null value unsets it so the server's default applies.
func (LocalSettingUpdateRequest) Validate ¶ added in v0.25.0
func (r LocalSettingUpdateRequest) Validate() error
Validate checks that the request names a key and carries a value. The server checks the value against the key's kind with ValidateFor.
type LocalSettingValue ¶ added in v0.25.0
type LocalSettingValue []byte
LocalSettingValue is one setting's JSON value, held as its exact JSON text. The setting's kind chooses which JSON type it is. JSON null means the key is unset: the configuration file does not name it and the server's default applies. In an update, null unsets the key.
func LocalSettingNull ¶ added in v0.25.0
func LocalSettingNull() LocalSettingValue
LocalSettingNull returns a fresh JSON null, which a producer sets for an unset value or when no effective value applies.
func (LocalSettingValue) IsUnset ¶ added in v0.25.0
func (v LocalSettingValue) IsUnset() bool
IsUnset reports whether the value is JSON null. A nil value is unset too: it marshals as null.
func (LocalSettingValue) JSONSchema ¶ added in v0.25.0
func (LocalSettingValue) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (LocalSettingValue) MarshalJSON ¶ added in v0.25.0
func (v LocalSettingValue) MarshalJSON() ([]byte, error)
MarshalJSON emits the held JSON text.
func (*LocalSettingValue) UnmarshalJSON ¶ added in v0.25.0
func (v *LocalSettingValue) UnmarshalJSON(data []byte) error
UnmarshalJSON keeps the JSON text as received, in fresh storage so decoding never writes into a value another variable shares.
func (LocalSettingValue) ValidateFor ¶ added in v0.25.0
func (v LocalSettingValue) ValidateFor(kind LocalSettingKind, options []string) error
ValidateFor checks that a set value has the JSON type kind names and, for a choice, is one of options. An unset value, nil or JSON null, is valid for every kind. A producer checks an update's value against the key's kind with this method.
type LocalSettingsResponse ¶ added in v0.25.0
type LocalSettingsResponse struct {
Settings []LocalSetting `json:"settings" nullable:"false"`
AutoPublish []AutoPublishRule `json:"autoPublish" nullable:"false"`
}
LocalSettingsResponse is the response of GET /api/v1/settings: every setting the settings page shows and every auto-publish rule.
func (LocalSettingsResponse) Validate ¶ added in v0.25.0
func (r LocalSettingsResponse) Validate() error
Validate checks every setting and rule and that keys and identifiers do not repeat.
type LocalSyncProjectOption ¶ added in v0.30.0
type LocalSyncProjectOption struct {
ProjectHash ProjectHash `json:"projectHash"`
ProjectName string `json:"projectName"`
}
type LocalSyncProjectOptions ¶ added in v0.30.0
type LocalSyncProjectOptions struct {
Projects []LocalSyncProjectOption `json:"projects" nullable:"false"`
}
LocalSyncProjectOptions contains the complete stored root picker, independent of the chosen root project/publication filter. No counts or enrichment.
func (LocalSyncProjectOptions) Validate ¶ added in v0.30.0
func (o LocalSyncProjectOptions) Validate() error
type LocalSyncPublicationFilter ¶ added in v0.30.0
type LocalSyncPublicationFilter string
LocalSyncPublicationFilter narrows the stored root cohort before paging.
const ( LocalSyncPublicationAll LocalSyncPublicationFilter = "all" LocalSyncPublicationNotPublished LocalSyncPublicationFilter = "not-published" LocalSyncPublicationPublished LocalSyncPublicationFilter = "published" LocalSyncPublicationAuto LocalSyncPublicationFilter = "auto" )
func (LocalSyncPublicationFilter) IsValid ¶ added in v0.30.0
func (f LocalSyncPublicationFilter) IsValid() bool
func (LocalSyncPublicationFilter) JSONSchema ¶ added in v0.30.0
func (LocalSyncPublicationFilter) JSONSchema() (jsonschema.Schema, error)
func (LocalSyncPublicationFilter) String ¶ added in v0.30.0
func (f LocalSyncPublicationFilter) String() string
type LocalSyncSessionPage ¶ added in v0.30.0
type LocalSyncSessionPage struct {
OffsetPage[LocalSyncSessionRow]
Totals *LocalSyncSessionTotals `json:"totals,omitempty" nullable:"false"`
}
LocalSyncSessionPage is the concrete offset page for the sync resource, not a second shape: it embeds OffsetPage[LocalSyncSessionRow] and adds the grouped root total. Totals is optional, so a page answers with six or seven fields: a reader that has no root total omits it rather than fabricating a zero.
func (LocalSyncSessionPage) Validate ¶ added in v0.42.0
func (p LocalSyncSessionPage) Validate() error
type LocalSyncSessionRow ¶ added in v0.30.0
type LocalSyncSessionRow struct {
Sync LocalSyncSummary `json:"sync"`
Publication LocalPublication `json:"publication"`
Title string `json:"title"`
Preview string `json:"preview"`
ChildCount int `json:"childCount" minimum:"0"`
}
LocalSyncSessionRow hydrates only a returned session, sharing the canonical sync/publication projections. Preview is bounded and redaction-safe. A row may carry OutsideSelection: that field reports ingestion and upload-hook selection membership, so it never removes a stored row from a page.
func (LocalSyncSessionRow) Validate ¶ added in v0.30.0
func (r LocalSyncSessionRow) Validate() error
type LocalSyncSessionTotals ¶ added in v0.42.0
type LocalSyncSessionTotals struct {
Sessions int `json:"sessions" minimum:"0" maximum:"9007199254740991"`
}
LocalSyncSessionTotals is the pushable-session count beside one offset page. It counts the same request filter on both branches: the filtered session set on a root page and the same filtered session set (not the paged children) on a child page. It is independent of the page total, which counts the paged roots or children.
func (LocalSyncSessionTotals) Validate ¶ added in v0.42.0
func (t LocalSyncSessionTotals) Validate() error
type LocalSyncSessionsPayload ¶ added in v0.19.0
type LocalSyncSessionsPayload struct {
Sessions []LocalSyncSummary `json:"sessions" nullable:"false"`
}
LocalSyncSessionsPayload is the exact omitted-view response produced by the existing local sync chooser. Every row carries its status; a session absent from the response has no status here, and a client must not read absence as new.
func (LocalSyncSessionsPayload) Validate ¶ added in v0.25.0
func (p LocalSyncSessionsPayload) Validate() error
Validate checks that the flat sync list is an array of valid rows and lists each session once.
type LocalSyncSessionsQuery ¶ added in v0.30.0
type LocalSyncSessionsQuery struct {
View string `` /* 204-byte string literal not displayed */
MaxItems *int `` /* 186-byte string literal not displayed */
Page *int `query:"page" nullable:"false" minimum:"1" description:"Home only: one-based page number; omitted defaults to 1"`
PageToken *string `` /* 183-byte string literal not displayed */
ParentSessionID *string `query:"parentSessionId" nullable:"false" minLength:"1"`
ProjectHash *ProjectHash `query:"projectHash" nullable:"false"`
Publication *LocalSyncPublicationFilter `` /* 193-byte string literal not displayed */
}
LocalSyncSessionsQuery is the sync resource's query. The omitted view is Home: it serves the same bounded offset page as view=home. An explicit grouped or project-options read keeps its legacy envelope and refuses paging fields. pageToken is retained only so an old client receives an actionable refusal; no reader consumes a token.
func ParseLocalSyncSessionsQuery ¶ added in v0.30.0
func ParseLocalSyncSessionsQuery(values url.Values) (LocalSyncSessionsQuery, error)
ParseLocalSyncSessionsQuery preserves parameter presence and rejects ambiguous repeated values before handlers dispatch to a domain reader.
func (LocalSyncSessionsQuery) EffectivePage ¶ added in v0.42.0
func (q LocalSyncSessionsQuery) EffectivePage() int
EffectivePage applies the one-based default after validation.
func (LocalSyncSessionsQuery) EffectivePageSize ¶ added in v0.42.0
func (q LocalSyncSessionsQuery) EffectivePageSize() (PageSize, error)
EffectivePageSize applies the Home transport's default after validation. An omitted or zero maxItems maps to 25; any other value is re-parsed through the constructor and its error is returned, so an unvalidated non-member can never silently become page size zero.
func (LocalSyncSessionsQuery) HasPageToken ¶ added in v0.42.0
func (q LocalSyncSessionsQuery) HasPageToken() bool
HasPageToken reports whether a non-empty retired continuation was supplied. An empty pageToken is absent, exactly as an omitted one is.
func (LocalSyncSessionsQuery) Home ¶ added in v0.42.0
func (q LocalSyncSessionsQuery) Home() bool
Home reports whether the query selects the offset Home read. The omitted view is Home; grouped and project-options are not.
func (LocalSyncSessionsQuery) Validate ¶ added in v0.30.0
func (q LocalSyncSessionsQuery) Validate() error
type LocalSyncSummary ¶ added in v0.19.0
type LocalSyncSummary struct {
ID string `json:"id"`
Harness Harness `json:"harness"`
ProjectName string `json:"projectName"`
ProjectHash ProjectHash `json:"projectHash"`
HostSlug string `json:"hostSlug"`
StartTime string `json:"startTime"`
DurationMs int64 `json:"durationMs"`
TotalTokens int `json:"totalTokens"`
TurnCount int `` /* 254-byte string literal not displayed */
Model string `json:"model"`
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
SyncStatus SyncStatus `json:"syncStatus"`
// HoldReason says why a held row waits. Only a held row carries one.
HoldReason SyncHoldReason `json:"holdReason,omitempty"`
// PreviouslyPushed reports durable evidence that this session was
// published before. It is independent of SyncStatus: a held row can have
// been published, so a client reads this field instead of inferring it.
PreviouslyPushed bool `json:"previouslyPushed"`
// ParentSessionID is the durable logical parent of a spawned child, the
// same value its SessionSummary carries. It may name a session this store
// does not hold. Absent for a root or a fork.
ParentSessionID *string `json:"parentSessionId,omitempty" nullable:"false"`
// ParentUnresolved marks a known spawned child whose parent cannot be
// named. At most one of ParentSessionID and ParentUnresolved=true is set.
ParentUnresolved *bool `json:"parentUnresolved,omitempty" nullable:"false"`
// Teammate is the Claude Code teammate identity this session was spawned
// under, the same value its SessionSummary carries. Present only when the
// stored parent transcript records spawning that exact identity.
Teammate *SessionTeammate `json:"teammate,omitempty"`
// Owner names whose artifact this session is in the local store, the same
// value its SessionSummary carries. An absent value means this server does
// not project owners; {"kind":"unknown"} means projected but withheld. It
// never falls back to the local holder for a pulled row.
Owner *LocalArtifactIdentity `json:"owner,omitempty" nullable:"false"`
// AdapterVersion identifies the Peasant adapter/parser that produced this
// local artifact, the same value its SessionSummary carries. It is omitted
// when unknown; a present revision is positive.
AdapterVersion *int `` /* 230-byte string literal not displayed */
}
LocalSyncSummary preserves the existing sync-list row alongside its matching SessionSummary when grouped list mode is requested.
func (LocalSyncSummary) Validate ¶ added in v0.25.0
func (s LocalSyncSummary) Validate() error
Validate checks the typed status, the hold reason pairing, and the count bounds of one sync chooser row. PreviouslyPushed is independent evidence: a held row can have been published before, so no status implies its value.
type LocalVillageCollective ¶ added in v0.25.0
type LocalVillageCollective struct {
Group VillageUserGroup `json:"group"`
// Suggestion is present when the server suggests this collective for the
// requested session.
Suggestion *LocalCollectiveSuggestion `json:"suggestion,omitempty" nullable:"false"`
}
LocalVillageCollective is one Village collective the signed-in user belongs to, as Village returns it, with the suggestion the local server computed.
type LocalVillageCollectivesResponse ¶ added in v0.25.0
type LocalVillageCollectivesResponse struct {
Collectives []LocalVillageCollective `json:"collectives" nullable:"false"`
}
LocalVillageCollectivesResponse is the response of GET /api/v1/village/collectives.
func (LocalVillageCollectivesResponse) Validate ¶ added in v0.25.0
func (r LocalVillageCollectivesResponse) Validate() error
Validate checks every suggestion and that each collective appears once.
type LongestStreak ¶ added in v0.42.0
type LongestStreak struct {
Weeks int `json:"weeks" minimum:"0" maximum:"9007199254740991"`
StartWeek *string `json:"startWeek"`
EndWeek *string `json:"endWeek"`
}
LongestStreak is the longest run of consecutive active weeks, with its first and last Monday-of-week keys. Both keys are null when no week is active.
type MapEdge ¶
type MapEdge struct {
From string `json:"from"` // node ID
To string `json:"to"`
Count int `json:"count"` // underlying import count (aggregated)
}
MapEdge is a structure (import) dependency between two nodes.
type MapGraphPayload ¶
type MapGraphPayload struct {
ProjectHash ProjectHash `json:"projectHash"`
RepoFound bool `json:"repoFound"` // canonical_cwd resolved to a git repo
RepoPath string `json:"repoPath,omitempty"`
ParsedLanguages []string `json:"parsedLanguages"` // e.g. ["go","typescript"]; empty => activity-only
Nodes []MapNode `json:"nodes"` // all zoom levels; parent links form the tree
StructureEdges []MapEdge `json:"structureEdges"` // parsed imports, aggregated per node pair
ActivityEdges []ActivityEdge `json:"activityEdges"` // co-EDIT observations
Violations []EdgeViolation `json:"violations"` // cycles + wrong-way edges
GeneratedAtMs int64 `json:"generatedAtMs"`
AtCommit string `json:"atCommit,omitempty"` // set when ?commit= was used
}
MapGraphPayload is the full map graph for one project, served by GET /api/v1/map/{projectHash}.
func NewMapGraphPayload ¶
func NewMapGraphPayload(projectHash ProjectHash) *MapGraphPayload
NewMapGraphPayload returns a MapGraphPayload with all slices initialized to empty (never-nil marshal guarantee).
type MapNode ¶
type MapNode struct {
ID string `json:"id"` // repo-relative path ("internal/ingest", "web/src/lib/api.ts")
Parent string `json:"parent,omitempty"` // ID of parent node ("" for top-level modules)
Kind MapNodeKind `json:"kind"`
Name string `json:"name"` // display leaf ("ingest")
Language string `json:"language,omitempty"`
Layer int `json:"layer"` // 0 = top row; deterministic
Order int `json:"order"` // stable sort within layer
Loc int `json:"loc"` // size metric (lines)
FileCount int `json:"fileCount"` // 1 for files
RecordedFiles int `json:"recordedFiles"` // files whose last edit is attributable to a recorded session
TotalFiles int `json:"totalFiles"`
TouchCount int `json:"touchCount"` // recorded edits in window (activity size metric)
EffortDensity float64 `json:"effortDensity"` // 0..1 per-file re-edit/error density rollup (0 when unknown)
// AgentEditedCount / ReadCount / ReadAttribution are the node-grain
// comprehension signals behind the ranked entry list's tri-state debt
// tag. ReadAttribution is the honesty field:
// a zero ReadCount is "unavailable" (no recoverable per-file read
// attribution for any editing session), "partial" (some do), or
// "complete" (all do) - never silently indistinguishable from unread.
AgentEditedCount int `json:"agentEditedCount"`
ReadCount int `json:"readCount"`
ReadAttribution ReadAttributionState `json:"readAttribution" required:"true"`
// ReadState is the composed effective read-state grade for the node's
// current content version. ChangedRegionCount
// / AttributedRegionCount / ReviewedRegionCount are the minimal per-node
// region-coverage counts over that same current version: total changed
// hunks, hunks the server could attribute to a producing turn, and
// attributed hunks whose producing turn carries a reviewed+ grade. They
// supply the client's hunk-linked hover ("N of M changed regions
// reviewed"). All are server-computed; the client-side debt
// derivation stays a pure function over these MapNode scalars.
ReadState ReadStateGrade `json:"readState" required:"true"`
ChangedRegionCount int `json:"changedRegionCount"`
AttributedRegionCount int `json:"attributedRegionCount"`
ReviewedRegionCount int `json:"reviewedRegionCount"`
}
MapNode is one square card on the map: a module, package, or file.
type MapNodeDetailPayload ¶
type MapNodeDetailPayload struct {
Path string `json:"path"`
Kind MapNodeKind `json:"kind"`
Language string `json:"language,omitempty"` // e.g. "go", "typescript"; "" for activity-only nodes
Loc int `json:"loc"`
RecordedFiles int `json:"recordedFiles"`
TotalFiles int `json:"totalFiles"`
SessionCount int `json:"sessionCount"`
TaskCount int `json:"taskCount"`
LastTouchMs *int64 `json:"lastTouchMs,omitempty"`
// DependsOn / UsedBy are the node's structural role, derived deterministically
// from the parsed import graph (what this area does): the node IDs
// this node imports, and those that import it. Most-connected first, capped.
// Empty when there is no parsed graph (activity-only) or no edges.
DependsOn []string `json:"dependsOn"`
UsedBy []string `json:"usedBy"`
ShapedBy []TaskSummary `json:"shapedBy"` // most recent first, cap 20
RecentCommits []CommitRef `json:"recentCommits"` // touching this node, cap 10
RetryLoops int `json:"retryLoops"` // summed over touching sessions
ReEdits int `json:"reEdits"` // re-edited files within this node
CostUsd *float64 `json:"costUsd,omitempty"` // nil when unknown
// RewrittenCommits lists ghost commits touching this node. It is empty when
// the resolver found no ghosts here.
RewrittenCommits []RewrittenCommit `json:"rewrittenCommits" required:"true" nullable:"false"`
// Insights carries mechanical and mined insight envelopes for this node.
// It is additive alongside the per-change Unusual/Frictions signals, never
// a replacement for them.
Insights []SessionInsight `json:"insights" required:"true" nullable:"false"`
}
MapNodeDetailPayload backs the node rail panel, served by GET /api/v1/map/{projectHash}/node?path=<id>.
func NewMapNodeDetailPayload ¶
func NewMapNodeDetailPayload(path string) *MapNodeDetailPayload
NewMapNodeDetailPayload returns a MapNodeDetailPayload with all slices initialized to empty (never-nil marshal guarantee).
func (MapNodeDetailPayload) Validate ¶
func (p MapNodeDetailPayload) Validate() error
Validate checks the additive rewrite and insight invariants: slices are non-nil, every RecentCommit and RewrittenCommit is well-formed, every RewrittenCommit's SuccessorHash (when set) is present in RecentCommits, shared successor and ledger associations are identical, and every SessionInsight is well-formed (including the Classification-must-be-nil rule). Unlike ReviewListPayload, a node detail payload carries no independent session table, so RewrittenCommits.SessionIDs are checked for well-formedness only (not cross-referenced against a session list this payload does not have).
type MapNodeKind ¶
type MapNodeKind string
MapNodeKind classifies a map node within the path-derived tree.
const ( MapNodeKindModule MapNodeKind = "module" MapNodeKindPackage MapNodeKind = "package" MapNodeKindFile MapNodeKind = "file" )
MapNodeKind values. Top-level directories are modules, nested directories are packages, and files are leaves (mirrors codegraph's node kinds).
func (MapNodeKind) IsValid ¶
func (k MapNodeKind) IsValid() bool
IsValid reports whether k is one of the defined node kinds.
func (MapNodeKind) JSONSchema ¶
func (MapNodeKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (MapNodeKind) String ¶
func (k MapNodeKind) String() string
String returns the wire representation of the node kind.
type MapSlice ¶
type MapSlice struct {
Nodes []MapNode `json:"nodes"` // layer/order preserved from full map
StructureEdges []MapEdge `json:"structureEdges"`
ActivityEdges []ActivityEdge `json:"activityEdges"`
}
MapSlice is a scoped sub-map: the touched nodes plus their one-hop neighborhood, with layer/order preserved from the full map.
func NewMapSlice ¶
func NewMapSlice() MapSlice
NewMapSlice returns a MapSlice with all slices initialized to empty (never-nil marshal guarantee).
type MedianP90 ¶ added in v0.42.0
type MedianP90 struct {
Count int `json:"count" minimum:"0" maximum:"9007199254740991"`
Median *float64 `json:"median"`
P90 *float64 `json:"p90"`
}
MedianP90 is one typical-value pair: the sample count, its median, and its ninetieth percentile. Median and P90 are null when the sample is empty.
type MessageType ¶
type MessageType string
MessageType represents the type discriminator for WebSocket messages.
const ( MsgSubscribe MessageType = "subscribe" MsgUnsubscribe MessageType = "unsubscribe" MsgDashboard MessageType = "dashboard" MsgSessions MessageType = "sessions" MsgSessionDetail MessageType = "session_detail" MsgTrends MessageType = "trends" MsgQuality MessageType = "quality" MsgAnnotations MessageType = "annotations" MsgProjectFamiliarity MessageType = "project_familiarity" MsgConnected MessageType = "connected" MsgError MessageType = "error" MsgKickstart MessageType = "kickstart" MsgKickstartPreview MessageType = "kickstart_preview" )
func (MessageType) IsValid ¶
func (m MessageType) IsValid() bool
IsValid reports whether m is a defined WebSocket message discriminator.
func (MessageType) JSONSchema ¶
func (MessageType) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (MessageType) String ¶
func (m MessageType) String() string
String returns the wire representation of the message discriminator.
type MockConfigResponse ¶
type MockConfigResponse struct {
Enabled bool `json:"enabled"`
Web []string `json:"web,omitempty"`
TUI []string `json:"tui,omitempty"`
API []string `json:"api,omitempty"`
}
MockConfigResponse is the JSON response for GET /api/v1/config/mock.
type ModelID ¶
type ModelID string
ModelID identifies a specific model version (e.g. "claude-opus-4-6").
func NewModelID ¶
NewModelID validates and constructs a ModelID.
func (ModelID) JSONSchema ¶
func (ModelID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type ModelInfo ¶
type ModelInfo struct {
Harness Harness `json:"harness" required:"true"`
Model ModelID `json:"model" required:"true"`
HarnessVersion string `json:"version,omitempty"`
HostSlug HostSlug `json:"hostSlug,omitempty"`
}
ModelInfo holds harness and model version information for a session. JSON tags use camelCase to match CLI UnifiedMetadata wire format. The harness is keyed json:"harness" (emit-side flip; was json:"modelHarness").
rc2 (#118): Harness and Model carry required:"true" so swaggest emits a SchemaModelInfo.required:["harness","model"] array — the village rejects a model object missing either key (the harness/model-within-model contract). Metadata only: these tags change the GENERATED schema's `required`, not the Go wire shape.
type NativeAttachmentRef ¶ added in v0.16.0
type NativeLimitInput ¶ added in v0.19.0
type NativeMetadataKind ¶ added in v0.16.0
type NativeMetadataKind string
const ( NativeMetadataPiCustomData NativeMetadataKind = "pi.custom.data" NativeMetadataPiCustomMessageDetails NativeMetadataKind = "pi.custommessage.details" NativeMetadataPiToolResultDetails NativeMetadataKind = "pi.toolresult.details" NativeMetadataPiCompactionDetails NativeMetadataKind = "pi.compaction.details" NativeMetadataPiBranchSummaryDetails NativeMetadataKind = "pi.branchsummary.details" NativeMetadataClaudeCodeCompactionDetails NativeMetadataKind = "claude-code.compaction.details" )
func NewNativeMetadataKind ¶ added in v0.16.0
func NewNativeMetadataKind(raw string) (NativeMetadataKind, error)
func (NativeMetadataKind) IsValid ¶ added in v0.16.0
func (v NativeMetadataKind) IsValid() bool
func (NativeMetadataKind) JSONSchema ¶ added in v0.16.0
func (NativeMetadataKind) JSONSchema() (jsonschema.Schema, error)
type NativeMetadataRecord ¶ added in v0.16.0
type NativeMetadataRecord struct {
ID string `json:"id"`
Kind NativeMetadataKind `json:"kind"`
Source NativeSourceRef `json:"source"`
// Attachment-bearing records must travel in the same partition as their
// target turn, in a durable read or a segment that includes the turn. V1
// segments carry no native metadata; positioned segments carry the records attached
// to their rows. Validation builds the turn map per
// partition, so a payload omitting the turn cannot carry its attached record.
// A metadata-only session_detail frame therefore carries only session-level
// records without attachments. Consumers read attached evidence from the read
// carrying the turn. Revisit this rule if a consumer needs evidence for a
// turn it has not loaded.
Attachment *NativeAttachmentRef `json:"attachment,omitempty"`
CustomType string `json:"customType,omitempty"`
Data json.RawMessage `json:"data"`
}
func DecodeNativeMetadataRecordsRaw ¶ added in v0.16.0
func DecodeNativeMetadataRecordsRaw(raw []byte, targets []TurnDetail) ([]NativeMetadataRecord, error)
DecodeNativeMetadataRecordsRaw preserves presence and lexical evidence before validating the same record matrix used by detail and transcript consumers.
type NativeMetadataSourceType ¶ added in v0.16.0
type NativeMetadataSourceType string
const ( NativeSourcePiCustom NativeMetadataSourceType = "pi.custom" NativeSourcePiCustomMessage NativeMetadataSourceType = "pi.custom_message" NativeSourcePiMessage NativeMetadataSourceType = "pi.message" NativeSourcePiCompaction NativeMetadataSourceType = "pi.compaction" NativeSourcePiBranchSummary NativeMetadataSourceType = "pi.branch_summary" NativeSourceClaudeCodeCompaction NativeMetadataSourceType = "claude-code.compaction" )
func NewNativeMetadataSourceType ¶ added in v0.16.0
func NewNativeMetadataSourceType(raw string) (NativeMetadataSourceType, error)
func (NativeMetadataSourceType) IsValid ¶ added in v0.16.0
func (v NativeMetadataSourceType) IsValid() bool
func (NativeMetadataSourceType) JSONSchema ¶ added in v0.16.0
func (NativeMetadataSourceType) JSONSchema() (jsonschema.Schema, error)
type NativePiMessageRole ¶ added in v0.16.0
type NativePiMessageRole string
const NativePiMessageRoleToolResult NativePiMessageRole = "toolResult"
func NewNativePiMessageRole ¶ added in v0.16.0
func NewNativePiMessageRole(raw string) (NativePiMessageRole, error)
func (NativePiMessageRole) IsValid ¶ added in v0.16.0
func (v NativePiMessageRole) IsValid() bool
func (NativePiMessageRole) JSONSchema ¶ added in v0.16.0
func (NativePiMessageRole) JSONSchema() (jsonschema.Schema, error)
type NativeSourceRef ¶ added in v0.16.0
type NativeSourceRef struct {
EntryRef SourceEntryRef `json:"entryRef"`
SourceType NativeMetadataSourceType `json:"sourceType"`
MessageRole NativePiMessageRole `json:"messageRole,omitempty"`
}
type NegativeLookalike ¶
type NegativeLookalike struct {
Name string `yaml:"name"`
Template string `yaml:"template"`
ErrContains string `yaml:"err_contains"`
}
NegativeLookalike is a first-class reject case that LOOKS valid (e.g. a URL whose last path segment is a UUID but whose path is not the canonical /transcripts/<uuid> shape). ParseTranscriptRef rejects all of these, so each asserts LIVE in the InvalidCases loop.
type ObservedModelID ¶ added in v0.1.1
type ObservedModelID ModelID
ObservedModelID is a model identifier observed on one assistant-generated turn. Producers preserve exact observations, including repeats and omissions; consumers carry observations forward only when deriving effective sticky state. Carry-forward never populates an omitted ObservedModel on the wire. Producers enforce that observations belong only to assistant or subagent output because generated shape validators cannot express that role condition.
func NewObservedModelID ¶ added in v0.1.1
func NewObservedModelID(raw string) (ObservedModelID, error)
NewObservedModelID validates and constructs an ObservedModelID. Accepted bytes are preserved exactly. Values must be valid UTF-8, non-empty, and may not have a Unicode White_Space code point at either edge. Internal whitespace and all other valid Unicode are retained without normalization or canonicalization.
func (ObservedModelID) JSONSchema ¶ added in v0.1.1
func (ObservedModelID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ObservedModelID) String ¶ added in v0.1.1
func (m ObservedModelID) String() string
String returns the exact source-observed identifier bytes.
type OffsetPage ¶ added in v0.42.0
type OffsetPage[T any] struct { Items []T `json:"items" nullable:"false"` NextItems []T `json:"nextItems" nullable:"false"` Page int `json:"page" minimum:"1" maximum:"9007199254740991"` PerPage PageSize `json:"perPage"` Total int `json:"total" minimum:"0" maximum:"9007199254740991"` Revision string `json:"revision" minLength:"1"` }
OffsetPage is the one page shape every offset reader returns. Items is the requested page; NextItems carries up to perPage rows from the next page, so a client can pre-compute the following page without a second read. Page is one-based. Revision is the store revision rendered as a decimal string, never an opaque revision name. A short or empty Items array may still continue: only an empty NextItems means the traversal is done.
func (OffsetPage[T]) Validate ¶ added in v0.42.0
func (p OffsetPage[T]) Validate() error
Validate checks the common offset-page contract and any item-owned validations. Domain readers own how the rows and the total are selected.
type OmittedReason ¶ added in v0.45.0
type OmittedReason string
OmittedReason says why an image part carries no bytes. The empty value means the image bytes are present locally. not_published means the image was deliberately omitted from a published transcript.
unsupported takes precedence over too_large: a source media type outside the recorded image/png|image/jpeg set is recorded as unsupported even when it also exceeds the size limit, because no recorded media type can describe it. too_large therefore always carries a recorded png or jpeg media type.
const ( // OmittedReasonUnsupported records a source media type this contract does // not record (for example webp or gif). It wins over too_large for the same // image, and the part carries no reference, bytes, or media type because the // unsupported spelling is outside the closed set. OmittedReasonUnsupported OmittedReason = "unsupported" // OmittedReasonTooLarge records a recorded png or jpeg image above the // accepted size limit. The part keeps its recorded media type and known // dimensions but carries no reference or bytes. OmittedReasonTooLarge OmittedReason = "too_large" // OmittedReasonMissing records a recorded image whose referenced file is // absent. The reference may still be known; the size is always zero. OmittedReasonMissing OmittedReason = "missing" // OmittedReasonNotPublished records an image the publisher deliberately // omitted. It is the only reason a published transcript may carry. OmittedReasonNotPublished OmittedReason = "not_published" )
func (OmittedReason) IsValid ¶ added in v0.45.0
func (r OmittedReason) IsValid() bool
IsValid reports whether the reason is a published omission reason.
func (OmittedReason) JSONSchema ¶ added in v0.45.0
func (OmittedReason) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (OmittedReason) String ¶ added in v0.45.0
func (r OmittedReason) String() string
type OperationIssue ¶ added in v0.31.0
type OperationIssue struct {
Code OperationIssueCode `json:"code"`
Operation CollectiveOperation `json:"operation"`
Message string `json:"message" minLength:"1" maxLength:"2048"`
Retry string `json:"retry" minLength:"1" maxLength:"2048"`
}
func (*OperationIssue) UnmarshalJSON ¶ added in v0.31.0
func (v *OperationIssue) UnmarshalJSON(data []byte) error
func (OperationIssue) Validate ¶ added in v0.31.0
func (i OperationIssue) Validate() error
type OperationIssueCode ¶ added in v0.31.0
type OperationIssueCode string
const ( OperationIssueAuth OperationIssueCode = "auth" OperationIssueRemote OperationIssueCode = "remote" OperationIssueContract OperationIssueCode = "contract" OperationIssueDeadline OperationIssueCode = "deadline" OperationIssuePersistence OperationIssueCode = "persistence" OperationIssueSuperseded OperationIssueCode = "superseded" )
func (OperationIssueCode) IsValid ¶ added in v0.31.0
func (v OperationIssueCode) IsValid() bool
func (OperationIssueCode) JSONSchema ¶ added in v0.31.0
func (OperationIssueCode) JSONSchema() (jsonschema.Schema, error)
type OutcomeDistribution ¶ added in v0.42.0
type OutcomeDistribution struct {
Resolved int `json:"resolved" minimum:"0" maximum:"9007199254740991"`
Partial int `json:"partial" minimum:"0" maximum:"9007199254740991"`
Failed int `json:"failed" minimum:"0" maximum:"9007199254740991"`
Unknown int `json:"unknown" minimum:"0" maximum:"9007199254740991"`
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
}
OutcomeDistribution is the session-outcome tally. Total counts every session, including the ones whose outcome is unknown.
type OwnerTranscriptUpdateRequest ¶
type OwnerTranscriptUpdateRequest struct {
Title *string `json:"title,omitempty" maxLength:"500" nullable:"false"`
Description *string `json:"description,omitempty" nullable:"false"`
Tags *[]string `json:"tags,omitempty" nullable:"false"`
License OwnerUpdateLicenseIntent `json:"license,omitempty"`
Visibility *TranscriptUpdateVisibility `json:"visibility,omitempty" nullable:"false"`
}
OwnerTranscriptUpdateRequest is the successor owner update request. Every field is optional; empty text and tags clear, while license null requests clear.
func DecodeOwnerTranscriptUpdateRequest ¶
func DecodeOwnerTranscriptUpdateRequest(data []byte) (OwnerTranscriptUpdateRequest, error)
func (OwnerTranscriptUpdateRequest) MarshalJSON ¶
func (request OwnerTranscriptUpdateRequest) MarshalJSON() ([]byte, error)
func (*OwnerTranscriptUpdateRequest) UnmarshalJSON ¶
func (request *OwnerTranscriptUpdateRequest) UnmarshalJSON(data []byte) error
func (OwnerTranscriptUpdateRequest) Validate ¶
func (request OwnerTranscriptUpdateRequest) Validate() error
type OwnerTranscriptUpdateResponse ¶
type OwnerTranscriptUpdateResponse struct {
TranscriptID TranscriptID `json:"transcriptId"`
TranscriptURL string `json:"transcriptUrl"`
Title *string `json:"title"`
Description *string `json:"description"`
Tags []string `json:"tags" nullable:"false"`
License *License `json:"license"`
Visibility TranscriptUpdateVisibility `json:"visibility"`
UpdatedAt int64 `json:"updatedAt"`
}
OwnerTranscriptUpdateResponse is the complete authoritative editable state.
func (*OwnerTranscriptUpdateResponse) UnmarshalJSON ¶
func (response *OwnerTranscriptUpdateResponse) UnmarshalJSON(data []byte) error
func (OwnerTranscriptUpdateResponse) Validate ¶
func (response OwnerTranscriptUpdateResponse) Validate() error
type OwnerUpdateEncodingInput ¶
type OwnerUpdateEncodingInput struct {
SetTitle bool `yaml:"set_title"`
Title string `yaml:"title"`
SetDescription bool `yaml:"set_description"`
Description string `yaml:"description"`
SetVisibility string `yaml:"set_visibility"`
SetLicense bool `yaml:"set_license"`
License string `yaml:"license"`
}
OwnerUpdateEncodingInput is a Go-side update intent expressed so the fixture can distinguish "field not set" from "field set to an empty value". Each set_* flag makes the corresponding value participate; without it the field stays nil and must not reach the wire. That separation is the whole point of the arm: it is what proves preserve, clear, and replace stay distinguishable.
func (OwnerUpdateEncodingInput) ToRequest ¶
func (in OwnerUpdateEncodingInput) ToRequest() TranscriptUpdateRequest
ToRequest builds the real TranscriptUpdateRequest a caller would construct. It returns the production type rather than a test-local mirror so the encoding arm exercises the shipped marshaling behavior.
type OwnerUpdateFixtures ¶
type OwnerUpdateFixtures struct {
// RequiredBehaviours is the closed set, declared in the corpus itself so both
// language bindings read ONE source instead of each keeping a copy. A
// hand-mirrored list in the other language protects only the members someone
// remembered to copy, while claiming both sides are guarded.
RequiredBehaviours []OwnerUpdateRequestBehaviour `yaml:"required_behaviours"`
// RequiredDescriptionAnchors is the count the anchors row must carry. The
// anchors are prose, so a closed set does not fit them; a count in the corpus
// at least makes a silent deletion from the row fail.
RequiredDescriptionAnchors int `yaml:"required_description_anchors"`
RequestValidations testcase.Corpus[string, OwnerUpdateValidationExpectation] `yaml:"request_validations"`
Encodings testcase.Corpus[OwnerUpdateEncodingInput, string] `yaml:"encodings"`
SpecExpectations testcase.Corpus[OwnerUpdateSpecProbe, OwnerUpdateSpecExpectation] `yaml:"spec_expectations"`
}
OwnerUpdateFixtures is the segmented owner-update corpus: one named arm per behavior under test. The arms are heterogeneous on purpose. Request validation works on raw client bytes, encoding works on a Go-side intent, and the spec probes work on the generated document, so a single input type would have to be a union that hides which behavior a row actually exercises.
func LoadOwnerUpdateFixtures ¶
func LoadOwnerUpdateFixtures() (*OwnerUpdateFixtures, error)
LoadOwnerUpdateFixtures parses OwnerUpdateYAML into the segmented corpus. It rejects unknown fields, trailing documents, and any case missing its classification, provenance, or mutation metadata, so a row cannot enter the corpus without recording why it exists and what it changes.
type OwnerUpdateLicenseIntent ¶
type OwnerUpdateLicenseIntent struct {
// contains filtered or unexported fields
}
OwnerUpdateLicenseIntent preserves omission separately from explicit null. Omission preserves, null requests clear, and a canonical value replaces.
func NewOwnerUpdateLicenseIntent ¶
func NewOwnerUpdateLicenseIntent(value *License) (OwnerUpdateLicenseIntent, error)
func (OwnerUpdateLicenseIntent) IsSet ¶
func (v OwnerUpdateLicenseIntent) IsSet() bool
func (OwnerUpdateLicenseIntent) JSONSchema ¶
func (OwnerUpdateLicenseIntent) JSONSchema() (jsonschema.Schema, error)
func (OwnerUpdateLicenseIntent) MarshalJSON ¶
func (v OwnerUpdateLicenseIntent) MarshalJSON() ([]byte, error)
func (*OwnerUpdateLicenseIntent) UnmarshalJSON ¶
func (v *OwnerUpdateLicenseIntent) UnmarshalJSON(data []byte) error
func (OwnerUpdateLicenseIntent) Value ¶
func (v OwnerUpdateLicenseIntent) Value() (License, bool)
type OwnerUpdateRequestBehaviour ¶
type OwnerUpdateRequestBehaviour string
OwnerUpdateRequestBehaviour is the closed set of contract behaviours the request_validations arm must cover.
It exists because a row-count floor cannot protect a corpus. A minimum with slack in it lets rows carrying a whole behaviour be deleted without any assertion noticing, and a fixture row is not code, so no mutation of the production source can reach it. Naming the behaviours and asserting coverage per member makes the corpus itself guarded input: losing every null-refusal row now fails, where losing six of twenty rows previously did not.
const ( // OwnerUpdateBehaviourVisibilityAccepted covers an accepted visibility value. OwnerUpdateBehaviourVisibilityAccepted OwnerUpdateRequestBehaviour = "visibility_accepted" // OwnerUpdateBehaviourVisibilityRefused covers a visibility outside the menu. OwnerUpdateBehaviourVisibilityRefused OwnerUpdateRequestBehaviour = "visibility_refused" // OwnerUpdateBehaviourLicenseAccepted covers a canonical menu license. OwnerUpdateBehaviourLicenseAccepted OwnerUpdateRequestBehaviour = "license_accepted" // OwnerUpdateBehaviourLicenseClearAccepted covers the clear sentinel, the // value that makes un-licensing requestable and therefore refusable. OwnerUpdateBehaviourLicenseClearAccepted OwnerUpdateRequestBehaviour = "license_clear_accepted" // OwnerUpdateBehaviourLicenseRefused covers a license off the menu. OwnerUpdateBehaviourLicenseRefused OwnerUpdateRequestBehaviour = "license_refused" // OwnerUpdateBehaviourNullRefused covers an explicit JSON null, which the // server would read as preserve rather than the clear a caller intends. OwnerUpdateBehaviourNullRefused OwnerUpdateRequestBehaviour = "null_refused" // OwnerUpdateBehaviourUnknownFieldRefused covers a field the server accepts // and silently discards. OwnerUpdateBehaviourUnknownFieldRefused OwnerUpdateRequestBehaviour = "unknown_field_refused" // OwnerUpdateBehaviourOmissionAccepted covers omission meaning unchanged. OwnerUpdateBehaviourOmissionAccepted OwnerUpdateRequestBehaviour = "omission_accepted" // OwnerUpdateBehaviourEmptyStringAccepted covers the empty string as a real // clearing value rather than an omission. OwnerUpdateBehaviourEmptyStringAccepted OwnerUpdateRequestBehaviour = "empty_string_accepted" // OwnerUpdateBehaviourTitleBoundEnforced covers the declared title bound at // its two decisive points. The bound was previously asserted only as text in // the published document, so the Go validator accepted a title the generated // JavaScript validator refused. OwnerUpdateBehaviourTitleBoundEnforced OwnerUpdateRequestBehaviour = "title_bound_enforced" )
func (OwnerUpdateRequestBehaviour) IsValid ¶
func (b OwnerUpdateRequestBehaviour) IsValid() bool
IsValid reports whether the behaviour is a known member.
type OwnerUpdateSpecExpectation ¶
type OwnerUpdateSpecExpectation struct {
Strings []string `yaml:"strings"`
}
OwnerUpdateSpecExpectation is the exact set of strings a probe must observe. It is an exact set rather than a subset so a widening (an extra enum member, an extra declared status) fails the row and has to be stated deliberately.
type OwnerUpdateSpecProbe ¶
type OwnerUpdateSpecProbe struct {
Probe OwnerUpdateSpecProbeKind `yaml:"probe"`
}
OwnerUpdateSpecProbe selects which generated-document property a row asserts.
type OwnerUpdateSpecProbeKind ¶
type OwnerUpdateSpecProbeKind string
OwnerUpdateSpecProbeKind is the closed set of generated-document properties the spec arm can assert. It is closed so a fixture cannot silently name a probe no test implements, which would let a row pass by doing nothing.
const ( // OwnerUpdateProbeOperationDeclared asserts the operation exists and carries // its declared operation id. OwnerUpdateProbeOperationDeclared OwnerUpdateSpecProbeKind = "operation_declared" // OwnerUpdateProbePathParameter asserts the transcript id is a required path // parameter. OwnerUpdateProbePathParameter OwnerUpdateSpecProbeKind = "path_parameter" // OwnerUpdateProbeBodyIsReference asserts the request body is a component // reference rather than an inline object. OwnerUpdateProbeBodyIsReference OwnerUpdateSpecProbeKind = "body_is_reference" // OwnerUpdateProbeResponseStatuses asserts the declared refusal status set. OwnerUpdateProbeResponseStatuses OwnerUpdateSpecProbeKind = "response_statuses" // OwnerUpdateProbeVisibilityEnum asserts the declared visibility members. OwnerUpdateProbeVisibilityEnum OwnerUpdateSpecProbeKind = "visibility_enum" // OwnerUpdateProbeLicenseEnum asserts the declared license members. OwnerUpdateProbeLicenseEnum OwnerUpdateSpecProbeKind = "license_enum" // OwnerUpdateProbeBodyProperties asserts the exact property set the body // declares. Without it the payload, which is the operation's whole subject, // has nothing pinning its field names. OwnerUpdateProbeBodyProperties OwnerUpdateSpecProbeKind = "body_properties" // OwnerUpdateProbePathParameterIsCanonical asserts the path parameter is the // canonical validated identifier rather than a bare string, so the contract // stops describing ids the server refuses outright. OwnerUpdateProbePathParameterIsCanonical OwnerUpdateSpecProbeKind = "path_parameter_is_canonical" // OwnerUpdateProbeTitleMaxLength asserts the declared title bound matches the // storage column, so an over-long title is refused before it becomes an // opaque server error. OwnerUpdateProbeTitleMaxLength OwnerUpdateSpecProbeKind = "title_max_length" // OwnerUpdateProbeBodyIsRequired asserts the request body is declared // required. Reflection defaults it to optional, which would describe a // request the server always refuses. OwnerUpdateProbeBodyIsRequired OwnerUpdateSpecProbeKind = "body_is_required" // OwnerUpdateProbeDescriptionAnchors asserts the operation description still // carries the claims a consumer relies on. The description is the only place // several contract decisions are explained, and prose is otherwise unguarded: // deleting it changes no assertion and breaks no build. OwnerUpdateProbeDescriptionAnchors OwnerUpdateSpecProbeKind = "description_anchors" // OwnerUpdateProbeRefusalEnvelopeProperties asserts the EXACT property set of // the refusal envelope. Asserting that a property exists cannot detect a // property that appears: an invented field on the envelope shipped with the // whole suite green, because nothing said which properties the envelope has. // This is the response-side twin of the request body's property probe. OwnerUpdateProbeRefusalEnvelopeProperties OwnerUpdateSpecProbeKind = "refusal_envelope_properties" // OwnerUpdateProbeBodyIsClosed asserts the body rejects unknown properties // rather than accepting and discarding them. OwnerUpdateProbeBodyIsClosed OwnerUpdateSpecProbeKind = "body_is_closed" // OwnerUpdateProbeSuccessHasNoBody asserts the success status is declared but // carries no content schema. It guards the deliberate omission in BOTH // directions: dropping the status, or inventing a success body the village // does not serve, each fail. OwnerUpdateProbeSuccessHasNoBody OwnerUpdateSpecProbeKind = "success_has_no_body" )
func (OwnerUpdateSpecProbeKind) IsValid ¶
func (k OwnerUpdateSpecProbeKind) IsValid() bool
IsValid reports whether the probe kind is a known member.
func (OwnerUpdateSpecProbeKind) String ¶
func (k OwnerUpdateSpecProbeKind) String() string
type OwnerUpdateValidationExpectation ¶
type OwnerUpdateValidationExpectation struct {
Accepted bool `yaml:"accepted"`
ErrorContains string `yaml:"error_contains"`
Behaviour OwnerUpdateRequestBehaviour `yaml:"behaviour"`
}
OwnerUpdateValidationExpectation is the verdict for one raw request body: whether the contract accepts it and, for a refusal, a distinctive fragment of the actionable message. ErrorContains is empty exactly when Accepted is true.
type PageSize ¶ added in v0.42.0
type PageSize int
PageSize is the closed set of page sizes a local list may request. It is a real Go enum with a numeric wire form: the members are 25, 50, and 100, and no layer carries a string spelling.
func NewPageSize ¶ added in v0.42.0
NewPageSize accepts 25, 50, or 100. Any other value, including zero and a negative number, is an error; a boundary never casts an integer into a member.
func (PageSize) IsValid ¶ added in v0.42.0
IsValid reports whether v is a member of AllPageSizes. Zero is not a member: an omitted maximum maps to 25 before NewPageSize is called.
func (PageSize) JSONSchema ¶ added in v0.42.0
func (PageSize) JSONSchema() (jsonschema.Schema, error)
JSONSchema emits the numeric enum the generated bindings consume.
type PersonalMedians ¶ added in v0.42.0
type PersonalMedians struct {
// sessions whose totalTokens is positive.
RetryShare *float64 `json:"retryShare,omitempty" yaml:"retryShare,omitempty"`
// SpecQualityScore is the median spec quality score over the sessions whose
// score is positive.
SpecQualityScore *float64 `json:"specQualityScore,omitempty" yaml:"specQualityScore,omitempty"`
// WithinSessionReverts is the median revert count over the sessions whose
// count is nonnegative.
WithinSessionReverts *float64 `json:"withinSessionReverts,omitempty" yaml:"withinSessionReverts,omitempty"`
}
PersonalMedians is the library-wide baseline the transcript scorecard compares one session against. Every field is optional: a field is absent when its sample yields no value, so the comparison line degrades instead of fabricating a baseline. The YAML tags let the canonical medians fixture carry this exact shape, so the Go aggregate and the browser baseline read one corpus.
type PositionedDirectory ¶ added in v0.54.0
type PositionedDirectory struct {
Context TranscriptReadContext `json:"context"`
Partition TranscriptSegmentPartition `json:"partition"`
History []TranscriptHistorySection `json:"history,omitempty"`
UsagePresent TranscriptUsagePresence `json:"usagePresent"`
Segments []PositionedSegmentRef `json:"segments" nullable:"false"`
DirectoryPage *int `json:"directoryPage,omitempty"`
DirectoryPerPage *int `json:"directoryPerPage,omitempty"`
}
PositionedDirectory is one partition's bounded directory page.
func (PositionedDirectory) Validate ¶ added in v0.54.0
func (d PositionedDirectory) Validate() error
Validate checks page bounds, contiguous served positions, and conversation spans.
type PositionedSegment ¶ added in v0.54.0
type PositionedSegment struct {
Context TranscriptReadContext `json:"context"`
Partition TranscriptSegmentPartition `json:"partition"`
Index int `json:"index"`
Rows []TranscriptSegmentRow `json:"rows" nullable:"false" minItems:"1"`
ByteLength int `json:"byteLength"`
HasOlder bool `json:"hasOlder"`
HasNewer bool `json:"hasNewer"`
NativeMetadata []NativeMetadataRecord `json:"nativeMetadata,omitempty"`
}
PositionedSegment is the segment transport unit. Encode it only with MarshalPositionedSegment to preserve each turn's served bytes.
func (PositionedSegment) MarshalJSON ¶ added in v0.54.0
func (PositionedSegment) MarshalJSON() ([]byte, error)
func (PositionedSegment) Validate ¶ added in v0.54.0
func (s PositionedSegment) Validate() error
Validate checks the segment's own facts and the contiguous served rows.
type PositionedSegmentRef ¶ added in v0.54.0
type PositionedSegmentRef struct {
Index int `json:"index"`
SourceFirstPosition int `json:"sourceFirstPosition" minimum:"0"`
SourceLastPosition int `json:"sourceLastPosition" minimum:"0"`
FirstTurn *int `json:"firstTurn,omitempty" minimum:"0" nullable:"false"`
LastTurn *int `json:"lastTurn,omitempty" minimum:"0" nullable:"false"`
ByteLength int `json:"byteLength"`
ConversationTurns *ConversationTurnSpan `json:"conversationTurns,omitempty"`
}
PositionedSegmentRef bounds one segment in the partition's served order. FirstTurn and LastTurn are recorded-index facts and are both present or absent.
func (PositionedSegmentRef) Validate ¶ added in v0.54.0
func (r PositionedSegmentRef) Validate() error
type PositionedWindow ¶ added in v0.54.0
type PositionedWindow struct {
Context TranscriptReadContext `json:"context"`
Partition TranscriptSegmentPartition `json:"partition"`
RequestedAnchor *int `json:"requestedAnchor,omitempty" minimum:"0" nullable:"false"`
AnchorTurn *int `json:"anchorTurn,omitempty" minimum:"0" nullable:"false"`
RequestedPosition *int `json:"requestedPosition,omitempty" minimum:"0" nullable:"false"`
AnchorPosition int `json:"anchorPosition"`
AnchorSegment int `json:"anchorSegment"`
Span int `json:"span" minimum:"1" maximum:"10"`
FirstPosition int `json:"firstPosition"`
LastPosition int `json:"lastPosition"`
Segments []int `json:"segments" nullable:"false" minItems:"1"`
HasOlder bool `json:"hasOlder"`
HasNewer bool `json:"hasNewer"`
}
PositionedWindow describes a contiguous segment run without turn content.
func ResolvePositionedWindow ¶ added in v0.54.0
func ResolvePositionedWindow(in PositionedWindowInput) (PositionedWindow, error)
ResolvePositionedWindow resolves one partition's window in served order. Recorded indexes are comparison keys only; positions and ordinals locate the resulting run. The resolver never reads turn content.
func (PositionedWindow) Validate ¶ added in v0.54.0
func (w PositionedWindow) Validate() error
Validate checks the window's own coordinates and edge flags.
type PositionedWindowInput ¶ added in v0.54.0
type PositionedWindowInput struct {
Context TranscriptReadContext
Partition TranscriptSegmentPartition
RequestedAnchor *int
Span int
Turns []PositionedWindowTurn
Refs []PositionedSegmentRef
}
PositionedWindowInput supplies one partition's served rows and a contiguous ascending interval of absolute segment ordinals. A server may supply its whole directory or adjacent pages concatenated in ordinal order.
type PositionedWindowTurn ¶ added in v0.54.0
PositionedWindowTurn is the identity and role of one served row. A nil recorded index means the row has no comparable recorded identity.
type ProjectAnalytics ¶ added in v0.42.0
type ProjectAnalytics struct {
TotalSessions int `json:"totalSessions" minimum:"0" maximum:"9007199254740991"`
TotalContributors int `json:"totalContributors" minimum:"0" maximum:"9007199254740991"`
TotalProjects int `json:"totalProjects" minimum:"0" maximum:"9007199254740991"`
SessionsPerWeek []WeekCount `json:"sessionsPerWeek" nullable:"false"`
WeeklyActiveContributors []WeekContributors `json:"weeklyActiveContributors" nullable:"false"`
ReturningContributorRate ReturningContributorRate `json:"returningContributorRate"`
LongestStreak LongestStreak `json:"longestStreak"`
NewContributorVelocity []WeekNewContributors `json:"newContributorVelocity" nullable:"false"`
SessionToCommitRate SessionToCommitRate `json:"sessionToCommitRate"`
AvgDurationPerActiveWeek []WeekAvgDuration `json:"avgDurationPerActiveWeek" nullable:"false"`
OutcomeDistribution OutcomeDistribution `json:"outcomeDistribution"`
SessionStats AnalyticsSessionStats `json:"sessionStats"`
PerContributorBreakdown []ContributorBreakdown `json:"perContributorBreakdown" nullable:"false"`
}
ProjectAnalytics is the analytics bundle the project dashboard renders. It is a schema type, not a presentation typedef: the server aggregate, the generated TypeScript type, and the dashboard typedef are one contract with these exact field names.
func (ProjectAnalytics) Validate ¶ added in v0.42.0
func (a ProjectAnalytics) Validate() error
Validate checks the aggregate's rates and counts. The Types schema bounds the same fields; this is the Go boundary for a producer that constructs the bundle directly, so a negative count or an out-of-range rate never reaches a client.
type ProjectContext ¶
type ProjectContext struct {
Hash ProjectHash `json:"hash"` // SHA-256 of project origin URL or path
FilePath string `json:"filePath,omitempty"` // Local repo path
Name string `json:"name"` // Repo basename
}
ProjectContext identifies the project associated with a session.
type ProjectHash ¶
type ProjectHash string
ProjectHash is a SHA-256 hex digest of the project's origin URL or local path.
func NewProjectHash ¶
func NewProjectHash(raw string) (ProjectHash, error)
NewProjectHash validates and constructs a ProjectHash.
func (ProjectHash) JSONSchema ¶
func (ProjectHash) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ProjectHash) String ¶
func (p ProjectHash) String() string
func (ProjectHash) Validate ¶
func (p ProjectHash) Validate() error
Validate reports whether p is the canonical 64-character lowercase hex project identity accepted at wire boundaries.
type ProjectResolutionPayload ¶
type ProjectResolutionPayload struct {
Project string `json:"project" required:"true"`
ProjectHash ProjectHash `json:"projectHash" required:"true"`
}
ProjectResolutionPayload resolves one explicitly requested project display identity to its opaque hash without enumerating sibling projects. It exists for stable deep links that name one stored project without listing the others; the saved ingestion selection never narrows it.
type ProjectSummariesPayload ¶
type ProjectSummariesPayload struct {
Projects []ProjectSummary `json:"projects"`
}
ProjectSummariesPayload backs the home project picker, served by GET /api/v1/projects/summary.
func NewProjectSummariesPayload ¶
func NewProjectSummariesPayload() *ProjectSummariesPayload
NewProjectSummariesPayload returns a ProjectSummariesPayload with all slices initialized to empty (never-nil marshal guarantee).
type ProjectSummary ¶
type ProjectSummary struct {
ProjectHash ProjectHash `json:"projectHash"`
Project string `json:"project"` // display name (canonical cwd, else the hash)
Sessions int `json:"sessions"` // recorded session count
RecordedFiles int `json:"recordedFiles"` // coverage numerator (same rule as MapNode)
TotalFiles int `json:"totalFiles"` // coverage denominator
LastWorkMs *int64 `json:"lastWorkMs,omitempty"`
OpenChanges int `json:"openChanges"` // local non-default branches not merged (0 when no repo)
}
ProjectSummary is one row of the home picker: a project with its recorded stats (sessions · recorded coverage · last work · open changes).
type ProjectTasksPayload ¶
type ProjectTasksPayload struct {
ProjectHash ProjectHash `json:"projectHash"`
Tasks []TaskSummary `json:"tasks"` // reverse-chronological, cap 500
FileFilter string `json:"fileFilter,omitempty"`
}
ProjectTasksPayload backs the Tasks lens, served by GET /api/v1/map/{projectHash}/tasks?file=<path>.
func NewProjectTasksPayload ¶
func NewProjectTasksPayload(projectHash ProjectHash) *ProjectTasksPayload
NewProjectTasksPayload returns a ProjectTasksPayload with all slices initialized to empty (never-nil marshal guarantee).
type PromptDigest ¶ added in v0.17.0
type PromptDigest struct {
Header PromptDigestHeader `json:"header"`
Skills []PromptDigestSkill `json:"skills" nullable:"false"`
Items []PromptDigestItem `json:"items" nullable:"false"`
}
PromptDigest is the reviewer-facing projection of the prompts behind a pull request. It is always the complete chain across every attached transcript; the comment and check-run budgets described in the design are applied by the renderer, never by dropping items from this type.
func (PromptDigest) Validate ¶ added in v0.17.0
func (d PromptDigest) Validate() error
Validate checks every item, the chronological order of the chain, the header skills, and that the header counts describe the complete chain.
type PromptDigestHeader ¶ added in v0.17.0
type PromptDigestHeader struct {
SessionCount int `json:"sessionCount"`
PromptCount int `json:"promptCount"`
CommitsCovered int `json:"commitsCovered"`
CommitsTotal int `json:"commitsTotal"`
Harness Harness `json:"harness"`
RedactionLevel string `json:"redactionLevel"`
VillageURL string `json:"villageUrl"`
}
PromptDigestHeader summarises the complete chain. Counts describe the whole digest, never a rendered tier.
type PromptDigestItem ¶ added in v0.17.0
type PromptDigestItem struct {
Kind DigestItemKind `json:"kind"`
TranscriptID TranscriptID `json:"transcriptId"`
Timestamp time.Time `json:"timestamp"`
Text string `json:"text"`
// TurnIndex deep-links a prompt or skill marker into the transcript viewer.
TurnIndex *int `json:"turnIndex,omitempty"`
// Ordinal is the 1-based prompt number a reviewer sees. Prompts only.
Ordinal *int `json:"ordinal,omitempty"`
// CommitSHA is the full or abbreviated SHA of a commit anchor. Commits only.
CommitSHA string `json:"commitSha,omitempty"`
// PromptCount and CommitCount summarise a session boundary. Sessions only.
PromptCount *int `json:"promptCount,omitempty"`
CommitCount *int `json:"commitCount,omitempty"`
// Additions, Deletions, and FilesChanged are the lines added, the lines
// deleted, and the number of files a commit touched, as the hosting
// provider reports them. Commits only, and all three together or not at
// all; they are absent when the counts were not read.
Additions *int `json:"additions,omitempty"`
Deletions *int `json:"deletions,omitempty"`
FilesChanged *int `json:"filesChanged,omitempty"`
// Args is the text that followed a skill or user command invocation on the
// same line, as the producer recorded it (for example "add retries" in
// "/plan add retries"). Skill items only and optional; it is absent when the
// invocation carried no argument.
Args string `json:"args,omitempty"`
}
PromptDigestItem is one entry in the chronological chain. Which optional fields are set depends on Kind; Validate states the rule for each kind.
func (PromptDigestItem) Validate ¶ added in v0.17.0
func (i PromptDigestItem) Validate() error
Validate enforces the per-kind field rules.
type PromptDigestSkill ¶ added in v0.17.0
type PromptDigestSkill struct {
Name string `json:"name"`
InvocationCount int `json:"invocationCount"`
}
PromptDigestSkill is one distinct skill or user slash command across every attached session, with how many times it was invoked. Name is a slash-prefixed skill or user command as recorded by the harness, or a bare plugin identifier for a tool provider observed through tool calls. Renderers distinguish the two by the leading slash.
type Provenance ¶
type Provenance struct {
Method string `json:"method"` // "heuristic", "regex", "llm_judge", "manual"
Function string `json:"function,omitempty"`
Version string `json:"version,omitempty"`
Details map[string]string `json:"details,omitempty"`
}
Provenance records how a non-human annotator derived its annotation value. Only populated for rule-based and agent annotators; nil for human annotations.
type PublicRevisionRef ¶ added in v0.19.0
type PublicRevisionRef string
func NewPublicRevisionRef ¶ added in v0.19.0
func NewPublicRevisionRef(raw string) (PublicRevisionRef, error)
func (PublicRevisionRef) JSONSchema ¶ added in v0.19.0
func (PublicRevisionRef) JSONSchema() (jsonschema.Schema, error)
func (PublicRevisionRef) Validate ¶ added in v0.19.0
func (v PublicRevisionRef) Validate() error
type PublicSourceAnchor ¶ added in v0.19.0
type PublicSourceAnchor struct {
Kind PublicSourceAnchorKind `json:"kind" yaml:"kind"`
SourceEntryRef SourceEntryRef `json:"sourceEntryRef,omitempty" yaml:"sourceEntryRef"`
SourceRevisionRef PublicRevisionRef `json:"sourceRevisionRef,omitempty" yaml:"sourceRevisionRef"`
}
func (PublicSourceAnchor) Validate ¶ added in v0.19.0
func (a PublicSourceAnchor) Validate() error
type PublicSourceAnchorKind ¶ added in v0.19.0
type PublicSourceAnchorKind string
const ( PublicSourceAnchorGeneral PublicSourceAnchorKind = "general_source_session" PublicSourceAnchorBefore PublicSourceAnchorKind = "before_redacted_entry" PublicSourceAnchorThrough PublicSourceAnchorKind = "through_redacted_entry" )
func NewPublicSourceAnchorKind ¶ added in v0.19.0
func NewPublicSourceAnchorKind(raw string) (PublicSourceAnchorKind, error)
func (PublicSourceAnchorKind) IsValid ¶ added in v0.19.0
func (v PublicSourceAnchorKind) IsValid() bool
func (PublicSourceAnchorKind) JSONSchema ¶ added in v0.19.0
func (PublicSourceAnchorKind) JSONSchema() (jsonschema.Schema, error)
type PublishAppliedState ¶
type PublishAppliedState struct {
License *License `json:"license"`
Associations []PublishedAssociation `json:"associations" nullable:"false"`
NormalizedValues PublishNormalizedValues `json:"normalizedValues"`
}
func (*PublishAppliedState) UnmarshalJSON ¶
func (value *PublishAppliedState) UnmarshalJSON(data []byte) error
func (PublishAppliedState) Validate ¶
func (state PublishAppliedState) Validate() error
type PublishAssociationOperation ¶
type PublishAssociationOperation struct {
Kind PublishOperationKind `json:"kind"`
Associations []PublishedAssociation `json:"associations" nullable:"false"`
}
type PublishLicenseOperation ¶
type PublishLicenseOperation struct {
Kind PublishOperationKind `json:"kind"`
License *License `json:"license"`
}
type PublishNormalizedValues ¶
type PublishNormalizedValues struct {
RootHarness Harness `json:"rootHarness"`
EntryHarnesses []Harness `json:"entryHarnesses" nullable:"false"`
DerivedTitle *string `json:"derivedTitle"`
Visibility Visibility `json:"visibility"`
SchemaVersion string `json:"schemaVersion"`
}
PublishNormalizedValues is the complete set of values Village normalizes.
func (*PublishNormalizedValues) UnmarshalJSON ¶
func (value *PublishNormalizedValues) UnmarshalJSON(data []byte) error
type PublishOperationKind ¶
type PublishOperationKind string
const ( PublishOperationPreserve PublishOperationKind = "preserve" PublishOperationReplace PublishOperationKind = "replace" PublishOperationAppend PublishOperationKind = "append" )
func (PublishOperationKind) IsValid ¶
func (v PublishOperationKind) IsValid() bool
func (PublishOperationKind) JSONSchema ¶
func (v PublishOperationKind) JSONSchema() (jsonschema.Schema, error)
type PublishRequest ¶
type PublishRequest struct {
Identity SessionIdentity `json:"identity"`
Model ModelInfo `json:"model" required:"true"`
Timestamp TimestampInfo `json:"timestamp"`
Source SourceInfo `json:"source"`
Git GitContext `json:"git"`
Project ProjectContext `json:"project"`
Stats SessionStats `json:"stats"`
Quality *QualityMetrics `json:"quality,omitempty"`
Entries []SessionEntry `json:"entries,omitempty"`
Subagents []SubagentRef `json:"subagents,omitempty"`
Diagnostics DiagnosticsInfo `json:"diagnostics"`
// License is the content license the contributor selected for this transcript
// (CC0-1.0 / CC-BY-4.0 / CC-BY-SA-4.0). Optional — omitempty ⇒ a publish with no
// license stores NULL (legacy/un-set). The village persists it to
// transcripts.license_id; the vendored schema enum makes an invalid value a
// documented schema-422. NOT `required` (keeps the Village publish body required set at [model]).
License License `json:"license,omitempty"`
}
PublishRequest is the frozen rc11/Village 0.10.0 metadata shape retained for compatibility. Village 0.12.0 publishing uses AuthoritativePublishRequest.
Uses nested composites for logical grouping. The JSON tags on each composite struct preserve CLI wire compatibility — the top-level keys are identity, model, timestamp, source, git, project, stats, quality, subagents, and diagnostics.
MIGRATION NOTE: The CLI's current flat UnifiedMetadata will need a coordinated update to send this nested structure. This is NOT backward-compatible with the current village handler — both CLI and village must update together.
The Village operation-specific publish component requires model, so a body without it is rejected; this changes generated validation requiredness, not the canonical Go wire shape.
func (PublishRequest) Validate ¶
func (r PublishRequest) Validate() error
Validate checks the request-local associations carried in the publish wire. Other publish-body validation remains the responsibility of the generated PublishRequest JSON Schema at the HTTP boundary.
type PublishRequestFingerprint ¶
type PublishRequestFingerprint string
PublishRequestFingerprint identifies one canonical accepted publish operation.
func FingerprintPublishOperation ¶
func FingerprintPublishOperation(operation CanonicalPublishOperation) (PublishRequestFingerprint, error)
func NewPublishRequestFingerprint ¶
func NewPublishRequestFingerprint(raw string) (PublishRequestFingerprint, error)
func (PublishRequestFingerprint) JSONSchema ¶
func (PublishRequestFingerprint) JSONSchema() (jsonschema.Schema, error)
func (PublishRequestFingerprint) String ¶
func (v PublishRequestFingerprint) String() string
func (PublishRequestFingerprint) Validate ¶
func (v PublishRequestFingerprint) Validate() error
type PublishResponse ¶
type PublishResponse struct {
TranscriptID string `json:"transcriptId"`
BlobKey string `json:"blobKey"`
BlobSizeBytes int64 `json:"blobSizeBytes"`
PublishedAt int64 `json:"publishedAt"`
UpdatedAt int64 `json:"updatedAt"`
Created bool `json:"created"`
}
PublishResponse is the released rc11 response retained for source and frozen artifact compatibility. Village API 0.12.0 uses AuthoritativePublishResponse.
type PublishVerdictCase ¶
type PublishVerdictCase struct {
Name string `yaml:"name"`
Body string `yaml:"body"`
Expect PublishVerdictExpectation `yaml:"expect"`
}
PublishVerdictCase is one concrete publish body and its schema/HTTP verdict.
func (PublishVerdictCase) ModelHarness ¶
func (c PublishVerdictCase) ModelHarness() (string, bool, error)
ModelHarness returns body.model.harness when the case body contains one.
type PublishVerdictExpectation ¶
type PublishVerdictExpectation struct {
SchemaAccepts bool `yaml:"schema_accepts"`
LegacyAccepts *bool `yaml:"legacy_accepts,omitempty"`
HTTPStatus int `yaml:"http_status,omitempty"`
ErrorCategory string `yaml:"error_category,omitempty"`
ErrorContains string `yaml:"error_contains,omitempty"`
}
PublishVerdictExpectation attaches expected outcomes to a publish verdict row.
type PublishVerdictFixtures ¶
type PublishVerdictFixtures struct {
Cases []PublishVerdictCase `yaml:"cases"`
}
PublishVerdictFixtures is the parsed testdata/publish/verdicts.yaml corpus.
func LoadPublishVerdictFixtures ¶
func LoadPublishVerdictFixtures() (*PublishVerdictFixtures, error)
LoadPublishVerdictFixtures parses PublishVerdictsYAML into structured fixtures.
func (*PublishVerdictFixtures) Acceptances ¶
func (f *PublishVerdictFixtures) Acceptances() []PublishVerdictCase
Acceptances returns the corpus rows the schema MUST accept (schema_accepts:true). It is the accept-pass input to RunPublishVerdicts; together with Rejections it partitions Cases exactly (the partition-completeness guard in RunPublishVerdicts depends on len(Acceptances)+len(Rejections)==len(Cases)).
func (*PublishVerdictFixtures) CaseByName ¶
func (f *PublishVerdictFixtures) CaseByName(name string) (PublishVerdictCase, bool)
CaseByName returns the verdict row with the given stable name.
func (*PublishVerdictFixtures) Rejections ¶
func (f *PublishVerdictFixtures) Rejections() []PublishVerdictCase
Rejections returns the corpus rows the schema MUST reject (schema_accepts:false). It is the reject-pass input to RunPublishVerdicts (see Acceptances).
type PublishedAssociation ¶
type PublishedAssociation struct {
ID AssociationID `json:"id" yaml:"id"`
ObservedCommitHash string `json:"observedCommitHash" yaml:"observedCommitHash"`
}
PublishedAssociation is the producer-owned durable identity for one observed session-to-commit relationship published with a transcript. Its ID is opaque to consumers. The enclosing PublishRequest.Identity.SessionID supplies the session identity, so it is deliberately not repeated here.
Within a publish request, both ID and ObservedCommitHash must be unique. Consumers retain one durable ID for each owner, transcript, and observed commit hash: an exact replay is idempotent, while a changed binding or a second ID for the same relationship must be rejected rather than aliased.
func (PublishedAssociation) Validate ¶
func (a PublishedAssociation) Validate() error
Validate checks that a published association can be addressed durably by a consumer. ObservedCommitHash remains producer data rather than a re-parsed Git object, but it must be present so it can participate in canonical owner/transcript/observed-hash identity.
type PullAnnotation ¶
type PullAnnotation struct {
AnnotationSummary // embedded existing summary (annotator entity, content hash, etc.)
Author VillagePublicOwner `json:"author"`
}
PullAnnotation is the authored-annotation row for the pull surface (GET /api/v1/pull/transcripts/{id}/annotations). It embeds the existing AnnotationSummary and adds the author as the caller may see them, resolved by the server per viewer. The caller's own rows always carry the caller's profile, so Author.IsAccount(callerID) identifies them for the annotation-refresh exclusion; an anonymous author is never the caller and is marked foreign. Pull contract 0.3.0 replaced the authorUserId and authorUsername strings with Author.
The embedded summary's targetProjectHash and targetFilePath identify the owner's repository, so Village leaves both absent when the annotated transcript's owner is anonymous to the caller. AnnotationSummary keeps its Local API meaning; the rule applies to this Village envelope only. The annotations response carries no owner, so no validator here can pair the two; Village enforces and tests it on the server.
type PullAssociationMetadataResult ¶ added in v0.31.0
type PullAssociationMetadataResult struct {
State PullAssociationMetadataState `json:"state"`
ObservedAt *time.Time `json:"observedAt,omitempty"`
Warning *OperationIssue `json:"warning,omitempty"`
}
func (*PullAssociationMetadataResult) UnmarshalJSON ¶ added in v0.31.0
func (v *PullAssociationMetadataResult) UnmarshalJSON(data []byte) error
func (PullAssociationMetadataResult) Validate ¶ added in v0.31.0
func (r PullAssociationMetadataResult) Validate() error
type PullAssociationMetadataState ¶ added in v0.31.0
type PullAssociationMetadataState string
const ( PullAssociationMetadataObserved PullAssociationMetadataState = "observed" PullAssociationMetadataStale PullAssociationMetadataState = "stale" PullAssociationMetadataUnknown PullAssociationMetadataState = "unknown" PullAssociationMetadataInvalidated PullAssociationMetadataState = "invalidated" )
func (PullAssociationMetadataState) IsValid ¶ added in v0.31.0
func (v PullAssociationMetadataState) IsValid() bool
func (PullAssociationMetadataState) JSONSchema ¶ added in v0.31.0
func (PullAssociationMetadataState) JSONSchema() (jsonschema.Schema, error)
type PullListResponse ¶
type PullListResponse struct {
Transcripts []PullTranscriptInfo `json:"transcripts"`
Page int `json:"page"`
Limit int `json:"limit"`
Total int `json:"total"`
}
PullListResponse is the village's paginated listing of pullable transcripts (GET /api/v1/pull/transcripts) — own + group-shared (public excluded by the canPullTranscript policy).
func (PullListResponse) Validate ¶ added in v0.33.0
func (r PullListResponse) Validate() error
Validate checks every listed transcript.
type PullRefFixtures ¶
type PullRefFixtures struct {
Values PullRefValues `yaml:"values"`
IDCasings []IDCasing `yaml:"id_casings"`
RefForms []RefForm `yaml:"ref_forms"`
ValidGeneration ValidGeneration `yaml:"valid_generation"`
InvalidRefs []InvalidRefCategory `yaml:"invalid_refs"`
NegativeLookalike []NegativeLookalike `yaml:"negative_lookalikes"`
}
PullRefFixtures is the top-level parsed transcript_refs.yaml structure.
func LoadPullRefFixtures ¶
func LoadPullRefFixtures() (*PullRefFixtures, error)
LoadPullRefFixtures parses PullRefsYAML into structured fixtures. Mirrors LoadAnnotationFixtures.
func (*PullRefFixtures) AllCases ¶
func (f *PullRefFixtures) AllCases() ([]RefCase, error)
AllCases is ValidCases followed by InvalidCases — the full materialised suite internal/pull/types_test.go ranges over.
func (*PullRefFixtures) InvalidCases ¶
func (f *PullRefFixtures) InvalidCases() ([]RefCase, error)
InvalidCases materialises the explicit invalid_refs plus the negative_lookalikes. Every case expects an error with the category/case-attached substring.
func (*PullRefFixtures) UUIDLower ¶
func (f *PullRefFixtures) UUIDLower() string
UUIDLower returns the canonical lowercase UUID the fixture owns (== testutil TestTranscriptUUID).
func (*PullRefFixtures) ValidCases ¶
func (f *PullRefFixtures) ValidCases() ([]RefCase, error)
ValidCases materialises the valid cross-product (id_casings x ref_forms) with the generator-attached expectation: every case parses, normalizes its ID to values.uuid_lower, and reports FromURL per its ref_form.
func (*PullRefFixtures) VillageHost ¶
func (f *PullRefFixtures) VillageHost() string
VillageHost returns the canonical village host the fixture owns (== testutil TestVillageHost).
type PullRefValues ¶
type PullRefValues struct {
UUIDLower string `yaml:"uuid_lower"`
VillageHost string `yaml:"village_host"`
}
PullRefValues are the self-contained canonical strings the fixture owns. They are ADOPTED VERBATIM from internal/testutil (which re-exports them), so the fixture is the single source of truth with zero behaviour change.
type PullSkipGateItem ¶
type PullSkipGateItem struct {
// The id of a transcript the client holds and is asking about.
TranscriptID TranscriptID `json:"transcriptId" description:"The id of a transcript the client holds and is asking about."`
// Hex-encoded SHA3-256 content-hash the client currently holds for this
// transcript's served blob; compared by VALUE against the server's stored hash
// to decide contentCurrent.
ContentHash string `` /* 178-byte string literal not displayed */
// The client's OWN annotation content-hashes for this transcript (the set it
// already has locally). Compared as a SET against the owner-scoped server set to
// decide annotationsCurrent. NewPullSkipGateRequest sorts + de-duplicates it, so it
// is always a (possibly empty) NON-null array.
AnnotationHashes []string `` /* 197-byte string literal not displayed */
}
PullSkipGateItem is one transcript the client holds and wants a currency answer for: the transcript id, the content-hash the client currently has for it, and the set of annotation content-hashes the client itself holds for that transcript.
type PullSkipGateRequest ¶
type PullSkipGateRequest struct {
// The per-transcript items the client is asking a currency question about.
// NewPullSkipGateRequest orders them by transcriptId and never returns nil, so the
// wire is a canonical, (possibly empty) NON-null array.
Items []PullSkipGateItem `` /* 181-byte string literal not displayed */
}
PullSkipGateRequest is the body a pulling client POSTs to the pull skip-gate endpoint. For each transcript it already holds, the client sends the id plus the content-hash it holds and its OWN annotation-hash set for that id, so the server can answer, per id, whether the stored transcript and the client's annotations are still current, letting the client skip re-downloading what has not diverged. Only the client's held HASHES travel, never content, so the request is privacy-safe.
This type is ADDITIVE: it introduces a new endpoint's request shape and does not alter any existing pull/publish/annotation-push wire contract.
func NewPullSkipGateRequest ¶
func NewPullSkipGateRequest(items []PullSkipGateItem) PullSkipGateRequest
NewPullSkipGateRequest builds a CANONICAL skip-gate request: each item's annotation-hash set is sorted + de-duplicated (the server compares it as a SET, so order and multiplicity are irrelevant), and the items are ordered by transcriptId. Provided the request's transcript ids are UNIQUE, two clients asking about the same logical state emit byte-identical requests: the items are ordered with an unstable sort on transcriptId, so byte-identity holds only when that key has no ties (one item per transcript id, which a well-formed request satisfies). Every item's AnnotationHashes is a non-null array.
type PullSkipGateResponse ¶
type PullSkipGateResponse struct {
// The per-id currency answers, present ONLY for pullable ids (non-pullable ids
// are omitted; see the type doc). NewPullSkipGateResponse orders them by
// transcriptId and never returns nil, so the wire is a canonical, (possibly
// empty) NON-null array.
Results []PullSkipGateResult `` /* 170-byte string literal not displayed */
}
PullSkipGateResponse is the per-id currency answer for a PullSkipGateRequest.
LEAK-FREE WITHHELD SEMANTICS: Results carries an entry ONLY for transcript ids the caller may PULL. A non-pullable id is OMITTED from Results entirely, never echoed with a "denied" or "unknown" marker, because any per-id echo would itself be an existence / currency oracle over arbitrary ids the caller cannot pull. So the caller sends N ids and receives <= N results; an ABSENT id means "unanswered / withheld", the 404-not-403 anti-enumeration spirit applied to a batch currency probe.
This is enforced in two distinct places. The RESPONSE SHAPE carries no denial or marker field a withheld id could ride on: it is exactly {results: [{transcriptId, contentCurrent, annotationsCurrent}]}, checked by this module's exact-key-set response test, so adding and populating a wire-visible extra field reddens the assertion. An inert zero-valued `omitempty` field is not emitted and is outside this check. The actual OMISSION of non-pullable ids from Results is the village handler's pull-scoping test, since only the server knows which ids are pullable; this constructor merely canonicalizes the entries it is given and never invents one.
This type is ADDITIVE: it introduces a new endpoint's response shape and does not alter any existing pull/publish/annotation-push wire contract.
func NewPullSkipGateResponse ¶
func NewPullSkipGateResponse(results []PullSkipGateResult) PullSkipGateResponse
NewPullSkipGateResponse builds a CANONICAL skip-gate response from the per-id answers the server computed for the PULLABLE ids ONLY. Non-pullable ids must already be omitted by the caller (see PullSkipGateResponse's leak-free contract); this constructor does not invent entries. Results are ordered by transcriptId so the wire payload is deterministic, PROVIDED the response's transcript ids are UNIQUE: the results are ordered with an unstable sort on transcriptId, so determinism holds only when that key has no ties (one result per pullable id, which the pull-scope answer satisfies). The slice is never nil.
type PullSkipGateResult ¶
type PullSkipGateResult struct {
// The transcript id this answer is for (always one the caller may pull).
TranscriptID TranscriptID `json:"transcriptId" description:"The transcript id this currency answer is for (always one the caller may pull)."`
// True when the server's stored served-blob content-hash equals the hash the
// client sent for this id; false when it has diverged (or the server holds none).
ContentCurrent bool `` /* 174-byte string literal not displayed */
// True when the owner-scoped annotation set the server holds for this id equals
// the client's held annotation set; false when it differs (missing or extra).
AnnotationsCurrent bool `` /* 172-byte string literal not displayed */
}
PullSkipGateResult is the currency answer for one PULLABLE transcript id: whether the stored blob still matches the client's held content-hash, and whether the owner-scoped annotation set still matches the client's held annotation set.
type PullStatusFixtures ¶
type PullStatusFixtures struct {
Statuses []PullStatusMapping `yaml:"statuses"`
}
PullStatusFixtures is the parsed pull_statuses.yaml structure.
func LoadPullStatusFixtures ¶
func LoadPullStatusFixtures() (*PullStatusFixtures, error)
LoadPullStatusFixtures parses PullStatusesYAML into structured fixtures.
type PullStatusMapping ¶
type PullStatusMapping struct {
Name string `yaml:"name"`
ConstName string `yaml:"const_name"`
Wire string `yaml:"wire"`
}
PullStatusMapping is one PullStatus<->wire row.
type PullTranscriptInfo ¶
type PullTranscriptInfo struct {
TranscriptID TranscriptID `json:"transcriptId"`
LocalID string `json:"localId,omitempty"` // peasant SessionID at publish — round-trip correlation
Owner VillagePublicOwner `json:"owner"`
Title string `json:"title,omitempty"`
Harness Harness `json:"harness,omitempty"` // existing typed form
// ProjectName identifies the owner's repository, so it is omitted when
// Owner is anonymous to the caller, as well as when it was not recorded. It
// is a pointer so an explicit empty string is distinguishable from an
// omitted field: withheld means absent, and an empty string beside an
// anonymous owner is refused like any other value.
ProjectName *string `json:"projectName,omitempty"`
Visibility Visibility `json:"visibility"` // existing typed form
License License `json:"license,omitempty"` // legal axis; omitempty ⇒ legacy/un-set
ContentHash string `json:"contentHash,omitempty"` // SERVED-BLOB hash; empty ⇒ server has none
ContractVersion ContractVersion `json:"contractVersion,omitempty"` // push contract the blob was published under
PublishedAt int64 `json:"publishedAt"`
UpdatedAt int64 `json:"updatedAt"`
AnnotationCount int `json:"annotationCount"`
}
PullTranscriptInfo is the village's metadata view of a single pullable transcript (GET /api/v1/pull/transcripts/{id}). ContentHash is the SERVER-COMPUTED hash of the served blob bytes (empty when the village has not yet computed one), and is distinct from UnifiedMetadata.ContentHash (the ingest-time, pre-push-redaction hash). ContractVersion records the push content contract the blob was published under (the blob carries its own publish-time version; the pull envelope does not version the blob).
Owner is the transcript's owner as the caller may see them, resolved by the server per viewer. A caller pulling its own transcript always receives its own profile, so Owner.IsAccount(callerID) is exactly "this is mine"; an anonymous owner is never the caller. This envelope shape is pull contract 0.3.0, which replaced the ownerUserId and ownerUsername strings.
func (PullTranscriptInfo) Validate ¶ added in v0.33.0
func (p PullTranscriptInfo) Validate() error
Validate checks the owner and that an anonymous owner's project name is omitted.
type PushContractVersion ¶
type PushContractVersion = ContractVersion
PushContractVersion is a zero-churn alias for ContractVersion kept for the push axis. Existing references (SchemaVersionResponse push fields, the defaults push constants) keep compiling unchanged; new code may use either name (they are the identical type).
type QualityFixtureName ¶
type QualityFixtureName string
const ( QualityFixtureResolvedTypical QualityFixtureName = "resolved_typical" QualityFixtureResolvedHighTokens QualityFixtureName = "resolved_high_tokens" QualityFixturePartialMedium QualityFixtureName = "partial_medium" QualityFixtureFailedComplex QualityFixtureName = "failed_complex" QualityFixtureResolvedMinimal QualityFixtureName = "resolved_minimal" )
type QualityFixtureSet ¶
type QualityFixtureSet struct {
Name QualityFixtureSetName `json:"name" yaml:"name"`
Cases []QualityFixtureName `json:"cases" yaml:"cases"`
}
QualityFixtureSet is a named reusable list of quality-session fixture rows.
type QualityFixtureSetName ¶
type QualityFixtureSetName string
const (
QualityFixtureSetProjectMix QualityFixtureSetName = "project_mix"
)
type QualityFixtures ¶
type QualityFixtures struct {
Sessions []QualitySessionFixture `json:"sessions" yaml:"quality_sessions"`
Sets []QualityFixtureSet `json:"sets" yaml:"quality_fixture_sets"`
Variations QualityVariations `json:"variations" yaml:"quality_variations"`
RequiredMedianNames []string `json:"requiredMedianNames" yaml:"required_median_names"`
Medians []QualityMedianCase `json:"medians" yaml:"medians"`
}
QualityFixtures is the parsed testdata/quality/sessions.yaml corpus.
func LoadQualityFixtures ¶
func LoadQualityFixtures() (*QualityFixtures, error)
LoadQualityFixtures parses QualitySessionsYAML into structured fixtures.
func (*QualityFixtures) QualitySessions ¶
func (f *QualityFixtures) QualitySessions() []QualitySession
QualitySessions returns all quality-session fixtures as wire payload rows.
func (*QualityFixtures) QualitySessionsForSet ¶
func (f *QualityFixtures) QualitySessionsForSet(name QualityFixtureSetName) ([]QualitySession, error)
QualitySessionsForSet returns a named fixture set as wire payload rows.
func (*QualityFixtures) SessionByName ¶
func (f *QualityFixtures) SessionByName(name QualityFixtureName) (QualitySessionFixture, bool)
SessionByName returns the named quality-session fixture row.
func (*QualityFixtures) SetByName ¶
func (f *QualityFixtures) SetByName(name QualityFixtureSetName) (QualityFixtureSet, bool)
SetByName returns the named quality fixture set.
type QualityMedianCase ¶ added in v0.42.0
type QualityMedianCase struct {
Name string `json:"name" yaml:"name"`
Sessions []QualityMedianSession `json:"sessions" yaml:"sessions"`
Expected PersonalMedians `json:"expected" yaml:"expected"`
}
QualityMedianCase is one named personal-medians fixture case: the sessions in the sample and the PersonalMedians the aggregate must return.
type QualityMedianSession ¶ added in v0.42.0
type QualityMedianSession struct {
TotalTokens int `json:"totalTokens" yaml:"totalTokens"`
RetryTokensWasted int `json:"retryTokensWasted" yaml:"retryTokensWasted"`
SpecQualityScore float64 `json:"specQualityScore" yaml:"specQualityScore"`
WithinSessionReverts int `json:"withinSessionReverts" yaml:"withinSessionReverts"`
}
QualityMedianSession is one session in a personal-medians sample. Only these four metric inputs participate in the baseline.
type QualityMetricVariation ¶
type QualityMetricVariations ¶
type QualityMetricVariations struct {
RetryLoops []QualityMetricVariation `json:"retryLoops" yaml:"retry_loops"`
SignalDensity []QualityMetricVariation `json:"signalDensity" yaml:"signal_density"`
SpecQualityScore []QualityMetricVariation `json:"specQualityScore" yaml:"spec_quality_score"`
FilesTouched []QualityMetricVariation `json:"filesTouched" yaml:"files_touched"`
LinesChanged []QualityMetricVariation `json:"linesChanged" yaml:"lines_changed"`
}
type QualityMetrics ¶
type QualityMetrics struct {
// Basic session counts
TurnCount *int `` /* 264-byte string literal not displayed */
SubagentCount *int `json:"subagentCount,omitempty"`
TotalTokens *int `json:"totalTokens,omitempty"`
InputTokens *int `json:"inputTokens,omitempty"`
OutputTokens *int `json:"outputTokens,omitempty"`
ToolCalls *int `json:"toolCalls,omitempty"`
TitleGenerated *string `json:"titleGenerated,omitempty"`
Outcome *SessionOutcome `json:"outcome,omitempty"`
FilesTouched *int `json:"filesTouched,omitempty"`
LinesChanged *int `json:"linesChanged,omitempty"`
RetryLoops *int `json:"retryLoops,omitempty"`
RetryTokensWasted *int `json:"retryTokensWasted,omitempty"`
WithinSessionReverts *int `json:"withinSessionReverts,omitempty"`
SignalDensity *float64 `json:"signalDensity,omitempty"`
SpecQualityScore *float64 `json:"specQualityScore,omitempty"`
ExplorationRatio *float64 `json:"explorationRatio,omitempty"`
ScopeBreadth *int `json:"scopeBreadth,omitempty"`
DiscoveryTurns *int `json:"discoveryTurns,omitempty"`
DurationMinutes *float64 `json:"durationMinutes,omitempty"`
// M-series advanced metrics (v2 computed)
M2TokenOutcomeRatio *float64 `json:"m2TokenOutcomeRatio,omitempty"`
M3UniqueToolCount *int `json:"m3UniqueToolCount,omitempty"`
M4ErrorRecoveryCount *int `json:"m4ErrorRecoveryCount,omitempty"`
M4ConsecutiveErrorMax *int `json:"m4ConsecutiveErrorMax,omitempty"`
M5ContextUtilizationPct *float64 `json:"m5ContextUtilizationPct,omitempty"`
M5PeakContextTokens *int `json:"m5PeakContextTokens,omitempty"`
M5AvgMessageTokens *int `json:"m5AvgMessageTokens,omitempty"`
M6OutputSurvivalPct *float64 `json:"m6OutputSurvivalPct,omitempty"`
M6LinesSurvived *int `json:"m6LinesSurvived,omitempty"`
M6LinesTotal *int `json:"m6LinesTotal,omitempty"`
M7SpecWordCount *int `json:"m7SpecWordCount,omitempty"`
M7SpecHasExamples *bool `json:"m7SpecHasExamples,omitempty"`
M7SpecHasConstraints *bool `json:"m7SpecHasConstraints,omitempty"`
// v3 cost analytics
CostInputUSD *float64 `json:"costInputUsd,omitempty"`
CostOutputUSD *float64 `json:"costOutputUsd,omitempty"`
CostReasoningUSD *float64 `json:"costReasoningUsd,omitempty"`
CostCacheReadUSD *float64 `json:"costCacheReadUsd,omitempty"`
CostCacheWriteUSD *float64 `json:"costCacheWriteUsd,omitempty"`
CostTotalUSD *float64 `json:"costTotalUsd,omitempty"`
CostModelID *string `json:"costModelId,omitempty"`
// v3 scope classification
Scope *string `json:"scope,omitempty"`
// Compute metadata
ComputedAt *int64 `json:"computedAt,omitempty"` // Unix millis
ComputeVersion *int `json:"computeVersion,omitempty"` // 0=v1 migrated, 1+=v2 computed
}
QualityMetrics holds session statistics and derived quality signals for a session. The type name is intentionally broad post-unification: it covers two distinct groups.
Group A — Basic session stats (TurnCount, SubagentCount, TotalTokens, InputTokens, OutputTokens, ToolCalls, TitleGenerated, Outcome, DurationMinutes): populated for all fully-ingested sessions; a nil value here indicates the session has not been fully ingested.
Group B — Derived quality signals (FilesTouched, LinesChanged, RetryLoops, M-series fields, SignalDensity, SpecQualityScore, ExplorationRatio, etc.): populated only when quality analysis has run. Nil = "not computed" — analysis may not have been performed yet.
All fields are pointers with omitempty so that serialisation omits fields that have not been populated, regardless of which group they belong to. JSON tags use camelCase to match the backend data contract (QualitySession) field names.
type QualityPage ¶ added in v0.42.0
type QualityPage struct {
OffsetPage[QualitySession]
Summary ProjectAnalytics `json:"summary"`
}
QualityPage is the quality read for one offset page of sessions. The summary is the full analytics bundle computed over the library at the page revision; the rows are the requested page, so no surface subscribes to the full library.
func (QualityPage) Validate ¶ added in v0.42.0
func (p QualityPage) Validate() error
Validate checks the common offset-page contract for the quality rows and the analytics summary carried beside them.
type QualityPayload ¶
type QualityPayload struct {
Sessions []QualitySession `json:"sessions"`
}
QualityPayload is the data sent on the quality WebSocket channel.
type QualityRatioVariation ¶
type QualitySession ¶
type QualitySession struct {
ID string `json:"id"`
Date string `json:"date"` // "2006-01-02" format
Project string `json:"project"`
TotalTokens int `json:"totalTokens"`
InputTokens int `json:"inputTokens"`
OutputTokens int `json:"outputTokens"`
TurnCount int `` /* 254-byte string literal not displayed */
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
ToolCalls int `json:"toolCalls"`
DurationMinutes float64 `json:"durationMinutes"`
// v2 fields -- zero-valued until implemented.
Scope string `json:"scope"`
Title string `json:"title"`
Outcome string `json:"outcome"`
FilesTouched int `json:"filesTouched"`
LinesChanged int `json:"linesChanged"`
RetryLoops int `json:"retryLoops"`
RetryTokensWasted int `json:"retryTokensWasted"`
WithinSessionReverts int `json:"withinSessionReverts"`
SignalDensity float64 `json:"signalDensity"`
SpecQualityScore float64 `json:"specQualityScore"`
ExplorationRatio float64 `json:"explorationRatio"`
ScopeBreadth int `json:"scopeBreadth"`
DiscoveryTurns int `json:"discoveryTurns"`
// EffectiveAnnotations are the non-superseded annotations for this session.
// Clients derive display labels (e.g. humanLabel, agentLabel) by filtering
// on typeId and annotatorKind — no pre-computed string fields needed.
EffectiveAnnotations []AnnotationSummary `json:"effectiveAnnotations,omitempty"`
}
QualitySession is the analytics payload for the quality dashboard.
type QualitySessionFixture ¶
type QualitySessionFixture struct {
Name QualityFixtureName `json:"name" yaml:"name"`
ID string `json:"id" yaml:"id"`
Date string `json:"date" yaml:"date"`
Project string `json:"project" yaml:"project"`
Scope string `json:"scope" yaml:"scope"`
Title string `json:"title" yaml:"title"`
TotalTokens int `json:"totalTokens" yaml:"totalTokens"`
InputTokens int `json:"inputTokens" yaml:"inputTokens"`
OutputTokens int `json:"outputTokens" yaml:"outputTokens"`
TurnCount int `json:"turnCount" yaml:"turnCount"`
ToolCalls int `json:"toolCalls" yaml:"toolCalls"`
Outcome string `json:"outcome" yaml:"outcome"`
FilesTouched int `json:"filesTouched" yaml:"filesTouched"`
LinesChanged int `json:"linesChanged" yaml:"linesChanged"`
DurationMinutes float64 `json:"durationMinutes" yaml:"durationMinutes"`
RetryLoops int `json:"retryLoops" yaml:"retryLoops"`
RetryTokensWasted int `json:"retryTokensWasted" yaml:"retryTokensWasted"`
WithinSessionReverts int `json:"withinSessionReverts" yaml:"withinSessionReverts"`
SignalDensity float64 `json:"signalDensity" yaml:"signalDensity"`
SpecQualityScore float64 `json:"specQualityScore" yaml:"specQualityScore"`
ExplorationRatio float64 `json:"explorationRatio" yaml:"explorationRatio"`
ScopeBreadth int `json:"scopeBreadth" yaml:"scopeBreadth"`
DiscoveryTurns int `json:"discoveryTurns" yaml:"discoveryTurns"`
}
QualitySessionFixture is one named quality-session fixture row.
func (QualitySessionFixture) ToQualitySession ¶
func (f QualitySessionFixture) ToQualitySession() QualitySession
ToQualitySession converts a named fixture row to the wire payload shape.
type QualityStringVariation ¶
type QualityStringVariation struct {
Value string `json:"value" yaml:"value"`
}
type QualityVariations ¶
type QualityVariations struct {
Outcomes []QualityStringVariation `json:"outcomes" yaml:"outcomes"`
Projects []QualityStringVariation `json:"projects" yaml:"projects"`
Scopes []QualityStringVariation `json:"scopes" yaml:"scopes"`
TaskTitles []QualityStringVariation `json:"taskTitles" yaml:"task_titles"`
TokenRatios []QualityRatioVariation `json:"tokenRatios" yaml:"token_ratios"`
Metrics QualityMetricVariations `json:"metrics" yaml:"metrics"`
}
QualityVariations is the reusable combinatorial input catalog carried by the canonical quality fixture document.
type RawJSONPathPolicy ¶ added in v0.16.0
type ReadAttributionState ¶
type ReadAttributionState string
ReadAttributionState reports whether per-file read attribution is recoverable for a node's editing sessions. It is the honesty axis that keeps a zero ReadCount from being misread as "known unread" when it is really "never recorded".
const ( ReadAttributionComplete ReadAttributionState = "complete" ReadAttributionPartial ReadAttributionState = "partial" )
ReadAttributionState values.
func (ReadAttributionState) IsValid ¶
func (s ReadAttributionState) IsValid() bool
IsValid reports whether s is one of the defined read attribution states.
func (ReadAttributionState) JSONSchema ¶
func (ReadAttributionState) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ReadAttributionState) String ¶
func (s ReadAttributionState) String() string
String returns the wire representation of the read attribution state.
func (ReadAttributionState) Validate ¶
func (s ReadAttributionState) Validate() error
Validate rejects values that cannot cross the read-attribution wire boundary.
type ReadStateGrade ¶
type ReadStateGrade string
ReadStateGrade is the ordinal closed set of explicit read-state acts (the read-state grade design): none < viewed < reviewed < reviewed_in_detail. The ordering is registry data (the peasant-side system-origin TypeDefinition seed); this Go closed set is the sole typed copy on the wire, kept identical to the registry seed by ReadStateGradeRegistrySeedPermissibleValues.
const ( ReadStateGradeNone ReadStateGrade = "none" ReadStateGradeViewed ReadStateGrade = "viewed" ReadStateGradeReviewed ReadStateGrade = "reviewed" ReadStateGradeReviewedInDetail ReadStateGrade = "reviewed_in_detail" )
ReadStateGrade values, in ascending ordinal order.
func (ReadStateGrade) IsValid ¶
func (g ReadStateGrade) IsValid() bool
IsValid reports whether g is one of the defined read-state grades.
func (ReadStateGrade) JSONSchema ¶
func (ReadStateGrade) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ReadStateGrade) String ¶
func (g ReadStateGrade) String() string
String returns the wire representation of the read-state grade.
func (ReadStateGrade) Validate ¶
func (g ReadStateGrade) Validate() error
Validate rejects values that cannot cross the read-state-grade wire boundary.
type RecordedCostAmount ¶ added in v0.16.0
type RecordedCostAmount string
type RecordedCostDetail ¶ added in v0.16.0
type RecordedCostDetail struct {
Input *RecordedCostAmount `json:"input,omitempty"`
Output *RecordedCostAmount `json:"output,omitempty"`
CacheRead *RecordedCostAmount `json:"cacheRead,omitempty"`
CacheWrite *RecordedCostAmount `json:"cacheWrite,omitempty"`
Total *RecordedCostAmount `json:"total,omitempty"`
Source string `json:"source"`
}
type RedactionExample ¶
type RedactionExample struct {
// Name is the stable case key (snake_case). The web codegen joins its
// presentation side-table (UI context snippets) to a case by this Name.
Name string `yaml:"name"`
// RuleID is the pkg/redact rule that fires on OriginalText (e.g. "github_pat").
RuleID string `yaml:"ruleId"`
// Category is the ENGINE category vocabulary: "secrets" | "pii" | "paths" |
// "project". This is the ONE canonical category vocabulary; the web display
// enum (CREDENTIAL|PII|PATH|INTERNAL) is a derived, audited projection.
Category string `yaml:"category"`
// Level is the minimum redaction level at which RuleID fires.
Level RedactionFixtureLevel `yaml:"level"`
// OriginalText is a realistic, public-safe secret FORMAT (non-functional
// example value) that the engine genuinely detects.
OriginalText string `yaml:"originalText"`
// RedactedReplacement is the engine-APPLIED output, stored verbatim. For
// back-reference rules this is the partially-redacted form
// (e.g. "/Users/<USER>/Projects/internal-api"), not a bare label.
RedactedReplacement string `yaml:"redactedReplacement"`
// Confidence is a presentation-only 0-100 score shown in the mock UI.
Confidence int `yaml:"confidence"`
// LineNumber is a presentation-only source line shown in the mock UI.
LineNumber int `yaml:"lineNumber"`
// Description is a human-readable label shown in the mock UI.
Description string `yaml:"description"`
}
RedactionExample is one entry in the redaction example corpus. It is the single source of truth for the redaction session-detail fixture: the leaf STORES this data and a format-only generator serialises it to testdata/session-detail/redactions.yaml. The leaf never recomputes RedactedReplacement — the redaction ENGINE lives only in peasant (pkg/redact), and a peasant-side behavioural conformance test binds RedactedReplacement to the real engine output (the no-drift guarantee).
func LoadRedactionExamples ¶
func LoadRedactionExamples() ([]RedactionExample, error)
LoadRedactionExamples parses RedactionsYAML (the embedded, generated artifact) into typed cases. Consumers (peasant conformance test, web codegen) bind to the PUBLISHED bytes via this loader rather than the in-memory RedactionExamples slice, so they validate exactly what ships; the leaf freshness gate keeps the two in lockstep.
type RedactionFixtureLevel ¶
type RedactionFixtureLevel string
RedactionFixtureLevel is the redaction level at which a fixture case's rule fires. The string values are byte-identical to peasant pkg/redact's RedactionLevel ("minimal"/"standard"/"maximum") so the peasant conformance test can construct a redactor at the exact firing level via redact.RedactionLevel(string(level)) with no translation table.
Default firing semantics are category-based, but the engine may give an individual rule a stricter minimum:
- secrets, paths -> fire at Minimal and above (unconditional)
- pii, project -> normally fire at Standard and above
- selected project rules may require Maximum
The fixture stores the MINIMUM level at which each case's rule fires so the conformance test exercises the narrowest level that still triggers the rule (avoids entropy/AST over-redaction that only Maximum adds).
const ( // RedactionLevelMinimal redacts only secrets and paths. RedactionLevelMinimal RedactionFixtureLevel = "minimal" // RedactionLevelStandard adds PII and most project-identity redaction. RedactionLevelStandard RedactionFixtureLevel = "standard" // RedactionLevelMaximum adds stricter project rules, AST anonymization, and entropy detection. RedactionLevelMaximum RedactionFixtureLevel = "maximum" )
func (RedactionFixtureLevel) IsValid ¶
func (l RedactionFixtureLevel) IsValid() bool
IsValid reports whether l is one of the three known levels.
func (RedactionFixtureLevel) String ¶
func (l RedactionFixtureLevel) String() string
String returns the wire form of the level.
type RedactionInfo ¶
type RedactionInfo struct {
Applied bool `json:"applied"`
Level string `json:"level,omitempty"` // redaction level used (validate with redact.RedactionLevel)
RuleSetVersion string `json:"rule_set_version,omitempty"` // rule set version that produced this redaction (e.g. "1.1.0")
RedactedAtMs *int64 `json:"redacted_at_ms,omitempty"` // unix ms when redacted
ContentHashAtRedact string `json:"content_hash_at_redact,omitempty"` // content hash snapshot at redaction time
}
RedactionInfo tracks whether and when redaction was applied to a session's transcript. Level is stored as a string because this schema module is a public contract module that must not import internal packages. Callers should validate using redact.RedactionLevel(level).IsValid().
func (RedactionInfo) IsCurrent ¶
func (r RedactionInfo) IsCurrent(currentContentHash string) bool
IsCurrent returns true if the redaction matches the current content.
func (RedactionInfo) IsRaw ¶
func (r RedactionInfo) IsRaw() bool
IsRaw returns true if no redaction has been applied.
func (RedactionInfo) IsStale ¶
func (r RedactionInfo) IsStale(currentContentHash string) bool
IsStale returns true if the content has changed since redaction was applied.
type RefCase ¶
type RefCase struct {
// Name is a stable, human-readable case identifier (used as the t.Run name).
Name string
// Input is the raw string fed to ParseTranscriptRef.
Input string
// WantID is the expected canonical (lowercase) TranscriptID string for a
// PARSING case; empty for a reject case.
WantID string
// WantFromURL is the expected TranscriptRef.FromURL for a parsing case.
WantFromURL bool
// WantErr is true when ParseTranscriptRef is expected to return an error.
WantErr bool
// ErrContains is a substring the returned error must contain (reject cases).
ErrContains string
}
RefCase is a single concrete ParseTranscriptRef test case, materialised from the axes/categories. It is what internal/pull/types_test.go ranges over.
type RefForm ¶
type RefForm struct {
Name string `yaml:"name"`
Template string `yaml:"template"`
FromURL bool `yaml:"from_url"`
}
RefForm is one entry of the ref_forms axis: a templated reference shape plus the FromURL the parser is expected to report for it.
type RelationshipNavigationStatus ¶ added in v0.19.0
type RelationshipNavigationStatus string
const ( )
func NewRelationshipNavigationStatus ¶ added in v0.19.0
func NewRelationshipNavigationStatus(raw string) (RelationshipNavigationStatus, error)
func (RelationshipNavigationStatus) IsValid ¶ added in v0.19.0
func (v RelationshipNavigationStatus) IsValid() bool
func (RelationshipNavigationStatus) JSONSchema ¶ added in v0.19.0
func (RelationshipNavigationStatus) JSONSchema() (jsonschema.Schema, error)
type RelationshipTargetState ¶ added in v0.19.0
type RelationshipTargetState string
const ( RelationshipTargetKnown RelationshipTargetState = "target_known" RelationshipTargetKnownRetained RelationshipTargetState = "target_known_retained" RelationshipTargetExplicitNone RelationshipTargetState = "explicit_none" RelationshipTargetUnknown RelationshipTargetState = "unknown" RelationshipTargetConflictingCurrentNativeEvidence RelationshipTargetState = "conflicting_current_native_evidence" )
func NewRelationshipTargetState ¶ added in v0.19.0
func NewRelationshipTargetState(raw string) (RelationshipTargetState, error)
func (RelationshipTargetState) IsValid ¶ added in v0.19.0
func (v RelationshipTargetState) IsValid() bool
func (RelationshipTargetState) JSONSchema ¶ added in v0.19.0
func (RelationshipTargetState) JSONSchema() (jsonschema.Schema, error)
type RetainedUnknownRecord ¶ added in v0.24.0
type RetainedUnknownRecord struct {
SourceRef string `json:"sourceRef" minLength:"1"`
RecordIndex int64 `json:"recordIndex" minimum:"0" maximum:"9007199254740991"`
Position int64 `json:"position" minimum:"0" maximum:"9007199254740991"`
Pointer string `json:"pointer" pattern:"^(?:/(?:[^~]|~[01])*)*$"`
Namespace string `json:"namespace" minLength:"1"`
Kind string `json:"kind" minLength:"1"`
Payload string `json:"payload" minLength:"1"`
}
RetainedUnknownRecord preserves an uninterpreted source record or block after ordinary producer redaction. Payload is complete JSON TEXT, not a parsed JSON value: this preserves numeric literals outside JavaScript's number domain. SourceRef identifies a source stream, never a filesystem path. RecordIndex counts every source record, including known records, starting at zero; it is assigned by traversal and does not depend on a native ordinal. Pointer is an RFC 6901 pointer within that record (empty for the whole record). Position is the zero-based traversal position of the record/block within the source stream. Namespace disambiguates native discriminators such as record and message.block. Neither Namespace nor Kind is a closed vocabulary.
type ReturningContributorRate ¶ added in v0.42.0
type ReturningContributorRate struct {
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
Returning int `json:"returning" minimum:"0" maximum:"9007199254740991"`
Rate float64 `json:"rate" minimum:"0" maximum:"1"`
}
ReturningContributorRate is the returning-contributor result. A returning contributor is active in at least two distinct weeks; Rate is Returning/Total in [0, 1], and 0 when no contributor exists.
type ReviewListPayload ¶
type ReviewListPayload struct {
ProjectHash ProjectHash `json:"projectHash"`
RepoFound bool `json:"repoFound"`
DefaultBranch string `json:"defaultBranch,omitempty"`
Changes []ChangeSummary `json:"changes" required:"true" nullable:"false"` // open first, then merged
RecentCommits []CommitRef `json:"recentCommits" required:"true" nullable:"false"` // default-branch, cap 200 (time strip)
Sessions []TimelineSessionRef `json:"sessions" required:"true" nullable:"false"` // complete visible project timeline identities, including sessions not linked to displayed commits
// RewrittenCommits lists the project's full session-era commit resolution
// ledger. Only non-live rows render as ghosts; live rows remain valid history
// entries. It is empty when the resolver found no relevant session-era rows.
RewrittenCommits []RewrittenCommit `json:"rewrittenCommits" required:"true" nullable:"false"`
}
ReviewListPayload lists a project's changes, served by GET /api/v1/review/{projectHash}.
func NewReviewListPayload ¶
func NewReviewListPayload(projectHash ProjectHash) *ReviewListPayload
NewReviewListPayload returns a ReviewListPayload with all slices initialized to empty (never-nil marshal guarantee).
func (ReviewListPayload) Validate ¶
func (p ReviewListPayload) Validate() error
Validate checks the normalized timeline relationship and compatibility invariants. It does not infer candidate or temporal associations, and it validates each CommitRef's shape before checking timeline membership and rank-order rules.
type ReviewSuggestion ¶
type ReviewSuggestion struct {
Path string `json:"path"`
LastEngaged string `json:"lastEngaged"`
DaysSince int `json:"daysSince"`
SuggestedPrompt string `json:"suggestedPrompt"`
}
ReviewSuggestion nudges the user to revisit a fading file.
type RewriteMethod ¶
type RewriteMethod string
RewriteMethod names the mechanism the resolver used to map a ghost commit to its successor, in the order the resolver attempts them.
const ( RewriteMethodHash RewriteMethod = "hash" RewriteMethodPatchID RewriteMethod = "patch_id" RewriteMethodAuthorIdentity RewriteMethod = "author_identity" RewriteMethodMessageEmbedded RewriteMethod = "message_embedded" RewriteMethodTemporal RewriteMethod = "temporal" RewriteMethodNone RewriteMethod = "none" )
RewriteMethod values.
func (RewriteMethod) IsValid ¶
func (m RewriteMethod) IsValid() bool
IsValid reports whether m is one of the defined rewrite methods.
func (RewriteMethod) JSONSchema ¶
func (RewriteMethod) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (RewriteMethod) String ¶
func (m RewriteMethod) String() string
String returns the wire representation of the rewrite method.
func (RewriteMethod) Validate ¶
func (m RewriteMethod) Validate() error
Validate rejects values that cannot cross the rewrite-method wire boundary.
type RewriteResolution ¶
type RewriteResolution string
RewriteResolution classifies whether a ledger-observed commit hash is still live on the default branch, was rewritten to a resolvable successor, or could not be resolved.
const ( RewriteResolutionLive RewriteResolution = "live" RewriteResolutionRewritten RewriteResolution = "rewritten" RewriteResolutionUnresolved RewriteResolution = "unresolved" )
RewriteResolution values.
func (RewriteResolution) IsValid ¶
func (r RewriteResolution) IsValid() bool
IsValid reports whether r is one of the defined rewrite resolutions.
func (RewriteResolution) JSONSchema ¶
func (RewriteResolution) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (RewriteResolution) String ¶
func (r RewriteResolution) String() string
String returns the wire representation of the rewrite resolution.
func (RewriteResolution) Validate ¶
func (r RewriteResolution) Validate() error
Validate rejects values that cannot cross the rewrite-resolution wire boundary.
type RewrittenCommit ¶
type RewrittenCommit struct {
GhostHash string `json:"ghostHash" yaml:"ghostHash" required:"true"`
// Subject and AuthorTimeMs are "" / nil when the ledger row never
// recorded that metadata (degraded providers).
Subject string `json:"subject" yaml:"subject"`
AuthorTimeMs *int64 `json:"authorTimeMs,omitempty" yaml:"authorTimeMs,omitempty"`
SessionIDs []SessionID `json:"sessionIds" yaml:"sessionIds" required:"true" nullable:"false"`
// Associations mirrors SessionIDs one-for-one in the same order. These are
// the original session-era relationships and retain their IDs even when a
// successor commit is displayed.
Associations []SessionAssociation `json:"associations" yaml:"associations" required:"true" nullable:"false"`
// SuccessorHash is nil when Resolution is unresolved; non-nil when
// rewritten. It is never populated for Resolution=live (a live ledger
// hash is not a ghost).
SuccessorHash *string `json:"successorHash,omitempty" yaml:"successorHash,omitempty"`
Resolution RewriteResolution `json:"resolution" yaml:"resolution" required:"true"`
Method RewriteMethod `json:"method" yaml:"method" required:"true"`
Confidence Confidence `json:"confidence" yaml:"confidence" required:"true"`
}
RewrittenCommit is one session-era commit resolution ledger row. The row may record a live commit, a rewritten ghost, or an unresolved ghost; only non-live rows render as ghosts in timeline views.
func (RewrittenCommit) Validate ¶
func (r RewrittenCommit) Validate() error
Validate checks a single RewrittenCommit's own fields: the resolution and method enums are in-set, SessionIDs are present and non-empty, SuccessorHash presence matches Resolution, and Method==none iff Resolution==unresolved. It does not check cross-references to a payload's session table or commit set; callers with that context use validateRewrittenCommits.
type Role ¶
type Role string
Role represents the sender of a message turn.
func (Role) JSONSchema ¶
func (Role) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type ScaleKind ¶
type ScaleKind string
ScaleKind classifies the measurement level of an annotation value domain (Stevens 1946 levels of measurement, ISO 11179 Part 5).
- nominal: categories without order (e.g. session scope: feature/bug/docs)
- ordinal: ordered categories with no meaningful interval (e.g. approval: deny<approve)
- continuous: numeric range with meaningful intervals (e.g. confidence 0.0–1.0)
Valid combinations with ValueDomainKind:
- enumerated + nominal: OK (categories without order)
- enumerated + ordinal: OK (ordered categories with permissible values list)
- described + continuous: OK (range with JSON schema constraint spec)
- described + nominal: OK (pattern-constrained categories)
- described + ordinal: REJECTED (ordinal requires explicit ordering via permissible values)
- enumerated + continuous: REJECTED (continuous ranges must be described, not enumerated)
func (ScaleKind) JSONSchema ¶
func (ScaleKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type SchemaVersionResponse ¶
type SchemaVersionResponse struct {
AnnotationSchemaVersion string `json:"annotationSchemaVersion"`
SupportedTargetKinds []string `json:"supportedTargetKinds"`
SupportedTypeIDs []string `json:"supportedTypeIds"`
PushContractVersion PushContractVersion `json:"pushContractVersion"`
MinPushContractVersion PushContractVersion `json:"minPushContractVersion"`
PullContractVersion PushContractVersion `json:"pullContractVersion,omitempty"`
MinPullContractVersion PushContractVersion `json:"minPullContractVersion,omitempty"`
MaxPullContractVersion PushContractVersion `json:"pullContractMaxVersion,omitempty"`
// SegmentedReadVersion and MinSegmentedReadVersion state the newest and
// oldest segmented read protocol the host serves. Emit both or neither.
// An absent pair means 0.1.0 only; a lone member is unusable and a reader
// must fail closed rather than select the newer generation. The values are
// opaque exact tokens, not a request to infer semantic-version ordering.
SegmentedReadVersion string `json:"segmentedReadVersion,omitempty"`
MinSegmentedReadVersion string `json:"minSegmentedReadVersion,omitempty"`
// ContentCapabilities advertises optional enriched-content contracts proven
// safe through the server's publish, storage, migration, and serving paths.
// Omitted and empty mean no capability; JSON null is outside the contract.
// Readers use exact token membership, ignore unknown tokens, and never infer
// SemVer ordering. Advertisements are deployment-specific: clients preflight
// the destination immediately before remote upload and refuse locally when a
// payload requirement is missing, without stripping evidence. A dry run may
// perform only this local negotiation and must not upload remotely. Duplicate
// server output is invalid, clients tolerate and deduplicate it, order has no
// meaning, and canonical server serialization is lexicographically sorted.
ContentCapabilities []ContentCapability `json:"contentCapabilities,omitempty"`
}
SchemaVersionResponse is returned by GET /api/v1/schema/version. It communicates which annotation schema AND which push CONTENT contract the village currently supports, so the CLI can preflight and version-negotiate.
PushContractVersion / MinPushContractVersion advertise the village's accept WINDOW [Min, Current] for the TranscriptContent push wire:
- PushContractVersion is the CURRENT contract the village emits/prefers.
- MinPushContractVersion is the PUSH-ACCEPTANCE FLOOR: the oldest contract the village will still accept on the publish path. A CLI ahead of Current downgrade-emits toward this window (never "upgrade the village").
TWO DISTINCT FLOORS: MinPushContractVersion is the push-acceptance floor (gates INCOMING uploads). It is deliberately SEPARATE from the village's display MIGRATE-ON-READ floor (how far back stored blobs can be normalized for rendering), which may reach FURTHER back than MinPushContractVersion — the village can still render a legacy stored blob it would no longer ACCEPT as a fresh push. The migrate-on-read floor lives village-side and is not advertised here; only the push-acceptance window is negotiated over the wire.
PullContractVersion / MinPullContractVersion advertise the village's PULL envelope WINDOW [Min, Current] (PullTranscriptInfo/PullListResponse/ PullAnnotation shapes, the /api/v1/pull/* endpoint semantics, ETag behaviour). This window is DISTINCT from the push window: it does NOT version the blob (the stored blob carries its own publish-time push contract version). Both fields are `omitempty` so an OLDER village that predates the pull surface emits the prior wire shape; the CLI treats an ABSENT advertisement as "village too old for pull" (actionable error), not as compatible.
Since the pull envelope became requestable (PullContractHeader), the three pull fields mean:
- PullContractVersion is the DEFAULT envelope Village serves to a request without the header. Released CLIs read it as "the envelope I will get" and refuse a window that excludes their own version, so it must stay at the version header-less clients read (LegacyPullContractVersion).
- MinPullContractVersion is unchanged: the oldest envelope Village serves.
- MaxPullContractVersion (pullContractMaxVersion) is the newest envelope Village can serve when a client asks for it. It is omitted by a Village that cannot serve anything newer than its default.
func (SchemaVersionResponse) MarshalJSON ¶ added in v0.54.0
func (r SchemaVersionResponse) MarshalJSON() ([]byte, error)
MarshalJSON prevents a producer from emitting an incomplete read window.
func (*SchemaVersionResponse) UnmarshalJSON ¶ added in v0.19.0
func (r *SchemaVersionResponse) UnmarshalJSON(data []byte) error
type ScryCheckRequest ¶ added in v0.37.0
type ScryCheckRequest struct {
ContractVersion string `json:"contractVersion" minLength:"1"`
TranscriptID TranscriptID `json:"transcriptId"`
SessionDetail SessionDetailPayload `json:"sessionDetail"`
PublishMetadata *AuthoritativePublishRequest `json:"publishMetadata,omitempty"`
Record ScryTranscriptRecord `json:"record"`
}
ScryCheckRequest is the body village posts to scry's POST /v1/check. Village and scry pin the same schema release. Scry stores and logs no content from it.
func (*ScryCheckRequest) UnmarshalJSON ¶ added in v0.37.0
func (r *ScryCheckRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown top-level members, requires every member but publishMetadata, and refuses an explicit null for any of them.
func (ScryCheckRequest) Validate ¶ added in v0.37.0
func (r ScryCheckRequest) Validate() error
Validate refuses a request built for another contract version, a transcript id that is not canonical, and a record time below 1.
type ScryCheckResponse ¶ added in v0.37.0
type ScryCheckResponse struct {
ScryVersion string `json:"scryVersion" pattern:"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"`
Verdict ScryVerdict `json:"verdict"`
// FlaggedTurns holds zero-based positions in the top-level
// sessionDetail.turns array; never TurnDetail.index values and never
// positions in earlierHistory or child sessions. Flagged means verdict
// checked with at least one position.
FlaggedTurns []int `` /* 260-byte string literal not displayed */
}
ScryCheckResponse is the verdict scry returns. Scry stores and logs no content, and the response never names a rule. Flagged is derived, never sent: Verdict == checked && len(FlaggedTurns) > 0.
func (ScryCheckResponse) PrepareJSONSchema ¶ added in v0.37.0
func (ScryCheckResponse) PrepareJSONSchema(s *jsonschema.Schema) error
PrepareJSONSchema bounds every flaggedTurns item, which struct tags cannot reach.
func (*ScryCheckResponse) UnmarshalJSON ¶ added in v0.37.0
func (r *ScryCheckResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown members and a null flaggedTurns.
func (ScryCheckResponse) Validate ¶ added in v0.37.0
func (r ScryCheckResponse) Validate(turnCount int) error
Validate is the single public flagged-turns rule: closed verdict, flaggedTurns non-null, empty when unchecked, ascending, unique, each in 0..maxSafeJSONInteger and < turnCount (len(sessionDetail.turns)).
type ScryHealthResponse ¶ added in v0.37.0
type ScryHealthResponse struct {
ContractVersion string `json:"contractVersion" minLength:"1"`
ScryVersion string `json:"scryVersion" pattern:"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"`
}
ScryHealthResponse is the body of scry's GET /healthz. Village compares ContractVersion with ScryContractVersion before it calls POST /v1/check.
func (*ScryHealthResponse) UnmarshalJSON ¶ added in v0.37.0
func (r *ScryHealthResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown members.
func (ScryHealthResponse) Validate ¶ added in v0.37.0
func (r ScryHealthResponse) Validate() error
Validate requires a non-empty contractVersion and a SemVer core scryVersion. It does not require the exact contract version: health reports what scry runs, and village compares the value itself.
type ScryTranscriptRecord ¶ added in v0.37.0
type ScryTranscriptRecord struct {
PublishedAtMs int64 `json:"publishedAtMs" minimum:"1" maximum:"9007199254740991"`
UpdatedAtMs int64 `json:"updatedAtMs" minimum:"1" maximum:"9007199254740991"`
}
ScryTranscriptRecord holds only facts village itself holds. Everything the publisher reported (times, stats, model, commits, client) is read from PublishMetadata and never copied here.
func (*ScryTranscriptRecord) UnmarshalJSON ¶ added in v0.37.0
func (r *ScryTranscriptRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown members, so a publisher field copied into the record fails.
type ScryVerdict ¶ added in v0.37.0
type ScryVerdict string
ScryVerdict is whether scry examined the transcript.
const ( ScryVerdictChecked ScryVerdict = "checked" ScryVerdictUnchecked ScryVerdict = "unchecked" // scry declined: unsupported content or harness )
func (ScryVerdict) IsValid ¶ added in v0.37.0
func (v ScryVerdict) IsValid() bool
func (ScryVerdict) JSONSchema ¶ added in v0.37.0
func (ScryVerdict) JSONSchema() (jsonschema.Schema, error)
func (ScryVerdict) String ¶ added in v0.37.0
func (v ScryVerdict) String() string
type SearchPayload ¶
type SearchPayload struct {
Query string `json:"query"`
Results []SearchResult `json:"results"`
}
SearchPayload is the result set for one query, served by GET /api/v1/search.
func NewSearchPayload ¶
func NewSearchPayload(query string) *SearchPayload
NewSearchPayload returns a SearchPayload with Results initialized to empty (never-nil marshal guarantee).
type SearchResult ¶
type SearchResult struct {
SessionID string `json:"sessionId"`
Project string `json:"project"` // raw canonical_cwd (else hash); web formats for display
ProjectHash ProjectHash `json:"projectHash,omitempty"` // for round-trips
EntryIndex int `json:"entryIndex"` // depth-0 turn index — deep-link coordinate
Role string `json:"role"` // user | assistant | ... (display facet)
Snippet string `json:"snippet"` // FTS5 snippet() with [match] markers
Score float64 `json:"score"` // negated bm25: higher = more relevant (result order is authoritative)
}
SearchResult is one FTS5 hit: a single message entry, ranked by relevance, with a snippet for display and the coordinates to deep-link to it.
type ServerMessage ¶
type ServerMessage struct {
Type MessageType `json:"type"`
Data any `json:"data,omitempty"`
Message string `json:"message,omitempty"` // for error type
Version string `json:"version,omitempty"` // for connected type
Topic ChannelTopic `json:"topic,omitempty"` // failed subscription topic for error type
ID string `json:"id,omitempty"` // failed topic identity, when applicable
Axis AnnotationAxis `json:"axis,omitempty"` // failed annotation axis, when applicable
}
ServerMessage is a message sent from the server to the browser via WebSocket.
type SessionAssociation ¶
type SessionAssociation struct {
ID AssociationID `json:"id" yaml:"id" required:"true"`
SessionID SessionID `json:"sessionId" yaml:"sessionId" required:"true"`
Conclusion AssociationConclusion `json:"conclusion" yaml:"conclusion" required:"true"`
Confidence Confidence `json:"confidence" yaml:"confidence" required:"true"`
Evidence []AssociationEvidenceObservation `json:"evidence" yaml:"evidence" required:"true" nullable:"false"`
}
SessionAssociation keeps an authoritative session-to-commit relationship as a durable identity, producer conclusion, confidence, and ordered atomic evidence observations.
func (SessionAssociation) Validate ¶
func (a SessionAssociation) Validate() error
Validate checks a single association's own fields are well-formed. It does not check cross-references to a payload's session table or its surrounding parent shape.
type SessionCommitsResponse ¶ added in v0.34.0
type SessionCommitsResponse struct {
Commits []CommitInfo `json:"commits" nullable:"false"`
}
SessionCommitsResponse is the response of GET /api/v1/sessions/{id}/commits.
The rows are the commits a stored session recorded, which is the same session-to-commit binding the review surfaces read rather than a git log replay. The envelope is a read projection: it carries no git context and no rewrite or ghost mapping, because a caller that needs those reads the session detail instead.
A stored session with no recorded commits answers an empty array, never null. An identifier that names no stored session is a 404 rather than an empty list, so "this session recorded nothing" and "this session is not here" stay distinguishable to the caller.
func (SessionCommitsResponse) Validate ¶ added in v0.34.0
func (r SessionCommitsResponse) Validate() error
Validate checks that the envelope carries an array. A null array would let a caller read "no commits recorded" and "the read never produced a list" as the same answer.
type SessionDetailHeader ¶ added in v0.42.0
type SessionDetailHeader struct {
SchemaVersion PushContractVersion `json:"schemaVersion,omitempty"`
ID string `json:"id"`
Harness Harness `json:"harness"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
DurationMins float64 `json:"durationMins"`
TotalTokens int `json:"totalTokens"`
TokensIn int `json:"tokensIn"`
TokensOut int `json:"tokensOut"`
TurnCount int `` /* 254-byte string literal not displayed */
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
ToolCallCount int `json:"toolCallCount"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
Project string `json:"project,omitempty"`
Model string `json:"model,omitempty"`
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
ThinkingLevelHistory []ThinkingLevelChange `json:"thinkingLevelHistory,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
GitBranch string `json:"gitBranch,omitempty"`
GitRemote string `json:"gitRemote,omitempty"`
ChildSessions []ChildSessionRef `json:"childSessions,omitempty"`
ParentSessionID *SessionID `json:"parentSessionId,omitempty"`
RootSessionID *SessionID `json:"rootSessionId,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
// EarlierHistory carries section state only. Turns and the native metadata
// that annotates them travel together on the durable read, and neither belongs
// on a metadata-only projection: the section's native metadata is validated
// against the turns it annotates.
EarlierHistory []EarlierHistoryState `json:"earlierHistory,omitempty" nullable:"false"`
Outcome SessionOutcome `json:"outcome,omitempty"`
SessionOrigin SessionOrigin `json:"sessionOrigin,omitempty"`
Scorecard *SessionScorecard `json:"scorecard,omitempty"`
RetainedUnknown []RetainedUnknownRecord `json:"retainedUnknown,omitempty" nullable:"false"`
Diagnostics *InterpretationDiagnostics `json:"diagnostics,omitempty" nullable:"false"`
}
SessionDetailHeader is the metadata-only projection of a session: everything the durable SessionDetailPayload states about the session except its turns. It is a distinct type, not a replacement for the durable payload, so no release window ships "turns: []" to a content-expecting viewer. Turn content lives in TranscriptSegment rows.
func (SessionDetailHeader) Validate ¶ added in v0.42.0
func (h SessionDetailHeader) Validate() error
Validate checks the header's metadata against the same shared rules the durable payload applies where those rules do not need turns.
type SessionDetailHeaderPayload ¶ added in v0.42.0
type SessionDetailHeaderPayload struct {
SessionDetailHeader
ChildSessionCount *int `json:"childSessionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
Title string `json:"title,omitempty"`
Medians *PersonalMedians `json:"medians,omitempty"`
Revision string `json:"revision,omitempty"`
Teammate *SessionTeammate `json:"teammate,omitempty"`
}
SessionDetailHeaderPayload is the session_detail frame body: the metadata header plus the local navigation and teammate evidence the durable push never carries.
func (SessionDetailHeaderPayload) Validate ¶ added in v0.42.0
func (p SessionDetailHeaderPayload) Validate() error
Validate checks the header, the authorized navigation metadata, and the optional local teammate evidence.
type SessionDetailPayload ¶
type SessionDetailPayload struct {
SchemaVersion PushContractVersion `json:"schemaVersion,omitempty"`
ID string `json:"id"`
Harness Harness `json:"harness"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
DurationMins float64 `json:"durationMins"`
TotalTokens int `json:"totalTokens"`
TokensIn int `json:"tokensIn"`
TokensOut int `json:"tokensOut"`
TurnCount int `` /* 254-byte string literal not displayed */
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
ToolCallCount int `json:"toolCallCount"`
Turns []TurnDetail `json:"turns"`
// Optional fields — populated when backend has the data.
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
Project string `json:"project,omitempty"`
// Model seeds sticky model resolution for the root assistant before the first
// valid turn observation. It is the earliest valid root-assistant model in
// canonical order when one is available, otherwise legacy stored metadata. It
// is never the latest, most common, or final session model.
Model string `json:"model,omitempty"`
// ThinkingLevel seeds sticky level resolution for the root assistant before
// the first valid turn observation: the earliest valid root-assistant
// observation in source order when available, otherwise the stored session
// seed; never latest, most common, or final. Raw rides the same rule.
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
// ThinkingLevelHistory records the in-session level changes observed after
// the seed, in source order, with consecutive duplicates collapsed. The
// first value stays in ThinkingLevel/ThinkingLevelRaw above; each entry here
// carries the later canonical level and/or its exact native spelling.
ThinkingLevelHistory []ThinkingLevelChange `json:"thinkingLevelHistory,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
GitBranch string `json:"gitBranch,omitempty"`
GitRemote string `json:"gitRemote,omitempty"`
ChildSessions []ChildSessionRef `json:"childSessions,omitempty"`
ParentSessionID *SessionID `json:"parentSessionId,omitempty"`
RootSessionID *SessionID `json:"rootSessionId,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
EarlierHistory []EarlierHistorySection `json:"earlierHistory,omitempty"`
// Outcome is the heuristic resolution status of the session
// (resolved/partial/failed), sourced from session_metrics.outcome. Empty
// when the session has no computed outcome. The metadata columns expose no
// per-signal reason, so no reason field accompanies it yet.
Outcome SessionOutcome `json:"outcome,omitempty"`
// SessionOrigin is the producer's declaration of who drove this session.
// Absent when the producer expressed no opinion; see SessionOrigin for the
// rule a consumer applies to an absent or "unknown" value.
SessionOrigin SessionOrigin `json:"sessionOrigin,omitempty"`
// Scorecard carries the per-session quality signals used by the "How this
// session went" self-assessment card. Nil when the session has no computed
// metrics. Sourced from the same session_metrics row that backs QualitySession.
Scorecard *SessionScorecard `json:"scorecard,omitempty"`
NativeMetadata []NativeMetadataRecord `json:"nativeMetadata,omitempty"`
RetainedUnknown []RetainedUnknownRecord `json:"retainedUnknown,omitempty" nullable:"false"`
Diagnostics *InterpretationDiagnostics `json:"diagnostics,omitempty" nullable:"false"`
}
SessionDetailPayload is the data sent on the session_detail WebSocket channel AND promoted to the versioned `peasant push` wire body inside a TranscriptContent envelope.
SchemaVersion is the EMBEDDED push-contract version. It is advisory: when this payload travels inside a TranscriptContent envelope the envelope's ContractVersion is authoritative (see TranscriptContent's conflict-winner note). The embedded copy keeps the payload self-describing when stored on its own. It is omitempty so the local WebSocket session_detail channel (which never sets it) does not gain a spurious "schemaVersion":"" field; the push builder sets it explicitly.
func DecodeSessionDetailPayloadRaw ¶ added in v0.16.0
func DecodeSessionDetailPayloadRaw(raw []byte) (SessionDetailPayload, error)
func DecodeSessionDetailPayloadRawWithPolicy ¶ added in v0.54.0
func DecodeSessionDetailPayloadRawWithPolicy(raw []byte, policy TranscriptContentReadPolicy) (SessionDetailPayload, error)
DecodeSessionDetailPayloadRawWithPolicy scans a bare detail under policy before applying the same shape and semantic validation as the source reader.
func (SessionDetailPayload) Header ¶ added in v0.54.0
func (p SessionDetailPayload) Header() SessionDetailHeader
Header projects a typed durable payload to the existing local-frame header. Earlier history carries only section states; turns and native records remain in the durable payload. This is not the served-byte projection used by the Village content header.
type SessionDetailReadPayload ¶ added in v0.19.0
type SessionDetailReadPayload struct {
SessionDetailPayload
// Title is the stored display title of the session, read from the stored
// session record rather than reconstructed from the quality rows. It is
// omitted when the producer has no stored title, and it never changes the
// durable push payload.
Title string `json:"title,omitempty"`
// Medians is the library-wide personal-medians baseline, cached per
// revision. Nil when the library holds no metric sample.
Medians *PersonalMedians `json:"medians,omitempty"`
// Revision is store_state.revision rendered as a decimal string. It is the
// same revision the quality page carries, so a client can drop cached
// medians when it changes. It is omitted when a durable payload is read
// without the local revision projection.
Revision string `json:"revision,omitempty"`
// Teammate is the Claude Code teammate identity this session was spawned
// under, present only when the stored parent transcript records spawning
// that exact identity. Local read evidence, never published transcript
// content: SessionDetailPayload itself never carries it.
Teammate *SessionTeammate `json:"teammate,omitempty"`
// Owner names whose artifact this session is in the local store. An absent
// value means this server does not project owners; {"kind":"unknown"} means
// the owner is projected but withheld. It is never guessed and never falls
// back to the local holder for a pulled row.
Owner *LocalArtifactIdentity `json:"owner,omitempty" nullable:"false"`
// AdapterVersion identifies the Peasant adapter/parser that produced this
// local artifact, not the native harness release. It is omitted when
// unknown; a present revision is positive.
AdapterVersion *int `` /* 230-byte string literal not displayed */
}
SessionDetailReadPayload is the local read projection. Anonymous embedding keeps every durable detail field at the JSON root while adding authorized navigation metadata that is never part of published transcript content.
func (SessionDetailReadPayload) Validate ¶ added in v0.34.1
func (p SessionDetailReadPayload) Validate() error
Validate checks the durable detail payload, the authorized navigation metadata, and the optional local teammate and owner evidence.
type SessionEntry ¶
type SessionEntry struct {
SessionID SessionID `json:"sessionId"`
EntryIndex int `json:"entryIndex"`
Harness Harness `json:"harness"`
EntryType EntryType `json:"entryType"`
Role Role `json:"role"`
TimestampMs *int64 `json:"timestampMs,omitempty"`
ContentPreview *string `json:"contentPreview,omitempty"` // max 500 chars
TokensIn *int `json:"tokensIn,omitempty"`
TokensOut *int `json:"tokensOut,omitempty"`
HasToolUse bool `json:"hasToolUse"`
ToolKind *ToolCallKind `json:"toolKind,omitempty"` // ACP-aligned tool classification
ToolNamesCSV *string `json:"toolNamesCsv,omitempty"`
HasThinking bool `json:"hasThinking"`
IsError bool `json:"isError"`
StopReason *StopReason `json:"stopReason,omitempty"` // ACP per-turn stop reason
RawByteLength *int `json:"rawByteLength,omitempty"`
ToolCallID *string `json:"toolCallId,omitempty"` // MCP correlation (was toolUseId)
EntryID *string `json:"entryId,omitempty"` // Provider-native ID
ParentEntryID *string `json:"parentEntryId,omitempty"` // Parent entry link
Depth int `json:"depth"` // 0 = message, 1 = content part
ParentIndex *int `json:"parentIndex,omitempty"` // entryIndex of parent (nil for depth=0)
ToolInput *string `json:"toolInput,omitempty"` // tool_use input JSON
ToolOutput *string `json:"toolOutput,omitempty"` // tool_result output JSON
Extra *string `json:"extra,omitempty"` // JSON overflow for provider-specific data
PartType *string `json:"partType,omitempty"` // provider's original part type label (nil for depth=0)
SourceEntryRef SourceEntryRef `json:"sourceEntryRef,omitempty"`
Provenance *ContentProvenance `json:"provenance,omitempty"`
}
SessionEntry represents a single indexed entry within a session transcript. Defined for v2 content-layer use; NOT used in v1 PublishRequest wire format. Maps 1:1 to a row in the session_entries table. All optional fields use pointer types to distinguish absent from zero. JSON tags use camelCase aligned with ACP content model.
type SessionGraphEnumInput ¶ added in v0.19.0
type SessionGraphFixtureCorpus ¶ added in v0.19.0
type SessionGraphFixtureCorpus struct {
TypeScriptConstraints struct {
CountCarriers []sessionGraphCountCarrier `yaml:"count_carriers"`
StrictObjects map[string]map[string]any `yaml:"strict_objects"`
} `yaml:"typescript_constraints"`
Durable DurableGraphFixtures `yaml:"durable"`
Refs testcase.Corpus[SessionGraphRefInput, SessionGraphRefExpected] `yaml:"refs"`
Enums testcase.Corpus[SessionGraphEnumInput, struct{}] `yaml:"enums"`
Relationships testcase.Corpus[SessionRelationship, SessionGraphFixtureExpected] `yaml:"relationships"`
RelationshipSets testcase.Corpus[SessionRelationshipsInput, SessionGraphFixtureExpected] `yaml:"relationship_sets"`
Provenance testcase.Corpus[ContentProvenance, SessionGraphFixtureExpected] `yaml:"provenance"`
HelperGroups testcase.Corpus[HelperGroupSummary, SessionGraphFixtureExpected] `yaml:"helper_groups"`
HelperContexts testcase.Corpus[HelperContextSummary, SessionGraphFixtureExpected] `yaml:"helper_contexts"`
EarlierHistory testcase.Corpus[EarlierHistorySection, SessionGraphFixtureExpected] `yaml:"earlier_history"`
RawRelationships testcase.Corpus[SessionGraphRawInput, SessionGraphRawExpected] `yaml:"raw_relationships"`
Recursive testcase.Corpus[SessionGraphRawInput, SessionGraphFixtureExpected] `yaml:"recursive"`
RawDurable testcase.Corpus[SessionGraphRawInput, SessionGraphFixtureExpected] `yaml:"raw_durable"`
NativeLimits testcase.Corpus[NativeLimitInput, SessionGraphFixtureExpected] `yaml:"native_limits"`
AuthoritativeRaw testcase.Corpus[SessionGraphRawInput, SessionGraphFixtureExpected] `yaml:"authoritative_raw"`
RecursiveRequired []string `yaml:"recursive_required_names"`
RawDurableRequired []string `yaml:"raw_durable_required_names"`
NativeLimitRequired []string `yaml:"native_limit_required_names"`
AuthoritativeRequired []string `yaml:"authoritative_required_names"`
}
func LoadSessionGraphFixtures ¶ added in v0.19.0
func LoadSessionGraphFixtures() (SessionGraphFixtureCorpus, error)
type SessionGraphFixtureExpected ¶ added in v0.19.0
type SessionGraphFixtureExpected struct {
ErrorContains string `yaml:"error_contains,omitempty"`
}
type SessionGraphRawExpected ¶ added in v0.19.0
type SessionGraphRawInput ¶ added in v0.19.0
type SessionGraphRawInput struct {
RawJSON string `yaml:"rawJson"`
}
type SessionGraphRefExpected ¶ added in v0.19.0
type SessionGraphRefInput ¶ added in v0.19.0
type SessionID ¶
type SessionID string
SessionID is a validated session identifier from a source provider. Accepted formats:
- UUID: "99d59925-36bc-424c-a789-8be54d9702ba"
- Claude subagent: "agent-a3aee4f"
- ACP session: "sess_3cd91f52effeXd3QAJ54jOyzv5" (ACP sess_ prefix)
- OpenCode session: "ses_3cd91f52effeXd3QAJ54jOyzv5"
- OpenCode message: "msg_001abc"
- Strike timestamped: "20260728T123456.123456789Z-ABCDEFGHIJKLMNOPQRST234567"
- Strike bare: "ABCDEFGHIJKLMNOPQRST234567"
func NewSessionID ¶
NewSessionID validates and constructs a SessionID.
func (SessionID) JSONSchema ¶
func (SessionID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
type SessionIdentity ¶
type SessionIdentity struct {
SessionID SessionID `json:"sessionId"`
ParentSessionID *SessionID `json:"parentUuid,omitempty"`
SchemaVersion int `json:"schemaVersion"`
}
SessionIdentity holds the identification fields for a session. JSON tags use camelCase to match CLI UnifiedMetadata wire format.
type SessionInsight ¶
type SessionInsight struct {
Kind InsightKind `json:"kind" yaml:"kind" required:"true"`
Provenance InsightProvenance `json:"provenance" yaml:"provenance" required:"true"`
Confidence Confidence `json:"confidence" yaml:"confidence" required:"true"`
Title string `json:"title" yaml:"title" required:"true"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
// Subjects names the node ids / file paths the insight is about.
Subjects []string `json:"subjects" yaml:"subjects" required:"true" nullable:"false"`
// Evidence is the traceability spine: every mechanical insight carries
// at least one item.
Evidence []InsightEvidence `json:"evidence" yaml:"evidence" required:"true" nullable:"false"`
// Classification MUST be nil under the current contract (see Validate).
// The field is reserved until its per-field taxonomy sets are defined.
Classification *InsightClassification `json:"classification,omitempty" yaml:"classification,omitempty"`
}
SessionInsight is one insight: a (kind x provenance x confidence) envelope with evidence and subjects, additive alongside ChangeDetailPayload's existing Unusual/Frictions signals. Current mechanical producers leave Classification nil. A future contract may define closed classification sets without changing this envelope's shape.
func (SessionInsight) Validate ¶
func (i SessionInsight) Validate() error
Validate checks the insight invariants: Kind/Provenance/Confidence are in-set, Subjects and Evidence are non-nil, every evidence item carries a non-empty session identity, every mechanical insight carries at least one evidence item, and Classification is nil. A future contract may replace the must-be-nil rule with per-field closed sets without changing the shape.
type SessionListItemKind ¶ added in v0.19.0
type SessionListItemKind string
const ( SessionListItemTranscript SessionListItemKind = "transcript" SessionListItemContextContainer SessionListItemKind = "context_container" )
func NewSessionListItemKind ¶ added in v0.19.0
func NewSessionListItemKind(raw string) (SessionListItemKind, error)
func (SessionListItemKind) IsValid ¶ added in v0.19.0
func (v SessionListItemKind) IsValid() bool
func (SessionListItemKind) JSONSchema ¶ added in v0.19.0
func (SessionListItemKind) JSONSchema() (jsonschema.Schema, error)
type SessionOrigin ¶ added in v0.1.2
type SessionOrigin string
SessionOrigin is who drove a recorded session, as declared by the producer that recorded it.
CONTRACT RULE, binding on every consumer:
- "user" and "agent" are decisions. A consumer stores the declared value and does not re-derive it.
- "unknown" is also a decision: the producer looked and could not tell. A consumer MUST fall back to whatever rule it would have applied had the field been absent. It MUST NOT store "unknown" in place of a judgement it is itself capable of making.
- An ABSENT field means the producer expressed no opinion, typically a build older than this field. A consumer falls back the same way.
So "unknown" and absent produce identical behaviour. They stay distinct because they are different facts: one producer examined the session, the other never knew the question existed. Only the first is evidence; both instruct the consumer to decide for itself.
const ( // SessionOriginUser: a person drove the session. SessionOriginUser SessionOrigin = "user" // SessionOriginAgent: a program started the session. SessionOriginAgent SessionOrigin = "agent" // SessionOriginUnknown: the producer examined the session and could not // establish who drove it. It instructs the consumer to apply its own rule. SessionOriginUnknown SessionOrigin = "unknown" )
func (SessionOrigin) IsValid ¶ added in v0.1.2
func (o SessionOrigin) IsValid() bool
IsValid reports whether o is a value this contract accepts on the wire. It accepts the empty string: an absent declaration is valid and means the producer expressed no opinion.
func (SessionOrigin) JSONSchema ¶ added in v0.1.2
func (SessionOrigin) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer. The published enum is the declared menu only; the empty string is the absence of the field, which omitempty already expresses, so it is not a menu member.
func (SessionOrigin) String ¶ added in v0.1.2
func (o SessionOrigin) String() string
type SessionOriginBehaviour ¶ added in v0.1.2
type SessionOriginBehaviour string
SessionOriginBehaviour is the closed set of contract behaviours the declared session-origin corpus must cover.
It exists because a row-count floor cannot protect a corpus: rows carrying a whole behaviour can be deleted with no assertion noticing, and a fixture row is not code, so no mutation of the production source can reach it. Naming the behaviours and asserting coverage per member makes the corpus itself guarded input.
const ( // SessionOriginBehaviourMenuMemberAccepted covers a declared menu member. SessionOriginBehaviourMenuMemberAccepted SessionOriginBehaviour = "menu_member_accepted" // SessionOriginBehaviourAbsentDeclarationAccepted covers the empty string: // an absent declaration is valid and means the producer expressed no opinion. SessionOriginBehaviourAbsentDeclarationAccepted SessionOriginBehaviour = "absent_declaration_accepted" // SessionOriginBehaviourOutOfMenuRejected covers a token outside the menu, // which neither the Go predicate nor the published schema may accept. SessionOriginBehaviourOutOfMenuRejected SessionOriginBehaviour = "out_of_menu_rejected" // SessionOriginBehaviourDetailRoundTrip covers the field surviving a JSON // round trip on the session detail payload. SessionOriginBehaviourDetailRoundTrip SessionOriginBehaviour = "detail_round_trip" // SessionOriginBehaviourSummaryRoundTrip covers the same on the session // summary, which carries the field independently of the detail payload. SessionOriginBehaviourSummaryRoundTrip SessionOriginBehaviour = "summary_round_trip" // SessionOriginBehaviourAbsentFieldOmitted covers omitempty: an undeclared // origin must not appear on the wire as an empty string, because a consumer // would then have to treat "" as a fourth token. SessionOriginBehaviourAbsentFieldOmitted SessionOriginBehaviour = "absent_field_omitted" // SessionOriginBehaviourPublishedSchemaRefusal covers the published Types // component refusing an out-of-menu token, so a non-Go consumer inherits the // same closed set. SessionOriginBehaviourPublishedSchemaRefusal SessionOriginBehaviour = "published_schema_refusal" )
func (SessionOriginBehaviour) IsValid ¶ added in v0.1.2
func (b SessionOriginBehaviour) IsValid() bool
IsValid reports whether b is a member of the closed behaviour set.
func (SessionOriginBehaviour) String ¶ added in v0.1.2
func (b SessionOriginBehaviour) String() string
type SessionOriginFixtures ¶ added in v0.1.2
type SessionOriginFixtures struct {
// RequiredBehaviours is the closed set, declared in the corpus itself so a
// reader of the fixture sees the coverage contract without reading Go. The
// loader compares it to AllSessionOriginBehaviours by membership.
RequiredBehaviours []SessionOriginBehaviour `yaml:"required_behaviours"`
// RequiredMenu is the declared menu the validity arm must exercise in full.
// The loader compares it to AllSessionOrigins by membership, so widening the
// enum without adding a row fails here.
// ByIDOperation is the declared shape of the by-id session-summaries
// operation, the link-resolution surface a stored session still reaches.
ByIDOperation SessionSummariesByIDContract `yaml:"by_id_operation"`
RequiredMenu []SessionOrigin `yaml:"required_menu"`
Validities testcase.Corpus[string, SessionOriginValidityExpectation] `yaml:"validities"`
RoundTrips testcase.Corpus[SessionOriginRoundTripInput, SessionOriginRoundTripExpectation] `yaml:"round_trips"`
SchemaProbes testcase.Corpus[SessionOriginSchemaProbe, SessionOriginSchemaExpectation] `yaml:"schema_probes"`
}
SessionOriginFixtures is the segmented declared-session-origin corpus: one named arm per behaviour family. The arms are heterogeneous on purpose. The predicate arm works on raw tokens, the round-trip arm on encoded payloads, and the schema arm on the generated document, so a single input type would have to be a union that hides which behaviour a row actually exercises.
func LoadSessionOriginFixtures ¶ added in v0.1.2
func LoadSessionOriginFixtures() (*SessionOriginFixtures, error)
LoadSessionOriginFixtures parses the corpus and boundary-validates it. It rejects unknown fields, trailing documents, a case missing its classification, provenance or mutation metadata, a verdict inconsistent with its classification, a refusal naming no expected error fragment, and any declared menu or behaviour the Go closed sets do not carry.
type SessionOriginPayloadKind ¶ added in v0.1.2
type SessionOriginPayloadKind string
SessionOriginPayloadKind names which payload a round-trip row exercises. It is a closed set because the two payloads carry the field independently: a row that could name an unimplemented payload would assert nothing.
const ( // SessionOriginPayloadDetail is SessionDetailPayload. SessionOriginPayloadDetail SessionOriginPayloadKind = "session_detail" // SessionOriginPayloadSummary is SessionSummary. SessionOriginPayloadSummary SessionOriginPayloadKind = "session_summary" )
func (SessionOriginPayloadKind) IsValid ¶ added in v0.1.2
func (k SessionOriginPayloadKind) IsValid() bool
IsValid reports whether k is a member of the closed payload set.
func (SessionOriginPayloadKind) String ¶ added in v0.1.2
func (k SessionOriginPayloadKind) String() string
type SessionOriginRoundTripExpectation ¶ added in v0.1.2
type SessionOriginRoundTripExpectation struct {
FieldPresent bool `json:"fieldPresent" yaml:"field_present"`
EncodedJSON string `json:"encodedJson" yaml:"encoded_json"`
Decoded string `json:"decoded" yaml:"decoded"`
Behaviour SessionOriginBehaviour `json:"behaviour" yaml:"behaviour"`
}
SessionOriginRoundTripExpectation says what the encoded payload must look like and what must survive decoding it again. FieldPresent false asserts the omitempty behaviour: the key is absent, not present and empty.
type SessionOriginRoundTripInput ¶ added in v0.1.2
type SessionOriginRoundTripInput struct {
Payload SessionOriginPayloadKind `json:"payload" yaml:"payload"`
Origin string `json:"origin" yaml:"origin"`
}
SessionOriginRoundTripInput names a payload and the origin token to encode into it.
type SessionOriginSchemaExpectation ¶ added in v0.1.2
type SessionOriginSchemaExpectation struct {
Accepted bool `json:"accepted" yaml:"accepted"`
ErrorContains string `json:"errorContains" yaml:"error_contains"`
Behaviour SessionOriginBehaviour `json:"behaviour" yaml:"behaviour"`
}
SessionOriginSchemaExpectation is the published schema's verdict on a probe.
ErrorContains is authored in the corpus as an INDEPENDENT literal and is never taken from a production message constant: a needle derived from the code under test cannot detect that code changing.
type SessionOriginSchemaProbe ¶ added in v0.1.2
type SessionOriginSchemaProbe struct {
Origin string `json:"origin" yaml:"origin"`
}
SessionOriginSchemaProbe is one token offered to the published SessionOrigin component from the generated Types document.
type SessionOriginValidityExpectation ¶ added in v0.1.2
type SessionOriginValidityExpectation struct {
Valid bool `json:"valid" yaml:"valid"`
Behaviour SessionOriginBehaviour `json:"behaviour" yaml:"behaviour"`
}
SessionOriginValidityExpectation is the verdict SessionOrigin.IsValid must return for a raw token, plus the behaviour the row contributes.
type SessionOutcome ¶
type SessionOutcome string
SessionOutcome represents the resolution status of a session.
const ( OutcomeResolved SessionOutcome = "resolved" OutcomePartial SessionOutcome = "partial" OutcomeFailed SessionOutcome = "failed" )
func (SessionOutcome) IsValid ¶
func (o SessionOutcome) IsValid() bool
IsValid returns true if the outcome is one of the known variants.
func (SessionOutcome) JSONSchema ¶
func (SessionOutcome) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SessionOutcome) String ¶
func (o SessionOutcome) String() string
type SessionPullRequest ¶ added in v0.34.0
type SessionPullRequest struct {
Owner string `json:"owner" minLength:"1"` // GitHub repository owner (user or organization) the pull request was opened against
Repo string `json:"repo" minLength:"1"` // GitHub repository name the pull request was opened against
Number int `json:"number" minimum:"1"` // pull request number within that repository
// URL is the canonical pull request address recorded in the tool call
// result. It may carry no sub-page, so it is the identity of the pull
// request rather than a link to one of its tabs.
URL string `json:"url" minLength:"1"`
// Source is an open string naming how the row was detected, so a later
// detector can be added without rewriting the rows already stored in a
// consumer's cache. The only value the contract currently defines is
// gh_pr_create: a recorded `gh pr create` invocation whose result carried a
// GitHub pull request URL. It is deliberately not a closed set: a consumer
// reads the rows it knows and does not refuse the response over a value it
// does not know, and an empty string is not a detector at all.
Source string `json:"source" minLength:"1"`
}
SessionPullRequest is one pull request detected in a stored session.
A row is detected from the session's own recorded tool calls, never from the repository's current state: it exists only when one recorded call both invokes `gh pr create` and returns a GitHub pull request URL. The answer is therefore display-only evidence of what the session did. It is not an access boundary, it never widens who may read the transcript, and nothing is posted to GitHub on the caller's behalf.
func (SessionPullRequest) Validate ¶ added in v0.34.0
func (p SessionPullRequest) Validate() error
Validate checks that the row names its repository, a positive pull request number, the canonical address, and the detector that found it. A row missing any of them cannot be shown as evidence of what the session did, and the fields cannot be recovered from one another.
type SessionPullRequestsResponse ¶ added in v0.34.0
type SessionPullRequestsResponse struct {
PullRequests []SessionPullRequest `json:"pullRequests" nullable:"false"`
// UnverifiedPullRequests is omitted when unsupported; an empty array means detection completed without evidence.
UnverifiedPullRequests *[]UnverifiedPullRequest `json:"unverified_pull_requests,omitempty" nullable:"false"`
}
SessionPullRequestsResponse is the response of GET /api/v1/sessions/{id}/pull-requests.
A stored session with no detected pull request answers an empty array, never null. An identifier that names no stored session is a 404 rather than an empty list, for the same reason the commits read distinguishes them.
func (*SessionPullRequestsResponse) UnmarshalJSON ¶ added in v0.36.0
func (r *SessionPullRequestsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON preserves omission while rejecting an explicit null array.
func (SessionPullRequestsResponse) Validate ¶ added in v0.34.0
func (r SessionPullRequestsResponse) Validate() error
Validate checks that the envelope carries an array and that every row names a pull request and the detector that found it, so an empty detection and a detection that never ran stay distinguishable.
type SessionPurpose ¶ added in v0.19.0
type SessionPurpose string
const ( SessionPurposeInteraction SessionPurpose = "interaction" SessionPurposeDelegatedWork SessionPurpose = "delegated_work" SessionPurposeHelperReview SessionPurpose = "helper_review" SessionPurposeUnknown SessionPurpose = "unknown" )
func NewSessionPurpose ¶ added in v0.19.0
func NewSessionPurpose(raw string) (SessionPurpose, error)
func (SessionPurpose) IsValid ¶ added in v0.19.0
func (v SessionPurpose) IsValid() bool
func (SessionPurpose) JSONSchema ¶ added in v0.19.0
func (SessionPurpose) JSONSchema() (jsonschema.Schema, error)
type SessionRelationship ¶ added in v0.19.0
type SessionRelationship struct {
Kind SessionRelationshipKind `json:"kind" yaml:"kind"`
TargetState RelationshipTargetState `json:"targetState" yaml:"targetState"`
TargetLocalID *SessionID `json:"targetLocalId,omitempty" yaml:"targetLocalId"`
Evidence EvidenceKind `json:"evidence" yaml:"evidence"`
Anchor *PublicSourceAnchor `json:"anchor,omitempty" yaml:"anchor"`
}
func ValidateRawRelationshipFixture ¶ added in v0.19.0
func ValidateRawRelationshipFixture(i SessionGraphRawInput) (SessionRelationship, error)
func (SessionRelationship) Validate ¶ added in v0.19.0
func (r SessionRelationship) Validate() error
type SessionRelationshipKind ¶ added in v0.19.0
type SessionRelationshipKind string
const ( SessionRelationshipStartedBy SessionRelationshipKind = "started_by" SessionRelationshipContextFrom SessionRelationshipKind = "context_from" )
func NewSessionRelationshipKind ¶ added in v0.19.0
func NewSessionRelationshipKind(raw string) (SessionRelationshipKind, error)
func (SessionRelationshipKind) IsValid ¶ added in v0.19.0
func (v SessionRelationshipKind) IsValid() bool
func (SessionRelationshipKind) JSONSchema ¶ added in v0.19.0
func (SessionRelationshipKind) JSONSchema() (jsonschema.Schema, error)
type SessionRelationshipNavigation ¶ added in v0.19.0
type SessionRelationshipNavigation struct {
}
func ValidateRawNavigationFixture ¶ added in v0.19.0
func ValidateRawNavigationFixture(i SessionGraphRawInput) (SessionRelationshipNavigation, string, error)
func (SessionRelationshipNavigation) Validate ¶ added in v0.19.0
func (n SessionRelationshipNavigation) Validate() error
type SessionRelationshipsInput ¶ added in v0.19.0
type SessionRelationshipsInput struct {
Relationships []SessionRelationship `yaml:"relationships"`
}
type SessionScorecard ¶
type SessionScorecard struct {
// Token efficiency inputs.
M2TokenOutcomeRatio *float64 `json:"m2TokenOutcomeRatio,omitempty"`
M5ContextUtilizationPct *float64 `json:"m5ContextUtilizationPct,omitempty"`
M6OutputSurvivalPct *float64 `json:"m6OutputSurvivalPct,omitempty"`
RetryTokensWasted *int `json:"retryTokensWasted,omitempty"`
TotalTokens *int `json:"totalTokens,omitempty"`
CostTotalUSD *float64 `json:"costTotalUsd,omitempty"`
// Prompt quality inputs.
SpecQualityScore *float64 `json:"specQualityScore,omitempty"`
SignalDensity *float64 `json:"signalDensity,omitempty"`
M7SpecHasExamples *bool `json:"m7SpecHasExamples,omitempty"`
M7SpecHasConstraints *bool `json:"m7SpecHasConstraints,omitempty"`
// Loop efficiency inputs.
M4ConsecutiveErrorMax *int `json:"m4ConsecutiveErrorMax,omitempty"`
WithinSessionReverts *int `json:"withinSessionReverts,omitempty"`
// Outcome echoes the session outcome so the card can apply the
// "failed outcome with above-median cost" token-efficiency trigger.
Outcome SessionOutcome `json:"outcome,omitempty"`
}
SessionScorecard holds the deterministic per-session quality signals needed by the Highlights self-assessment card. It is a flat projection of the session_metrics fields the three axis cards (token efficiency, prompt quality, loop efficiency) consume. Fields are pointers so the client can distinguish "not computed" (nil) from a real zero value when applying threshold bands.
type SessionStats ¶
type SessionStats struct {
TurnCount int `` /* 254-byte string literal not displayed */
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
ToolCallCount int `json:"toolCallCount"`
SubagentCount int `json:"subagentCount"`
DurationMs int64 `json:"durationMs"`
TokensIn int `json:"tokensIn"`
TokensOut int `json:"tokensOut"`
// ACP-aligned token breakdown (optional — not all providers report these).
ThoughtTokens *int `json:"thoughtTokens,omitempty"` // Reasoning/thinking tokens
CachedReadTokens *int `json:"cachedReadTokens,omitempty"` // Prompt cache hits
CachedWriteTokens *int `json:"cachedWriteTokens,omitempty"` // Prompt cache writes
}
SessionStats holds aggregate metrics extracted from transcript data.
type SessionSummariesByIDAnchor ¶ added in v0.1.2
type SessionSummariesByIDAnchor string
SessionSummariesByIDAnchor names one clause the by-id session-summaries operation description must state. The description is prose, so a closed set cannot be derived from it; naming each required clause makes deleting one fail here instead of quietly weakening a stated contract.
const ( // SessionSummariesByIDAnchorResolvesLinks: the operation exists to resolve // links, which is why the origin scope below does not apply to it. SessionSummariesByIDAnchorResolvesLinks SessionSummariesByIDAnchor = "resolves_links" // SessionSummariesByIDAnchorNoOriginScope: origin scope is a discovery // boundary and must not reach a by-id resolution. SessionSummariesByIDAnchorNoOriginScope SessionSummariesByIDAnchor = "no_origin_scope" // SessionSummariesByIDAnchorNoSelectionScope: the saved ingestion selection // is not a browsing scope at all, so it narrows no stored read and cannot // reach a by-id resolution either. SessionSummariesByIDAnchorNoSelectionScope SessionSummariesByIDAnchor = "no_selection_scope" // SessionSummariesByIDAnchorUnknownIDOmitted: an identifier that names no // local session is omitted rather than failing the whole batch. SessionSummariesByIDAnchorUnknownIDOmitted SessionSummariesByIDAnchor = "unknown_identifier_omitted" )
func (SessionSummariesByIDAnchor) IsValid ¶ added in v0.1.2
func (a SessionSummariesByIDAnchor) IsValid() bool
IsValid reports whether a is a member of the closed anchor set.
func (SessionSummariesByIDAnchor) String ¶ added in v0.1.2
func (a SessionSummariesByIDAnchor) String() string
type SessionSummariesByIDContract ¶ added in v0.1.2
type SessionSummariesByIDContract struct {
Path string `json:"path" yaml:"path"`
Method string `json:"method" yaml:"method"`
OperationID string `json:"operationId" yaml:"operation_id"`
QueryParameter string `json:"queryParameter" yaml:"query_parameter"`
ResponseStatus string `json:"responseStatus" yaml:"response_status"`
MediaType string `json:"mediaType" yaml:"media_type"`
ResponseRef string `json:"responseRef" yaml:"response_ref"`
DescriptionAnchors []SessionSummariesByIDDescriptionAnchor `json:"descriptionAnchors" yaml:"description_anchors"`
}
SessionSummariesByIDContract is the declared shape of the by-id session-summaries operation in the Local API document.
type SessionSummariesByIDDescriptionAnchor ¶ added in v0.1.2
type SessionSummariesByIDDescriptionAnchor struct {
Name SessionSummariesByIDAnchor `json:"name" yaml:"name"`
Text string `json:"text" yaml:"text"`
}
SessionSummariesByIDDescriptionAnchor is one required clause: its closed-set name and the literal text the published description must contain.
type SessionSummary ¶
type SessionSummary struct {
ID string `json:"id"`
Harness Harness `json:"harness"`
StartTime time.Time `json:"startTime"`
DurationMins float64 `json:"durationMins"`
TotalTokens int `json:"totalTokens"`
TurnCount int `` /* 254-byte string literal not displayed */
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// ConversationTurnCount is the number of conversation turns in the session's
// main partition (IsConversationTurn): the count a reader is shown. Absent
// means unmeasured: a producer or publication older than this field. It
// equals the segment directory's totalConversationTurns at the same revision.
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
ToolCallCount int `json:"toolCallCount"`
Project string `json:"project,omitempty"`
// ProjectHash is the opaque project identifier (projects.project_hash).
// The frontend resolves display name → hash from this field for the
// Map/Review REST endpoints (contract §9.1).
ProjectHash ProjectHash `json:"projectHash,omitempty"`
Outcome string `json:"outcome,omitempty"`
// ParentSessionID is the durable logical parent of a spawned child. It may
// name a session this store does not hold. Absent for a root or a fork.
ParentSessionID *string `json:"parentSessionId,omitempty"`
// ParentUnresolved marks a known spawned child whose parent cannot be
// named. It is never set together with ParentSessionID. A client keeps
// such a row out of the top-level list and does not invent a parent.
ParentUnresolved *bool `json:"parentUnresolved,omitempty" nullable:"false"`
RootSessionID *SessionID `json:"rootSessionId,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
// SessionOrigin is the producer's declaration of who drove this session.
// Absent when the producer expressed no opinion; see SessionOrigin for the
// rule a consumer applies to an absent or "unknown" value.
SessionOrigin SessionOrigin `json:"sessionOrigin,omitempty"`
// Preview is the raw first user message of the session, sourced from the
// already-redacted indexed transcript (session_entries.content_preview). It
// is redaction-safe by construction. Empty when the session has no indexed
// user entry. The web client formats it for display.
Preview string `json:"preview,omitempty"`
// Teammate is the Claude Code teammate identity this session was spawned
// under, present only when the stored parent transcript records spawning
// that exact identity. Ordinary subagent parentage carries no teammate
// object. Local read evidence, never published transcript content.
Teammate *SessionTeammate `json:"teammate,omitempty"`
// Owner names whose artifact this session is in the local store. An absent
// value means this server does not project owners; {"kind":"unknown"} means
// the owner is projected but withheld. It is never guessed and never falls
// back to the local holder for a pulled row.
Owner *LocalArtifactIdentity `json:"owner,omitempty" nullable:"false"`
// AdapterVersion identifies the Peasant adapter/parser that produced this
// local artifact, not the native harness release. It is omitted when
// unknown; a present revision is positive.
AdapterVersion *int `` /* 230-byte string literal not displayed */
}
SessionSummary is a session without turns, used in the sessions list.
type SessionTeammate ¶ added in v0.34.1
type SessionTeammate struct {
// Team is the recorded team name the spawn edge names. Non-empty, valid
// UTF-8, at most 256 characters (Unicode code points), and no control
// characters. The published minLength, maxLength, and pattern carry the
// same three rules; Validate applies them directly.
Team string `` /* 241-byte string literal not displayed */
// Name is the recorded teammate name the spawn edge names, under the same
// bound as Team.
Name string `` /* 245-byte string literal not displayed */
// Evidence is the kind of record the spawn edge rests on. Only
// native_dynamic_workflow is accepted.
Evidence SessionTeammateEvidence `json:"evidence"`
}
SessionTeammate is the Claude Code teammate identity of a session whose stored parent transcript records spawning that identity. It is local read evidence, never published transcript content: a session with only ordinary subagent parentage, another harness's parentage, or no recorded spawn edge carries no teammate object, so a consumer can tell the two apart.
func (*SessionTeammate) Validate ¶ added in v0.34.1
func (t *SessionTeammate) Validate() error
Validate checks that the teammate identity is present, exact, and carries the one evidence kind a recorded spawn edge produces. The identity fields carry the published 256-character bound plus the no-control-character rule.
type SessionTeammateBoundsExpectation ¶ added in v0.34.1
type SessionTeammateBoundsExpectation struct {
Valid bool `json:"valid" yaml:"valid"`
}
SessionTeammateBoundsExpectation is the verdict every layer must give.
type SessionTeammateBoundsFixtures ¶ added in v0.34.1
type SessionTeammateBoundsFixtures struct {
// Bound is the declared code-point bound. The loader requires it to equal
// SessionTeammateMaxIdentityRunes so the corpus cannot drift from the rule.
Bound int `yaml:"bound"`
// RequiredNames lists the cases that must exist.
RequiredNames []string `yaml:"required_names"`
Cases testcase.Corpus[SessionTeammateBoundsInput, SessionTeammateBoundsExpectation] `yaml:"cases"`
}
SessionTeammateBoundsFixtures is the declared identity bound and the corpus shared by the Go, JSON Schema, and generated Zod checks.
func LoadSessionTeammateBoundsFixtures ¶ added in v0.34.1
func LoadSessionTeammateBoundsFixtures() (*SessionTeammateBoundsFixtures, error)
LoadSessionTeammateBoundsFixtures parses and boundary-validates the corpus.
type SessionTeammateBoundsInput ¶ added in v0.34.1
type SessionTeammateBoundsInput struct {
Team string `json:"team" yaml:"team"`
Name string `json:"name" yaml:"name"`
Evidence string `json:"evidence" yaml:"evidence"`
CodePoints int `json:"codePoints" yaml:"code_points"`
UTF16Units int `json:"utf16Units" yaml:"utf16_units"`
}
SessionTeammateBoundsInput is one identity offered to every layer that bounds it: the team, the name, and both length measurements so the metric itself is asserted rather than assumed.
type SessionTeammateEvidence ¶ added in v0.34.1
type SessionTeammateEvidence string
SessionTeammateEvidence is the kind of record a teammate identity rests on. It is a closed set of its own rather than a member of EvidenceKind: the session-graph evidence menu is embedded in the published Village wire, so a kind that only a local read carries must not widen it for every consumer.
const ( // SessionTeammateEvidenceNativeDynamicWorkflow: the stored parent // transcript records spawning this exact team and name. SessionTeammateEvidenceNativeDynamicWorkflow SessionTeammateEvidence = "native_dynamic_workflow" )
func (SessionTeammateEvidence) IsValid ¶ added in v0.34.1
func (e SessionTeammateEvidence) IsValid() bool
IsValid reports whether e is a member of the teammate evidence menu.
func (SessionTeammateEvidence) JSONSchema ¶ added in v0.34.1
func (SessionTeammateEvidence) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SessionTeammateEvidence) String ¶ added in v0.34.1
func (e SessionTeammateEvidence) String() string
String returns the wire representation of the teammate evidence kind.
type SessionTeammateFixtures ¶ added in v0.34.1
type SessionTeammateFixtures struct {
// Component is the published component carrying the identity object.
Component string `yaml:"component"`
// EvidenceField is the property whose value must reference the closed set.
EvidenceField string `yaml:"evidence_field"`
// EvidenceComponent is the closed-set component the field must reference.
EvidenceComponent string `yaml:"evidence_component"`
// EvidenceRef is the exact $ref the field must publish.
EvidenceRef string `yaml:"evidence_ref"`
// IdentityMaxLength is the declared character bound of team and name. The
// loader requires it to equal SessionTeammateMaxIdentityRunes, so the
// contract and the Go rule cannot drift apart silently.
IdentityMaxLength int `yaml:"identity_max_length"`
// IdentityFields are the properties the published bound applies to.
IdentityFields []string `yaml:"identity_fields"`
// IdentityRequired are the members the published component must require.
IdentityRequired []string `yaml:"identity_required"`
// RequiredMenu is the declared evidence menu, compared to
// AllSessionTeammateEvidences by membership.
RequiredMenu []SessionTeammateEvidence `yaml:"required_menu"`
// SchemaProbes drives the published evidence component.
SchemaProbes testcase.Corpus[SessionTeammateSchemaProbe, SessionTeammateSchemaExpectation] `yaml:"schema_probes"`
// IdentityProbes drives the published identity object.
IdentityProbes testcase.Corpus[SessionTeammateIdentityProbe, SessionTeammateSchemaExpectation] `yaml:"identity_probes"`
}
SessionTeammateFixtures is the declared published shape of the local teammate identity: which component carries it, which closed set its evidence field references, the identity bound and required members, and the tokens and objects offered to the published component.
func LoadSessionTeammateFixtures ¶ added in v0.34.1
func LoadSessionTeammateFixtures() (*SessionTeammateFixtures, error)
LoadSessionTeammateFixtures parses the corpus and boundary-validates it. It rejects unknown fields, trailing documents, an under-populated component block, an evidence ref that does not name the declared component, a menu that disagrees with the Go closed set, a verdict inconsistent with its classification, and a refusal naming no expected fragment or a fragment that omits a menu member.
type SessionTeammateIdentityProbe ¶ added in v0.34.1
type SessionTeammateIdentityProbe struct {
Team string `json:"team" yaml:"team"`
Name string `json:"name" yaml:"name"`
Evidence string `json:"evidence" yaml:"evidence"`
}
SessionTeammateIdentityProbe is one complete identity object offered to the published SessionTeammate component, so the team, name, and evidence rules are proven together rather than one field at a time.
type SessionTeammateSchemaExpectation ¶ added in v0.34.1
type SessionTeammateSchemaExpectation struct {
Accepted bool `json:"accepted" yaml:"accepted"`
ErrorContains string `json:"errorContains" yaml:"error_contains"`
}
SessionTeammateSchemaExpectation is the published schema's verdict on a probe. ErrorContains is authored in the corpus as an independent literal, never taken from a production message constant.
type SessionTeammateSchemaProbe ¶ added in v0.34.1
type SessionTeammateSchemaProbe struct {
Evidence string `json:"evidence" yaml:"evidence"`
}
SessionTeammateSchemaProbe is one evidence token offered to the published SessionTeammateEvidence component from the generated Types document.
type SessionToCommitRate ¶ added in v0.42.0
type SessionToCommitRate struct {
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
WithCommit int `json:"withCommit" minimum:"0" maximum:"9007199254740991"`
Rate float64 `json:"rate" minimum:"0" maximum:"1"`
}
SessionToCommitRate is the session-to-commit result. Rate is WithCommit/Total in [0, 1], and 0 when no session exists.
type SessionsPayload ¶
type SessionsPayload struct {
Sessions []SessionSummary `json:"sessions"`
}
SessionsPayload is the data sent on the sessions WebSocket channel.
type ShutdownResponse ¶
type ShutdownResponse struct {
Status string `json:"status"`
}
ShutdownResponse is the JSON response for POST /api/v1/shutdown.
type SourceEntryRef ¶ added in v0.19.0
type SourceEntryRef string
func NewSourceEntryRef ¶ added in v0.19.0
func NewSourceEntryRef(raw string) (SourceEntryRef, error)
func (SourceEntryRef) JSONSchema ¶ added in v0.19.0
func (SourceEntryRef) JSONSchema() (jsonschema.Schema, error)
func (SourceEntryRef) Validate ¶ added in v0.19.0
func (v SourceEntryRef) Validate() error
type SourceFormat ¶
type SourceFormat string
SourceFormat identifies the transcript file format.
const ( SourceFormatJSONL SourceFormat = "jsonl" // Claude Code JSONL transcripts SourceFormatJSON SourceFormat = "json" // OpenCode JSON transcripts )
func (SourceFormat) IsValid ¶
func (f SourceFormat) IsValid() bool
IsValid returns true if the SourceFormat is one of the known variants.
func (SourceFormat) JSONSchema ¶
func (SourceFormat) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SourceFormat) String ¶
func (f SourceFormat) String() string
type SourceInfo ¶
type SourceInfo struct {
FilePath string `json:"filePath,omitempty"` // Original source transcript path
Format SourceFormat `json:"format"` // "jsonl" or "json"
}
SourceInfo identifies the original transcript file and its format.
type StopReason ¶
type StopReason string
StopReason represents why a session or turn ended. ACP per-turn stop reasons; content-layer type for future use.
const ( StopReasonEndTurn StopReason = "end_turn" StopReasonCancelled StopReason = "cancelled" StopReasonMaxTokens StopReason = "max_tokens" StopReasonMaxTurnRequests StopReason = "max_turn_requests" StopReasonRefusal StopReason = "refusal" )
func (StopReason) IsValid ¶
func (r StopReason) IsValid() bool
IsValid returns true if the stop reason is one of the known variants.
func (StopReason) JSONSchema ¶
func (StopReason) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (StopReason) String ¶
func (r StopReason) String() string
type SubagentRef ¶
type SubagentRef struct {
SessionID SessionID `json:"sessionId"`
ParentUUID SessionID `json:"parentUuid"`
}
SubagentRef records a reference to a subagent session spawned during a parent session.
type SubmissionRef ¶ added in v0.19.0
type SubmissionRef string
func NewSubmissionRef ¶ added in v0.19.0
func NewSubmissionRef(raw string) (SubmissionRef, error)
func (SubmissionRef) JSONSchema ¶ added in v0.19.0
func (SubmissionRef) JSONSchema() (jsonschema.Schema, error)
func (SubmissionRef) Validate ¶ added in v0.19.0
func (v SubmissionRef) Validate() error
type SubscriptionValidationCase ¶
type SubscriptionValidationCase struct {
Name string `yaml:"name"`
Topic string `yaml:"topic"`
Axis string `yaml:"axis,omitempty"`
ID string `yaml:"id,omitempty"`
Valid bool `yaml:"valid"`
}
SubscriptionValidationCase is a test case for ValidateSubscription.
type SyncAuthResponse ¶ added in v0.25.0
type SyncAuthResponse struct {
Authenticated bool `json:"authenticated"`
// Username, VillageURL, and VillageConfigured are present only when
// Authenticated is true.
Username string `json:"username,omitempty"`
VillageURL string `json:"villageUrl,omitempty"`
VillageConfigured bool `json:"villageConfigured,omitempty"`
}
SyncAuthResponse is the response of GET /api/v1/sync/auth: whether this computer holds a valid Village credential.
func (SyncAuthResponse) Validate ¶ added in v0.25.0
func (r SyncAuthResponse) Validate() error
Validate checks that a signed-out response names no account.
type SyncHoldReason ¶ added in v0.25.0
type SyncHoldReason string
SyncHoldReason says why a held session cannot be published yet.
const ( // SyncHoldReasonMetricsMissing: the session has no computed metrics yet. SyncHoldReasonMetricsMissing SyncHoldReason = "metrics_missing" // SyncHoldReasonMetadataMissing: the session's publication metadata is not // ready, so the capture and the index do not agree yet. SyncHoldReasonMetadataMissing SyncHoldReason = "metadata_missing" )
func (SyncHoldReason) IsValid ¶ added in v0.25.0
func (r SyncHoldReason) IsValid() bool
func (SyncHoldReason) JSONSchema ¶ added in v0.25.0
func (SyncHoldReason) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncHoldReason) String ¶ added in v0.25.0
func (r SyncHoldReason) String() string
type SyncLoginResponse ¶ added in v0.25.0
type SyncLoginResponse struct {
Status SyncLoginStatus `json:"status"`
}
SyncLoginResponse is the response of POST /api/v1/sync/login.
func (SyncLoginResponse) Validate ¶ added in v0.25.0
func (r SyncLoginResponse) Validate() error
Validate checks the sign-in result.
type SyncLoginStatus ¶ added in v0.25.0
type SyncLoginStatus string
SyncLoginStatus is the result of POST /api/v1/sync/login.
const ( // SyncLoginPending: the browser sign-in started; poll /api/v1/sync/auth. SyncLoginPending SyncLoginStatus = "pending" // SyncLoginAlreadyAuthenticated: this computer is already signed in. SyncLoginAlreadyAuthenticated SyncLoginStatus = "already_authenticated" )
func (SyncLoginStatus) IsValid ¶ added in v0.25.0
func (s SyncLoginStatus) IsValid() bool
func (SyncLoginStatus) JSONSchema ¶ added in v0.25.0
func (SyncLoginStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncLoginStatus) String ¶ added in v0.25.0
func (s SyncLoginStatus) String() string
type SyncLogoutResponse ¶ added in v0.25.0
type SyncLogoutResponse struct {
Status SyncLogoutStatus `json:"status"`
}
SyncLogoutResponse is the response of POST /api/v1/sync/logout.
func (SyncLogoutResponse) Validate ¶ added in v0.25.0
func (r SyncLogoutResponse) Validate() error
Validate checks the sign-out result.
type SyncLogoutStatus ¶ added in v0.25.0
type SyncLogoutStatus string
SyncLogoutStatus is the result of POST /api/v1/sync/logout.
const ( // SyncLogoutLoggedOut: the stored Village credential was removed. SyncLogoutLoggedOut SyncLogoutStatus = "logged_out" // SyncLogoutAlreadyLoggedOut: this computer held no Village credential. SyncLogoutAlreadyLoggedOut SyncLogoutStatus = "already_logged_out" )
func (SyncLogoutStatus) IsValid ¶ added in v0.25.0
func (s SyncLogoutStatus) IsValid() bool
func (SyncLogoutStatus) JSONSchema ¶ added in v0.25.0
func (SyncLogoutStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncLogoutStatus) String ¶ added in v0.25.0
func (s SyncLogoutStatus) String() string
type SyncPushCollectives ¶ added in v0.25.0
type SyncPushCollectives struct {
Add []VillageUUID `json:"add,omitempty" nullable:"false" description:"Collectives to share the published transcripts with"`
Remove []VillageUUID `json:"remove,omitempty" nullable:"false" description:"Collectives to take the published transcripts back from"`
}
SyncPushCollectives names the collectives one push adds and removes. Add shares each published transcript with the collective; remove takes it back. Collectives named in neither list keep their current access.
type SyncPushRequest ¶ added in v0.25.0
type SyncPushRequest struct {
SessionIDs []string `json:"sessionIds" nullable:"false" minItems:"1" description:"Local sessions to publish or update"`
// RedactionLevel is a request for a level. Omission lets the server resolve
// its configured default; the server refuses a level it does not offer.
RedactionLevel string `json:"redactionLevel,omitempty" description:"Requested redaction level; omit to use the configured default"`
Collectives *SyncPushCollectives `json:"collectives,omitempty" nullable:"false" description:"Audience changes; omit to keep each transcript's current audience"`
}
SyncPushRequest is the body of POST /api/v1/sync/push. Publishing is collectives only: the request carries no visibility and no license, and the server applies no default license to a publish that names collectives.
func (SyncPushRequest) Validate ¶ added in v0.25.0
func (r SyncPushRequest) Validate() error
Validate checks the session list and that no collective is both added and removed.
type SyncPushResponse ¶ added in v0.25.0
type SyncPushResponse struct {
New int `json:"new" minimum:"0"`
Updated int `json:"updated" minimum:"0"`
Skipped int `json:"skipped" minimum:"0"`
Errors int `json:"errors" minimum:"0"`
Sessions []SyncPushSessionResult `json:"sessions" nullable:"false"`
}
SyncPushResponse is the response of POST /api/v1/sync/push: the counts the push already returned plus one result per session. New, Updated, Skipped, and Errors count the sessions with that status; held sessions are not counted.
func (SyncPushResponse) Validate ¶ added in v0.25.0
func (r SyncPushResponse) Validate() error
Validate checks the counts and every session result.
type SyncPushSessionResult ¶ added in v0.25.0
type SyncPushSessionResult struct {
SessionID string `json:"sessionId"`
// Status is the session's outcome. It describes the content: new or
// updated when Village accepted it, skipped when it was already current
// (also when only collectives changed), held when it cannot be published
// yet, and error when any step failed or the session failed before,
// between, or after its steps ran, for example while recording Village's
// receipt on this computer. The response counts tally sessions by this status.
Status SyncPushSessionStatus `json:"status"`
Error string `json:"error,omitempty"`
Title string `json:"title,omitempty"`
// TranscriptURL is the Village page of the session's transcript. Every
// session whose content step succeeded carries it.
TranscriptURL string `json:"transcriptUrl,omitempty"`
// Steps lists every step the push planned for this session, in the order
// it ran them. When present, the content step comes first: skipped when
// the content was already current or the session is held.
Steps []SyncPushStepResult `json:"steps,omitempty" nullable:"false"`
// WaitingPullRequests are the caller's Village prompt requests that wait
// for a transcript from this session's repository.
WaitingPullRequests []VillagePromptRequest `json:"waitingPullRequests,omitempty" nullable:"false"`
}
SyncPushSessionResult is the result for one session in a push.
func (SyncPushSessionResult) Validate ¶ added in v0.25.0
func (r SyncPushSessionResult) Validate() error
Validate checks one session result, its steps, and how the status follows from them. Steps start with the content step. A failed step makes the session an error. New and updated sessions have a succeeded content step, and any session whose content Village accepted carries a transcript URL. Skipped and held sessions have a skipped content step, and a held session can only take a transcript back from collectives or skip a share. A step is not_attempted after an earlier step failed, or in an error session, which is how a failure between steps is reported. Whether a later step still runs after a failure is the producer's choice, so taking a collective back is never forced to wait on an unrelated failure.
type SyncPushSessionStatus ¶ added in v0.25.0
type SyncPushSessionStatus string
SyncPushSessionStatus is the outcome of one session in a push.
const ( SyncPushSessionNew SyncPushSessionStatus = "new" SyncPushSessionUpdated SyncPushSessionStatus = "updated" SyncPushSessionSkipped SyncPushSessionStatus = "skipped" SyncPushSessionError SyncPushSessionStatus = "error" SyncPushSessionHeld SyncPushSessionStatus = "held" )
func (SyncPushSessionStatus) IsValid ¶ added in v0.25.0
func (s SyncPushSessionStatus) IsValid() bool
func (SyncPushSessionStatus) JSONSchema ¶ added in v0.25.0
func (SyncPushSessionStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncPushSessionStatus) String ¶ added in v0.25.0
func (s SyncPushSessionStatus) String() string
type SyncPushStep ¶ added in v0.25.0
type SyncPushStep string
SyncPushStep is one step a push runs for a session: the content step, then one step per collective added or removed.
const ( // SyncPushStepContent sends the redacted transcript to Village. SyncPushStepContent SyncPushStep = "content" // SyncPushStepAddCollective shares the transcript with one collective. SyncPushStepAddCollective SyncPushStep = "add_collective" // SyncPushStepRemoveCollective takes the transcript back from one collective. SyncPushStepRemoveCollective SyncPushStep = "remove_collective" )
func (SyncPushStep) IsValid ¶ added in v0.25.0
func (s SyncPushStep) IsValid() bool
func (SyncPushStep) JSONSchema ¶ added in v0.25.0
func (SyncPushStep) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncPushStep) String ¶ added in v0.25.0
func (s SyncPushStep) String() string
type SyncPushStepOutcome ¶ added in v0.25.0
type SyncPushStepOutcome string
SyncPushStepOutcome is the result of one push step.
const ( // SyncPushStepSucceeded: Village applied the step. SyncPushStepSucceeded SyncPushStepOutcome = "succeeded" // SyncPushStepPendingApproval: the collective holds the share until its // owner approves it. Only an add_collective step has this outcome. SyncPushStepPendingApproval SyncPushStepOutcome = "pending_approval" // SyncPushStepSkipped: the step was not needed or not allowed, for example // a collective that already holds the transcript. It is not a failure and // carries its reason. SyncPushStepSkipped SyncPushStepOutcome = "skipped" // SyncPushStepFailed: the step failed, Village keeps what it had for it, and // the step carries its reason. SyncPushStepFailed SyncPushStepOutcome = "failed" // SyncPushStepNotAttempted: the step did not run because an earlier step of // the same session failed. SyncPushStepNotAttempted SyncPushStepOutcome = "not_attempted" )
func (SyncPushStepOutcome) IsValid ¶ added in v0.25.0
func (o SyncPushStepOutcome) IsValid() bool
func (SyncPushStepOutcome) JSONSchema ¶ added in v0.25.0
func (SyncPushStepOutcome) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncPushStepOutcome) String ¶ added in v0.25.0
func (o SyncPushStepOutcome) String() string
type SyncPushStepResult ¶ added in v0.25.0
type SyncPushStepResult struct {
Step SyncPushStep `json:"step"`
// CollectiveID names the collective of an add_collective or
// remove_collective step. The content step has none.
CollectiveID *VillageUUID `json:"collectiveId,omitempty" nullable:"false"`
Outcome SyncPushStepOutcome `json:"outcome"`
// Reason says why a skipped or failed step did not apply. No other outcome
// carries one.
Reason string `json:"reason,omitempty"`
}
SyncPushStepResult is the result of one step for one session.
func (SyncPushStepResult) Validate ¶ added in v0.25.0
func (r SyncPushStepResult) Validate() error
Validate checks the step, its collective, and the outcome pairing.
type SyncRedactionCategoryGroup ¶ added in v0.25.0
type SyncRedactionCategoryGroup struct {
Category string `json:"category"`
TotalCount int `json:"totalCount" minimum:"0"`
Rules []SyncRedactionRuleGroup `json:"rules" nullable:"false"`
}
SyncRedactionCategoryGroup holds the rule groups of one category.
type SyncRedactionItem ¶ added in v0.25.0
type SyncRedactionItem struct {
// Category is the redaction engine's category label, rendered verbatim.
Category string `json:"category"`
RuleID string `json:"ruleId"`
RuleDisplayName string `json:"ruleDisplayName"`
OriginalText string `json:"originalText"`
RedactedReplacement string `json:"redactedReplacement"`
Description string `json:"description"`
LineNumber int `json:"lineNumber" minimum:"0"`
// EntryIndex is the TurnDetail.index of the turn that shows the match, so
// a client can name and open the turn without projecting entries itself. A
// match in a tool call's arguments or result names the turn that owns the
// tool call, and ToolCallID names the call. One item stands for every
// occurrence of the same text under the same rule, and EntryIndex names the
// first. It is absent when the match lies outside every turn, for example
// in session metadata.
EntryIndex *int `json:"entryIndex,omitempty" minimum:"0" nullable:"false"`
// ToolCallID is the ToolCallDetail.id of the tool call that holds the
// match, present only when the match lies in a tool call.
ToolCallID string `json:"toolCallId,omitempty"`
ContextBefore []string `json:"contextBefore" nullable:"false"`
ContextAfter []string `json:"contextAfter" nullable:"false"`
}
SyncRedactionItem is one redaction match in the preview of what leaves the machine.
type SyncRedactionRuleGroup ¶ added in v0.25.0
type SyncRedactionRuleGroup struct {
RuleID string `json:"ruleId"`
DisplayName string `json:"displayName"`
Count int `json:"count" minimum:"0"`
Items []SyncRedactionItem `json:"items" nullable:"false"`
}
SyncRedactionRuleGroup holds the deduplicated matches of one rule. Items is capped by the server, so it can hold fewer entries than Count.
type SyncRedactionsResponse ¶ added in v0.25.0
type SyncRedactionsResponse struct {
Total int `json:"total" minimum:"0"`
Categories []SyncRedactionCategoryGroup `json:"categories" nullable:"false"`
}
SyncRedactionsResponse is the response of GET /api/v1/sync/redactions. Total counts every raw match; the groups count deduplicated matches.
func (SyncRedactionsResponse) Validate ¶ added in v0.25.0
func (r SyncRedactionsResponse) Validate() error
Validate checks the counts, the item cap, and that each item sits in the category and rule group that holds it.
type SyncStatus ¶ added in v0.25.0
type SyncStatus string
SyncStatus is the publication status the local sync chooser shows for one listed session. The server decides it; a client displays it and never infers a status from a row that is absent from the response.
const ( // SyncStatusNew: the session has no recorded publication. SyncStatusNew SyncStatus = "new" // SyncStatusUpdated: the session changed after its last publication. SyncStatusUpdated SyncStatus = "updated" // SyncStatusSynced: the last publication carries the current content. SyncStatusSynced SyncStatus = "synced" // SyncStatusHeld: the session cannot be published until ingest completes. // A held row always names its hold reason. SyncStatusHeld SyncStatus = "held" )
func (SyncStatus) IsValid ¶ added in v0.25.0
func (s SyncStatus) IsValid() bool
func (SyncStatus) JSONSchema ¶ added in v0.25.0
func (SyncStatus) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (SyncStatus) String ¶ added in v0.25.0
func (s SyncStatus) String() string
type TargetKind ¶
type TargetKind string
TargetKind identifies which of an annotation's six target arms is populated: session, transcript entry, annotation, project, file_version, or association. The file_version arm identifies one repository-relative file at one content hash; the association arm identifies a durable association ID.
const ( TargetSession TargetKind = "session" TargetEntry TargetKind = "entry" // turn, tool call, tool result TargetAnnotation TargetKind = "annotation" // meta-annotation TargetProject TargetKind = "project" // project-level annotation TargetFileVersion TargetKind = "file_version" TargetAssociation TargetKind = "association" )
func (TargetKind) IsValid ¶
func (k TargetKind) IsValid() bool
IsValid returns true if the target kind is one of the known variants.
func (TargetKind) JSONSchema ¶
func (TargetKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TargetKind) String ¶
func (k TargetKind) String() string
type TaskSummary ¶
type TaskSummary struct {
SessionID string `json:"sessionId"`
EntryIndex int `json:"entryIndex"` // depth-0 user-turn entry index (task identity)
Title string `json:"title"` // first words of the user turn, <=80 chars
StartMs *int64 `json:"startMs,omitempty"`
Outcome string `json:"outcome,omitempty"` // session-level outcome
EditedFiles []string `json:"editedFiles"`
ReadCount int `json:"readCount"`
// ReadFiles is the per-file derivation of ReadCount: repo-relative paths,
// sorted, distinct, non-nil, mirroring
// EditedFiles' invariants. Retroactively recoverable for any already-
// ingested session with at least one depth-1 tool_use entry carrying
// non-NULL tool_input (see MapNode.ReadAttribution for the honest
// residual-gap signal when it is not).
ReadFiles []string `json:"readFiles" required:"true" nullable:"false"`
RetryLoop bool `json:"retryLoop"` // an error streak >=2 occurs inside this task's range
Labels []string `json:"labels"` // effective auto/manual annotation values, plain strings
}
TaskSummary is one task: a depth-0 user turn and everything until the next user turn (spec §2 "Task", v1 grain).
func NewTaskSummary ¶
func NewTaskSummary(sessionID string, entryIndex int) TaskSummary
NewTaskSummary returns a TaskSummary with all slices initialized to empty (never-nil marshal guarantee).
func (TaskSummary) Validate ¶
func (t TaskSummary) Validate() error
Validate checks TaskSummary's ReadFiles invariant: non-nil, sorted ascending, and free of duplicates (mirroring the invariants EditedFiles is already expected to carry).
type TaxonomyFamilyNode ¶
type TaxonomyFamilyNode struct {
Family string `json:"family"`
Types []AnnotationTypeSummary `json:"types"`
}
TaxonomyFamilyNode represents a family node with its associated annotation types.
type TaxonomyNode ¶
type TaxonomyNode struct {
Class string `json:"class"`
Families []TaxonomyFamilyNode `json:"families"`
}
TaxonomyNode represents a class node in the class > family > type taxonomy tree.
type ThinkingLevel ¶ added in v0.29.0
type ThinkingLevel string
ThinkingLevel is the canonical reasoning-effort level recorded for assistant output. The set is closed. Absence means unknown; "off" is the single disabled state; "ultra" is above "max", and "ultracode" is a distinct level. Native harness spellings are mapping inputs, never wire values: a native spelling that differs from the canonical value travels as ThinkingLevelRaw.
const ( ThinkingLevelOff ThinkingLevel = "off" ThinkingLevelMinimal ThinkingLevel = "minimal" ThinkingLevelLow ThinkingLevel = "low" ThinkingLevelMedium ThinkingLevel = "medium" ThinkingLevelHigh ThinkingLevel = "high" ThinkingLevelXHigh ThinkingLevel = "xhigh" ThinkingLevelMax ThinkingLevel = "max" ThinkingLevelUltra ThinkingLevel = "ultra" ThinkingLevelUltracode ThinkingLevel = "ultracode" )
func (ThinkingLevel) IsValid ¶ added in v0.29.0
func (v ThinkingLevel) IsValid() bool
IsValid reports whether v is absent ("") or a member of AllThinkingLevels.
func (ThinkingLevel) JSONSchema ¶ added in v0.29.0
func (ThinkingLevel) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ThinkingLevel) String ¶ added in v0.29.0
func (v ThinkingLevel) String() string
String returns the canonical level spelling.
type ThinkingLevelChange ¶ added in v0.29.0
type ThinkingLevelChange struct {
Level ThinkingLevel `json:"level,omitempty"`
Raw ThinkingLevelRaw `json:"raw,omitempty"`
}
ThinkingLevelChange is one in-session thinking-level change observed after the session seed. A session keeps its first value in thinkingLevel/thinkingLevelRaw and records each later change here, in source order, with consecutive duplicates collapsed. At least one of level or raw must be present: level may be empty only when raw carries the exact native spelling. Raw follows the same bounded rule as the session seed.
func (ThinkingLevelChange) IsValid ¶ added in v0.29.0
func (c ThinkingLevelChange) IsValid() bool
IsValid reports whether the change satisfies the history-entry rule. The generic raw-shape decoder calls it for each element of thinkingLevelHistory.
func (ThinkingLevelChange) PrepareJSONSchema ¶ added in v0.29.0
func (ThinkingLevelChange) PrepareJSONSchema(s *jsonschema.Schema) error
PrepareJSONSchema adds the at-least-one-field rule to the generated history entry shape, so the published JSON Schema (and the TypeScript runtime schema derived from it) refuse an empty entry exactly as Validate does. A struct cannot express this cross-field presence rule on its own.
func (ThinkingLevelChange) Validate ¶ added in v0.29.0
func (c ThinkingLevelChange) Validate() error
Validate enforces the history-entry rule and returns an actionable error.
type ThinkingLevelRaw ¶ added in v0.29.0
type ThinkingLevelRaw string
ThinkingLevelRaw is the exact native level spelling observed when it differs from the emitted canonical value (including when none could be mapped). Source evidence, never a canonical value; non-level evidence (e.g. a numeric budget) is never raw. Non-empty, valid UTF-8, <=128 encoded bytes, no edge Unicode White_Space.
func NewThinkingLevelRaw ¶ added in v0.29.0
func NewThinkingLevelRaw(raw string) (ThinkingLevelRaw, error)
NewThinkingLevelRaw validates and constructs a ThinkingLevelRaw. Accepted bytes are preserved exactly; nothing is trimmed or normalized.
func (ThinkingLevelRaw) IsValid ¶ added in v0.29.0
func (v ThinkingLevelRaw) IsValid() bool
IsValid reports whether v satisfies the raw rule. The empty string is not a valid raw value; omit the field instead.
func (ThinkingLevelRaw) JSONSchema ¶ added in v0.29.0
func (ThinkingLevelRaw) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ThinkingLevelRaw) String ¶ added in v0.29.0
func (v ThinkingLevelRaw) String() string
String returns the exact native spelling.
func (ThinkingLevelRaw) Validate ¶ added in v0.29.0
func (v ThinkingLevelRaw) Validate() error
Validate returns the actionable constructor error for an invalid raw value.
type TimelineFixtureCase ¶
type TimelineFixtureCase struct {
Family string `json:"family" yaml:"family"`
Name string `json:"name" yaml:"name"`
Input TimelineFixtureInput `json:"input" yaml:"input"`
Expected TimelineFixtureExpected `json:"expected" yaml:"expected"`
Classification testcase.Classification `json:"classification" yaml:"classification"`
Provenance testcase.Provenance `json:"provenance" yaml:"provenance"`
Mutation testcase.Mutation `json:"mutation" yaml:"mutation"`
}
TimelineFixtureCase is one public relationship case. Family is the stable behavioral identity; Name remains the executable testcase identity.
type TimelineFixtureCorpus ¶
type TimelineFixtureCorpus struct {
Cases []TimelineFixtureCase `json:"cases" yaml:"cases"`
SuccessorAssociationMirrorCases []TimelineFixtureCase `json:"successorAssociationMirrorCases" yaml:"successorAssociationMirrorCases"`
}
TimelineFixtureCorpus is the project Git timeline validation corpus.
func LoadTimelineFixtures ¶
func LoadTimelineFixtures() (TimelineFixtureCorpus, error)
LoadTimelineFixtures parses and validates the shared public timeline corpus.
func (TimelineFixtureCorpus) CheckMin ¶
func (c TimelineFixtureCorpus) CheckMin(minimum int) error
CheckMin rejects a timeline corpus smaller than the required behavioral floor.
type TimelineFixtureExpected ¶
type TimelineFixtureExpected struct {
ErrorContains string `json:"errorContains,omitempty" yaml:"error_contains"`
Repair *timelineFixtureRepair `json:"repair,omitempty" yaml:"repair,omitempty"`
}
TimelineFixtureExpected records the validation error for a rejected input. A must-pass case leaves ErrorContains empty.
type TimelineFixtureInput ¶
type TimelineFixtureInput struct {
Sessions []TimelineSessionRef `json:"sessions" yaml:"sessions"`
Commits []CommitRef `json:"commits" yaml:"commits"`
RewrittenCommits []RewrittenCommit `json:"rewrittenCommits,omitempty" yaml:"rewrittenCommits,omitempty"`
}
TimelineFixtureInput is one normalized session and commit relationship.
type TimelineSessionRef ¶
type TimelineSessionRef struct {
SessionID SessionID `json:"sessionId" yaml:"sessionId"`
Title string `json:"title" yaml:"title"`
Harness Harness `json:"harness" yaml:"harness"`
StartMs *int64 `json:"startMs,omitempty" yaml:"startMs,omitempty"`
HasCommitBinding bool `json:"hasCommitBinding" yaml:"hasCommitBinding"`
}
TimelineSessionRef is identity and display metadata for a recorded session available to the project timeline. Producers order these references by known startMs descending, then sessionId ascending; missing startMs follows every known timestamp and is likewise ordered by sessionId. HasCommitBinding is computed from the complete authoritative session_commits relation, not merely the bounded default-branch commit window returned alongside it. CommitRef.SessionIDs names bindings that are visible inside that window.
type TimestampInfo ¶
type TimestampInfo struct {
Start int64 `json:"start"` // Unix millis
End int64 `json:"end"` // Unix millis
Ingested *int64 `json:"ingested,omitempty"` // Unix millis; nil if not yet ingested
}
TimestampInfo records session timing in Unix milliseconds.
type TokenUsageDetail ¶ added in v0.16.0
type TokenUsageDetail struct {
Input *int64 `json:"input,omitempty"`
Output *int64 `json:"output,omitempty"`
CacheRead *int64 `json:"cacheRead,omitempty"`
CacheWrite *int64 `json:"cacheWrite,omitempty"`
CacheWrite1h *int64 `json:"cacheWrite1h,omitempty"`
Reasoning *int64 `json:"reasoning,omitempty"`
TotalTokens *int64 `json:"totalTokens,omitempty"`
}
type ToolCallDetail ¶
type ToolCallDetail struct {
ID string `json:"id"`
Name string `json:"name"`
// Namespace is independent source evidence, including a present empty string.
// Omission means not recorded; producers preserve the exact redacted value.
Namespace *string `json:"namespace,omitempty" nullable:"false"`
Arguments string `json:"arguments"`
Result string `json:"result"`
DurationMs *int `json:"durationMs,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
FilePath string `json:"filePath,omitempty"`
IsError bool `json:"isError,omitempty"`
ToolKind ToolCallKind `json:"toolKind,omitempty"`
CallEntryRef SourceEntryRef `json:"callEntryRef,omitempty"`
ResultEntryRef SourceEntryRef `json:"resultEntryRef,omitempty"`
CallProvenance *ContentProvenance `json:"callProvenance,omitempty"`
ResultProvenance *ContentProvenance `json:"resultProvenance,omitempty"`
Usage *UsageDetail `json:"usage,omitempty"`
}
ToolCallDetail is a tool call in the detail view.
type ToolCallKind ¶
type ToolCallKind string
ToolCallKind classifies a tool call in an agent session. Aligns with ACP's ToolCallUpdate.kind — enables ExplorationRatio without heuristic parsing.
const ( ToolCallKindRead ToolCallKind = "read" ToolCallKindEdit ToolCallKind = "edit" ToolCallKindDelete ToolCallKind = "delete" ToolCallKindMove ToolCallKind = "move" ToolCallKindSearch ToolCallKind = "search" ToolCallKindExecute ToolCallKind = "execute" ToolCallKindThink ToolCallKind = "think" ToolCallKindFetch ToolCallKind = "fetch" ToolCallKindOther ToolCallKind = "other" )
func (ToolCallKind) IsValid ¶
func (k ToolCallKind) IsValid() bool
IsValid returns true if the tool call kind is one of the known variants.
func (ToolCallKind) JSONSchema ¶
func (ToolCallKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ToolCallKind) String ¶
func (k ToolCallKind) String() string
type TranscriptCaptureError ¶ added in v0.62.0
type TranscriptCaptureError struct {
Refusal TranscriptCaptureRefusal
Turn int
Err error
}
TranscriptCaptureError is every refusal NewTranscriptCookTurns returns. Turn is the stored position of the refusing turn, or -1 when the refusal is about the document. Err carries the full actionable message.
func (*TranscriptCaptureError) Error ¶ added in v0.62.0
func (e *TranscriptCaptureError) Error() string
func (*TranscriptCaptureError) Unwrap ¶ added in v0.62.0
func (e *TranscriptCaptureError) Unwrap() error
Unwrap returns the underlying message error.
type TranscriptCaptureRefusal ¶ added in v0.62.0
type TranscriptCaptureRefusal string
TranscriptCaptureRefusal classifies why NewTranscriptCookTurns refused a served session detail. It is a Go-only classification: it has no wire form.
const ( // TranscriptCaptureDocumentInvalid: the input is not exactly one valid // UTF-8 JSON value, or it nests deeper than 10,000 levels anywhere. TranscriptCaptureDocumentInvalid TranscriptCaptureRefusal = "document-invalid" // TranscriptCaptureDocumentNotObject: the root is valid JSON but not an object. TranscriptCaptureDocumentNotObject TranscriptCaptureRefusal = "document-not-object" // TranscriptCaptureDocumentDuplicateMember: two root members share a decoded name. TranscriptCaptureDocumentDuplicateMember TranscriptCaptureRefusal = "document-duplicate-member" // TranscriptCaptureDocumentEnvelope: the root has a sessionDetail member. TranscriptCaptureDocumentEnvelope TranscriptCaptureRefusal = "document-envelope" // TranscriptCaptureTurnsNotArray: turns is present and neither null nor an array. TranscriptCaptureTurnsNotArray TranscriptCaptureRefusal = "turns-not-array" // TranscriptCaptureTurnUnicodeEscape: a turn holds an unpaired or invalid // surrogate \u escape. TranscriptCaptureTurnUnicodeEscape TranscriptCaptureRefusal = "turn-unicode-escape" // TranscriptCaptureTurnDuplicateMember: an object in a turn repeats a decoded name. TranscriptCaptureTurnDuplicateMember TranscriptCaptureRefusal = "turn-duplicate-member" // TranscriptCaptureTurnNotObject: a turn is not a JSON object. TranscriptCaptureTurnNotObject TranscriptCaptureRefusal = "turn-not-object" // TranscriptCaptureTurnTypeMismatch: a turn cannot be decoded as a TurnDetail. TranscriptCaptureTurnTypeMismatch TranscriptCaptureRefusal = "turn-type-mismatch" )
func (TranscriptCaptureRefusal) IsValid ¶ added in v0.62.0
func (v TranscriptCaptureRefusal) IsValid() bool
IsValid reports whether v is a capture refusal.
type TranscriptContent ¶
type TranscriptContent struct {
ContractVersion PushContractVersion `json:"contractVersion"`
Kind ContentKind `json:"kind"`
SessionDetail *SessionDetailPayload `json:"sessionDetail,omitempty"`
}
TranscriptContent is the versioned, self-describing wire body that `peasant push` uploads in place of raw provider JSONL. The village decodes this envelope (migrate-on-read for legacy/older blobs) and renders SessionDetail.
VERSION CONFLICT-WINNER: a TranscriptContent envelope carries TWO version markers — the envelope's ContractVersion and the embedded SessionDetailPayload.SchemaVersion. They are emitted IN LOCKSTROKE by peasant (both equal defaults.PublishSchemaVersion). If a decoder ever observes them to DISAGREE (e.g. a hand-edited or partially-migrated blob), the ENVELOPE's ContractVersion WINS and is authoritative for migrate-on-read dispatch; the embedded SchemaVersion is advisory and exists so a SessionDetailPayload extracted and stored on its OWN (outside any envelope) remains self-describing. The village ContentMigrator MUST honor this same rule.
Served by Village (GET /api/v1/transcripts/{id}/content), the envelope follows the public owner rule: when the transcript's owner is anonymous to the viewer, Village serves SessionDetail without its repository identity, leaving project, workingDirectory, gitBranch, gitRemote and every childSessions[].project absent. Peasant's own reads of SessionDetailPayload are unchanged. The response carries no owner, so no validator here can pair the two; Village enforces and tests it on the server. Text inside the conversation is content and is not covered by this rule.
func DecodeTranscriptContentRaw ¶ added in v0.16.0
func DecodeTranscriptContentRaw(raw []byte) (TranscriptContent, error)
func DecodeTranscriptContentRawWithPolicy ¶ added in v0.54.0
func DecodeTranscriptContentRawWithPolicy(raw []byte, policy TranscriptContentReadPolicy) (TranscriptContent, error)
DecodeTranscriptContentRawWithPolicy scans an envelope under policy before applying the same shape and semantic validation as the source reader.
type TranscriptContentHash ¶
type TranscriptContentHash string
TranscriptContentHash is the SHA3-256 digest of the exact transcript file bytes.
func ComputeTranscriptContentHash ¶
func ComputeTranscriptContentHash(content []byte) TranscriptContentHash
func NewTranscriptContentHash ¶
func NewTranscriptContentHash(raw string) (TranscriptContentHash, error)
func (TranscriptContentHash) JSONSchema ¶
func (TranscriptContentHash) JSONSchema() (jsonschema.Schema, error)
func (TranscriptContentHash) String ¶
func (v TranscriptContentHash) String() string
func (TranscriptContentHash) Validate ¶
func (v TranscriptContentHash) Validate() error
type TranscriptContentHashWord ¶ added in v0.54.0
type TranscriptContentHashWord string
TranscriptContentHashWord distinguishes a pending hash from a known one in the header's revalidation inputs.
const ( TranscriptContentHashPending TranscriptContentHashWord = "pending" TranscriptContentHashKnown TranscriptContentHashWord = "known" )
func (TranscriptContentHashWord) IsValid ¶ added in v0.54.0
func (v TranscriptContentHashWord) IsValid() bool
type TranscriptContentHeader ¶ added in v0.54.0
type TranscriptContentHeader struct {
ContractVersion PushContractVersion `json:"contractVersion"`
Kind ContentKind `json:"kind"`
Revision string `json:"revision"`
Representation string `json:"representation"`
ContentHash string `json:"contentHash,omitempty"`
SessionHeader TranscriptSessionHeader `json:"sessionHeader"`
Canonical bool `json:"canonical"`
OmittedImages int `json:"omittedImages"`
// FlaggedTurns are ascending, unique served positions. Turn is present if
// and only if the associated row has a usable recorded index.
FlaggedTurns []TranscriptFlaggedTurn `json:"flaggedTurns,omitempty"`
RetainedEvidence *TranscriptRetainedState `json:"retainedEvidence,omitempty"`
}
TranscriptContentHeader is a bounded read of envelope and session metadata.
func (TranscriptContentHeader) Validate ¶ added in v0.54.0
func (h TranscriptContentHeader) Validate() error
Validate checks the envelope facts and its canonical-harness claim.
type TranscriptContentReadPolicy ¶ added in v0.54.0
type TranscriptContentReadPolicy = RawJSONPathPolicy
TranscriptContentReadPolicy is the raw scanner policy used by content reads.
type TranscriptCookTurn ¶ added in v0.54.0
type TranscriptCookTurn struct {
// contains filtered or unexported fields
}
TranscriptCookTurn pairs one served turn's original bytes with its own decoded value. The cooking rule uses the exact-name member view, not detail. Construct turns with NewTranscriptCookTurns; the zero value is not a turn.
func NewTranscriptCookTurns ¶ added in v0.54.0
func NewTranscriptCookTurns(sessionDetail json.RawMessage) ([]TranscriptCookTurn, error)
NewTranscriptCookTurns captures one served session detail's turns in stored order. It never unwraps an envelope and never pairs two separate decodes. Every refusal is a *TranscriptCaptureError.
The call makes one private copy of the turns array. Every returned turn's bytes and member view are slices of that copy, so retaining any one turn keeps the whole copy alive. The caller's buffer is never aliased.
func (TranscriptCookTurn) Detail ¶ added in v0.54.0
func (t TranscriptCookTurn) Detail() TurnDetail
Detail returns the value decoded from the same turn bytes for a host index.
func (TranscriptCookTurn) Facts ¶ added in v0.62.0
func (t TranscriptCookTurn) Facts() TranscriptCookTurnFacts
Facts returns the turn's index facts without copying its TurnDetail.
func (TranscriptCookTurn) Raw ¶ added in v0.54.0
func (t TranscriptCookTurn) Raw() TranscriptServedTurn
Raw returns the preserved turn object for the segment writer.
func (TranscriptCookTurn) RecordedIndex ¶ added in v0.62.0
func (t TranscriptCookTurn) RecordedIndex() (TranscriptRecordedIndexState, *int)
RecordedIndex reads the turn's recorded index from the member view the capture already holds. It applies the same rule as DecodeTranscriptRecordedIndex on the turn's bytes and gives the same result.
type TranscriptCookTurnFacts ¶ added in v0.62.0
type TranscriptCookTurnFacts struct {
Index int
Role Role
EntryType EntryType
Depth int
// UsagePresent reports a usage record on the turn or on any tool call.
UsagePresent bool
// ConversationTurn is IsConversationTurn(Role, EntryType, Depth).
ConversationTurn bool
// ByteLength is TranscriptTurnByteLength(Detail()), the cut's measure.
ByteLength int
}
TranscriptCookTurnFacts are the per-turn values a partition index keeps. Each equals the value Detail() gives: Index, Role, EntryType and Depth come from the typed, case-insensitive decode, not from the exact-name members.
type TranscriptDownloadKind ¶ added in v0.54.0
type TranscriptDownloadKind string
TranscriptDownloadKind identifies the dispatch of one authorized body.
const ( TranscriptDownloadStrict TranscriptDownloadKind = "strict" TranscriptDownloadLegacy TranscriptDownloadKind = "legacy" TranscriptDownloadRecords TranscriptDownloadKind = "records" )
type TranscriptDownloadRead ¶ added in v0.54.0
type TranscriptDownloadRead struct {
Kind TranscriptDownloadKind
Detail json.RawMessage
Records []json.RawMessage
}
TranscriptDownloadRead contains the served detail bytes or raw JSONL records.
func DecodeTranscriptDownloadRaw ¶ added in v0.54.0
func DecodeTranscriptDownloadRaw(raw []byte) (TranscriptDownloadRead, error)
DecodeTranscriptDownloadRaw scans and dispatches an authorized content body. Typed validation gates strict content but never replaces the served bytes.
type TranscriptEntryHit ¶ added in v0.54.0
type TranscriptEntryHit struct {
Position int
Kind TranscriptEntryReferenceKind
RecordedIndex *int
}
TranscriptEntryHit is a scan finding. Position is its index in the served rows and Kind identifies the exact member that held the reference.
func LocateTranscriptEntry ¶ added in v0.54.0
func LocateTranscriptEntry(rows []TranscriptEntryScanRow, reference string) (TranscriptEntryHit, bool, error)
LocateTranscriptEntry searches served main-partition rows in order, reading each row's original bytes by decoded exact member name. Within a row it checks sourceEntryRef, then each tool call's callEntryRef and resultEntryRef. A missing match is not an error. The reference must be non-empty.
type TranscriptEntryLocateRequest ¶ added in v0.54.0
type TranscriptEntryLocateRequest struct {
Reference string `json:"reference" minLength:"1"`
Revision string `json:"revision"`
Representation string `json:"representation"`
ContentHash string `json:"contentHash"`
}
TranscriptEntryLocateRequest identifies a reference and the expected read epoch. It contains neither a location kind nor a partition selector.
type TranscriptEntryMatch ¶ added in v0.54.0
type TranscriptEntryMatch struct {
Context TranscriptReadContext `json:"context"`
Kind TranscriptEntryReferenceKind `json:"kind"`
Position int `json:"position"`
SegmentOrdinal int `json:"segmentOrdinal"`
RecordedIndex *int `json:"recordedIndex,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
}
TranscriptEntryMatch reports a location without carrying the reference. RecordedIndex is present only when the matched row has a recorded index.
type TranscriptEntryReferenceKind ¶ added in v0.54.0
type TranscriptEntryReferenceKind string
TranscriptEntryReferenceKind identifies the member holding a located entry. It describes the finding, not the boundary kind carried by a link.
const ( TranscriptEntryReferenceSource TranscriptEntryReferenceKind = "source" TranscriptEntryReferenceToolCall TranscriptEntryReferenceKind = "tool_call" TranscriptEntryReferenceToolResult TranscriptEntryReferenceKind = "tool_result" )
func (TranscriptEntryReferenceKind) IsValid ¶ added in v0.54.0
func (v TranscriptEntryReferenceKind) IsValid() bool
func (TranscriptEntryReferenceKind) JSONSchema ¶ added in v0.54.0
func (TranscriptEntryReferenceKind) JSONSchema() (jsonschema.Schema, error)
type TranscriptEntryScanRow ¶ added in v0.54.0
type TranscriptEntryScanRow struct {
Turn TranscriptCookTurn
State TranscriptRecordedIndexState
Recorded *int // non-nil exactly when State is TranscriptRecordedIndexPresent
}
TranscriptEntryScanRow is one served main-partition row and the recorded index pair computed by the same pass that captured its turn.
type TranscriptFlaggedTurn ¶ added in v0.54.0
type TranscriptFlaggedTurn struct {
Position int `json:"position" minimum:"0"`
Turn *int `json:"turn,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
}
TranscriptFlaggedTurn marks a served main-partition position. Turn is the recorded index only when the row carries a usable index; an absent Turn asserts the position without making a recorded-identity claim.
type TranscriptHistorySection ¶ added in v0.54.0
type TranscriptHistorySection struct {
Index int `json:"index"`
State string `json:"state,omitempty"`
TotalTurns int `json:"totalTurns"`
TotalConversationTurns *int `json:"totalConversationTurns,omitempty"`
UsagePresent TranscriptUsagePresence `json:"usagePresent"`
}
TranscriptHistorySection holds one history section's manifest facts.
type TranscriptID ¶
type TranscriptID string
TranscriptID is a validated village-side transcript identifier. The village generates a UUID per published transcript (the same value carried in PublishResponse.TranscriptID); the pull surface keys off it. Newtype over string so the identifier flows typed across the pull pipeline, mirroring the SessionID/ProjectHash precedent.
func NewTranscriptID ¶
func NewTranscriptID(raw string) (TranscriptID, error)
NewTranscriptID validates and constructs a TranscriptID. The input must be a canonical lowercase-hex UUID; anything else is rejected so a pasted URL slug, truncated id, or path-bearing string never reaches the filesystem layout ({villageHost}/{transcriptId}/...).
func (TranscriptID) JSONSchema ¶
func (TranscriptID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TranscriptID) String ¶
func (t TranscriptID) String() string
type TranscriptNativePresence ¶ added in v0.54.0
type TranscriptNativePresence string
TranscriptNativePresence states whether native records exist or are withheld.
const ( TranscriptNativeAbsent TranscriptNativePresence = "absent" TranscriptNativePresent TranscriptNativePresence = "present" TranscriptNativeWithheld TranscriptNativePresence = "withheld" )
func (TranscriptNativePresence) IsValid ¶ added in v0.54.0
func (v TranscriptNativePresence) IsValid() bool
func (TranscriptNativePresence) JSONSchema ¶ added in v0.54.0
func (TranscriptNativePresence) JSONSchema() (jsonschema.Schema, error)
type TranscriptPageOutline ¶ added in v0.67.0
type TranscriptPageOutline struct {
SessionID SessionID `json:"sessionId"`
Revision string `json:"revision" minLength:"1"`
Representation string `json:"representation" minLength:"1"`
Rows []TurnOutlineRow `json:"rows" nullable:"false"`
HasMore bool `json:"hasMore"`
}
TranscriptPageOutline is the zero-blob first-paint page-1 turn outline response for a stored local session.
func (TranscriptPageOutline) Validate ¶ added in v0.67.0
func (o TranscriptPageOutline) Validate() error
Validate checks the outline's session identity, coherence tokens, and rows.
type TranscriptReadContext ¶ added in v0.54.0
type TranscriptReadContext struct {
// ProtocolVersion identifies the declared protocol that produced this
// body. It must match the selected positioned protocol, not merely any
// version the host declares. A reader must refuse a mismatched echo.
ProtocolVersion string `` /* 234-byte string literal not displayed */
Transport TranscriptReadTransport `json:"transport"`
ContentSessionID *string `json:"contentSessionId,omitempty"`
Revision string `json:"revision"`
Representation string `json:"representation"`
Harness *string `json:"harness,omitempty" nullable:"false"`
Model string `json:"model,omitempty"`
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
Validation TranscriptReadValidation `json:"validation"`
NativePresence TranscriptNativePresence `json:"nativePresence"`
TotalTurns int `json:"totalTurns"`
TotalSegments int `json:"totalSegments"`
TotalConversationTurns *int `json:"totalConversationTurns,omitempty"`
ContentHash string `json:"contentHash,omitempty"`
}
TranscriptReadContext carries the authorized facts repeated on each read.
func (TranscriptReadContext) Validate ¶ added in v0.54.0
func (c TranscriptReadContext) Validate() error
Validate checks the context's route, identity, closed facts, and counts.
type TranscriptReadTransport ¶ added in v0.54.0
type TranscriptReadTransport struct {
Kind TranscriptReadTransportKind `json:"kind"`
SessionID *SessionID `json:"sessionId,omitempty"`
TranscriptID *VillageUUID `json:"transcriptId,omitempty"`
}
TranscriptReadTransport names exactly one route identity. A content session identifier is not a route identity and is carried separately in the context.
func (TranscriptReadTransport) Validate ¶ added in v0.54.0
func (t TranscriptReadTransport) Validate() error
Validate refuses a missing, ambiguous, mismatched, or malformed route identity.
type TranscriptReadTransportKind ¶ added in v0.54.0
type TranscriptReadTransportKind string
TranscriptReadTransportKind identifies the host-owned route identity.
const ( TranscriptReadTransportLocalSession TranscriptReadTransportKind = "local_session" TranscriptReadTransportVillageTranscript TranscriptReadTransportKind = "village_transcript" )
func (TranscriptReadTransportKind) IsValid ¶ added in v0.54.0
func (v TranscriptReadTransportKind) IsValid() bool
func (TranscriptReadTransportKind) JSONSchema ¶ added in v0.54.0
func (TranscriptReadTransportKind) JSONSchema() (jsonschema.Schema, error)
type TranscriptReadValidation ¶ added in v0.54.0
type TranscriptReadValidation string
TranscriptReadValidation describes the boundary that accepted the served body.
const ( TranscriptReadPublishedStrict TranscriptReadValidation = "published_strict" TranscriptReadServedLegacy TranscriptReadValidation = "served_legacy" TranscriptReadMigrated TranscriptReadValidation = "migrated" )
func (TranscriptReadValidation) IsValid ¶ added in v0.54.0
func (v TranscriptReadValidation) IsValid() bool
func (TranscriptReadValidation) JSONSchema ¶ added in v0.54.0
func (TranscriptReadValidation) JSONSchema() (jsonschema.Schema, error)
type TranscriptRecordedIndexState ¶ added in v0.54.0
type TranscriptRecordedIndexState string
TranscriptRecordedIndexState describes whether a served turn carries a usable recorded index. An index is not a position in the served partition.
const ( TranscriptRecordedIndexPresent TranscriptRecordedIndexState = "present" TranscriptRecordedIndexAbsent TranscriptRecordedIndexState = "absent" TranscriptRecordedIndexInvalid TranscriptRecordedIndexState = "invalid" )
func DecodeTranscriptRecordedIndex ¶ added in v0.54.0
func DecodeTranscriptRecordedIndex(turn TranscriptServedTurn) (TranscriptRecordedIndexState, *int)
DecodeTranscriptRecordedIndex reads the recorded index without fabricating a value for an absent or invalid member. The accepted range is the nonnegative JavaScript-safe integer range that the platform's int can also represent.
func (TranscriptRecordedIndexState) IsValid ¶ added in v0.54.0
func (v TranscriptRecordedIndexState) IsValid() bool
IsValid reports whether v is a recorded-index state.
func (TranscriptRecordedIndexState) JSONSchema ¶ added in v0.54.0
func (TranscriptRecordedIndexState) JSONSchema() (jsonschema.Schema, error)
JSONSchema publishes the recorded-index state set.
type TranscriptRepresentationInputs ¶ added in v0.54.0
type TranscriptRepresentationInputs struct {
RepresentationVersion string
CutVersion string
Revision string
Validation TranscriptReadValidation
Harness string
ModelProvider string
ContractVersion PushContractVersion
ViewerProjection TranscriptViewerProjection
RepositoryWithheld bool
NativePresence TranscriptNativePresence
}
TranscriptRepresentationInputs are the facts determining a served projection. Harness is the spelling in the served detail, or empty when absent. Declaration order is part of the derivation.
type TranscriptRetainedOwnerVisibility ¶ added in v0.54.0
type TranscriptRetainedOwnerVisibility string
TranscriptRetainedOwnerVisibility states whether evidence availability may be disclosed to this viewer.
const ( TranscriptRetainedOwnerVisible TranscriptRetainedOwnerVisibility = "visible" TranscriptRetainedOwnerWithheld TranscriptRetainedOwnerVisibility = "withheld" )
func (TranscriptRetainedOwnerVisibility) IsValid ¶ added in v0.54.0
func (v TranscriptRetainedOwnerVisibility) IsValid() bool
type TranscriptRetainedState ¶ added in v0.54.0
type TranscriptRetainedState string
TranscriptRetainedState describes evidence withheld from the bounded header.
const ( TranscriptRetainedAbsent TranscriptRetainedState = "absent" TranscriptRetainedDeferred TranscriptRetainedState = "deferred" )
func (TranscriptRetainedState) IsValid ¶ added in v0.54.0
func (v TranscriptRetainedState) IsValid() bool
func (TranscriptRetainedState) JSONSchema ¶ added in v0.54.0
func (TranscriptRetainedState) JSONSchema() (jsonschema.Schema, error)
type TranscriptSegment ¶ added in v0.42.0
type TranscriptSegment struct {
// Index is the segment ordinal, 0..totalSegments-1. It is not a turn identity.
Index int `json:"index" minimum:"0" maximum:"9007199254740991"`
Revision string `json:"revision" minLength:"1"`
// FirstTurn and LastTurn are the closed range of sparse turn identities this
// segment covers.
FirstTurn int `json:"firstTurn" minimum:"0" maximum:"9007199254740991"`
LastTurn int `json:"lastTurn" minimum:"0" maximum:"9007199254740991"`
// ByteLength is the sum of the served turns' ByteLength values: the
// pre-bound size of their content plus every toolCalls[].arguments and
// toolCalls[].result. It is not the marshalled size of the bounded rows; the
// served bytes are at most this total, and the per-turn value is what the
// truncation notice names.
ByteLength int `json:"byteLength" minimum:"0" maximum:"9007199254740991"`
// HasOlder and HasNewer say whether a boundary is drawn on that side. HasOlder
// is index > 0; HasNewer is index < totalSegments-1. They are redundant with
// the directory by design: a segment is renderable alone. A segment cannot
// know the total, so the producer checks HasNewer with the directory
// (ValidateTranscriptSegmentBoundaries).
HasOlder bool `json:"hasOlder"`
HasNewer bool `json:"hasNewer"`
Turns []TranscriptTurn `json:"turns" nullable:"false"`
}
TranscriptSegment is one segment's turn content and its own facts. It is the transport unit of the transcript: at most the segment budget, or one oversized entry alone, so no response on the transcript path carries more than one segment's turns.
func (TranscriptSegment) Validate ¶ added in v0.42.0
func (s TranscriptSegment) Validate() error
Validate checks that the segment's declared range is the exact range its turns occupy and that its declared byte length is the sum of the turn rows' byte lengths. A segment that declares a range or size its turns do not carry would silently shift every later boundary, so it is rejected rather than repaired.
type TranscriptSegmentDirectory ¶ added in v0.42.0
type TranscriptSegmentDirectory struct {
SessionID SessionID `json:"sessionId"`
// Revision is the store revision the directory was cut under, as a decimal
// string. A segment from a different revision must not be placed beside it.
Revision string `json:"revision" minLength:"1"`
// TotalTurns is the number of turns the session's main partition holds. It is
// a count, never an ordinal: no position is derived from it.
TotalTurns int `json:"totalTurns" minimum:"0" maximum:"9007199254740991"`
// TotalConversationTurns is the number of conversation turns in the session's
// main partition (IsConversationTurn). It is the total a position is stated
// against, and the whole-session value on every page of refs. A producer that
// cannot vouch for its position data omits it with every ref's
// conversationTurns. Absence is never zero.
TotalConversationTurns *int `json:"totalConversationTurns,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
// TotalSegments is the true number of segments, even when this read serves one
// page of them.
TotalSegments int `json:"totalSegments" minimum:"0" maximum:"9007199254740991"`
Segments []TranscriptSegmentRef `json:"segments" nullable:"false"`
// DirectoryPage and DirectoryPerPage are set only when TotalSegments exceeds
// MaxTranscriptDirectoryRefs; the read then serves one page of refs.
DirectoryPage *int `json:"directoryPage,omitempty" minimum:"1" maximum:"9007199254740991" nullable:"false"`
DirectoryPerPage *int `json:"directoryPerPage,omitempty" minimum:"1" maximum:"9007199254740991" nullable:"false"`
}
TranscriptSegmentDirectory is the transcript's global index: one ref per segment, in segment order, with the cut's scalars and no turn content. It is the only global index on the transcript path, so a client never receives a per-turn row to find its place.
func (TranscriptSegmentDirectory) Validate ¶ added in v0.42.0
func (d TranscriptSegmentDirectory) Validate() error
Validate checks the directory's ordering, extent, and page cap. The refs must be contiguous in segment ordinal, ascending in turn identity, and non-overlapping, because a viewer merges adjacent segments by their declared ranges.
type TranscriptSegmentPartition ¶ added in v0.54.0
type TranscriptSegmentPartition struct {
Kind TranscriptSegmentPartitionKind `json:"kind"`
SectionIndex *int `json:"sectionIndex,omitempty"`
}
TranscriptSegmentPartition identifies a main partition or a history section.
func (TranscriptSegmentPartition) Validate ¶ added in v0.54.0
func (p TranscriptSegmentPartition) Validate() error
type TranscriptSegmentPartitionKind ¶ added in v0.54.0
type TranscriptSegmentPartitionKind string
TranscriptSegmentPartitionKind distinguishes main and earlier history.
const ( TranscriptPartitionMain TranscriptSegmentPartitionKind = "main" TranscriptPartitionHistory TranscriptSegmentPartitionKind = "history" )
func (TranscriptSegmentPartitionKind) IsValid ¶ added in v0.54.0
func (v TranscriptSegmentPartitionKind) IsValid() bool
func (TranscriptSegmentPartitionKind) JSONSchema ¶ added in v0.54.0
func (TranscriptSegmentPartitionKind) JSONSchema() (jsonschema.Schema, error)
type TranscriptSegmentRef ¶ added in v0.42.0
type TranscriptSegmentRef struct {
Index int `json:"index" minimum:"0" maximum:"9007199254740991"`
FirstTurn int `json:"firstTurn" minimum:"0" maximum:"9007199254740991"`
LastTurn int `json:"lastTurn" minimum:"0" maximum:"9007199254740991"`
ByteLength int `json:"byteLength" minimum:"0" maximum:"9007199254740991"`
// ConversationTurns is where this segment sits in the session's conversation
// turns. No arithmetic converts firstTurn or lastTurn into it.
ConversationTurns *ConversationTurnSpan `json:"conversationTurns,omitempty" nullable:"false"`
}
TranscriptSegmentRef is one segment's extent in the directory: its own ordinal and the closed range of sparse turn identities it holds. The ordinal is a segment namespace; firstTurn and lastTurn are turn identities, and no arithmetic converts one into the other.
func CutTranscriptCookTurns ¶ added in v0.62.0
func CutTranscriptCookTurns(turns []TranscriptCookTurn, verdicts []CookedTurn, budget int) ([]TranscriptSegmentRef, error)
CutTranscriptCookTurns cuts the kept turns of one cooked partition, in stored order, with the rule of CutTranscriptSegments. verdicts is the CookTranscriptRows result for the same turns. The refs equal CutTranscriptSegments over the kept turns' Detail values.
func CutTranscriptSegments ¶ added in v0.51.0
func CutTranscriptSegments(turns []TurnDetail, budget int) []TranscriptSegmentRef
CutTranscriptSegments cuts a session's turns, in order, into segment refs. A turn is appended whole or deferred; a turn larger than budget is alone in its segment. The function never splits a turn, so it never splits an entry or a user turn. Each ref's ByteLength is the sum of its turns' TranscriptTurnByteLength, and each ref carries ConversationTurns (IsConversationTurn): Before is the session-wide count of conversation turns in the earlier segments, so no directory page restarts it. Two servers that cut the same turns with the same budget produce the same refs. No turns give an empty, non-nil slice. Preview segments are capture-local and need not match the later stored cut.
type TranscriptSegmentRow ¶ added in v0.54.0
type TranscriptSegmentRow struct {
Position int `json:"position" minimum:"0"`
RecordedIndexState TranscriptRecordedIndexState `json:"recordedIndexState"`
RecordedIndex *int `json:"recordedIndex,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
DisplayNumber string `json:"displayNumber,omitempty" minLength:"1" pattern:"^[1-9][0-9]*[a-z]*$"`
ResumeBoundary EarlierHistoryState `json:"resumeBoundary,omitempty"`
SubagentStubs []TurnOutlineSubagentStub `json:"subagentStubs,omitempty" nullable:"false"`
Turn TranscriptServedTurn `json:"turn"`
}
TranscriptSegmentRow holds one served row. Turn is the source JSON object; recordedIndexState and recordedIndex are its only recorded-index statement.
func (TranscriptSegmentRow) MarshalJSON ¶ added in v0.54.0
func (TranscriptSegmentRow) MarshalJSON() ([]byte, error)
func (TranscriptSegmentRow) Validate ¶ added in v0.54.0
func (r TranscriptSegmentRow) Validate() error
type TranscriptServedTurn ¶ added in v0.54.0
type TranscriptServedTurn struct {
// contains filtered or unexported fields
}
TranscriptServedTurn holds one served turn's JSON object without interpreting or rewriting it. The row's recorded-index state and value are the only statement of its recorded index.
func NewTranscriptServedTurn ¶ added in v0.54.0
func NewTranscriptServedTurn(raw []byte) (TranscriptServedTurn, error)
NewTranscriptServedTurn copies one complete, valid UTF-8 JSON object. Other JSON values are refused because a segment row must carry a turn object.
func (TranscriptServedTurn) JSONSchema ¶ added in v0.54.0
func (TranscriptServedTurn) JSONSchema() (jsonschema.Schema, error)
JSONSchema publishes an open object. Its index can be absent or invalid on a legacy turn, so it cannot use TurnDetail's required integer schema.
func (TranscriptServedTurn) MarshalJSON ¶ added in v0.54.0
func (t TranscriptServedTurn) MarshalJSON() ([]byte, error)
MarshalJSON returns a copy of the stored bytes when called directly. A positioned segment must use MarshalPositionedSegment: encoding/json compacts nested marshaler output and does not preserve those bytes.
func (TranscriptServedTurn) Raw ¶ added in v0.54.0
func (t TranscriptServedTurn) Raw() []byte
Raw returns a copy of the retained turn bytes.
func (*TranscriptServedTurn) UnmarshalJSON ¶ added in v0.54.0
func (t *TranscriptServedTurn) UnmarshalJSON(raw []byte) error
UnmarshalJSON copies the bytes of one turn object.
type TranscriptSessionHeader ¶ added in v0.54.0
type TranscriptSessionHeader struct {
SchemaVersion PushContractVersion `json:"schemaVersion,omitempty"`
ID *string `json:"id,omitempty" nullable:"false"`
Harness *string `json:"harness,omitempty" nullable:"false"`
// Timestamps retain the served spelling, even if it cannot be re-encoded
// by time.Time. They make no claim that the value is a usable instant.
StartTime *string `json:"startTime,omitempty" nullable:"false"`
EndTime *string `json:"endTime,omitempty" nullable:"false"`
DurationMins *float64 `json:"durationMins,omitempty" nullable:"false"`
// Integer counters retain served values. JavaScript numbers may round values
// outside the safe-integer range, so Zod cannot check their exact original
// int64 lexemes. Go's constructor and served bytes are authoritative.
// Readers treat unsafe counts as unknown: never display them as exact or use
// them for ordering or totals.
TotalTokens *int `json:"totalTokens,omitempty" nullable:"false"`
TokensIn *int `json:"tokensIn,omitempty" nullable:"false"`
TokensOut *int `json:"tokensOut,omitempty" nullable:"false"`
TurnCount *int `` /* 281-byte string literal not displayed */
InputSubmissionCount *int64 `json:"inputSubmissionCount,omitempty" nullable:"false"`
ConversationTurnCount *int64 `json:"conversationTurnCount,omitempty" nullable:"false"`
ToolCallCount *int `json:"toolCallCount,omitempty" nullable:"false"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
Project string `json:"project,omitempty"`
Model string `json:"model,omitempty"`
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
ThinkingLevelHistory []ThinkingLevelChange `json:"thinkingLevelHistory,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
GitBranch string `json:"gitBranch,omitempty"`
GitRemote string `json:"gitRemote,omitempty"`
ParentSessionID *string `json:"parentSessionId,omitempty" nullable:"false"`
RootSessionID *string `json:"rootSessionId,omitempty" nullable:"false"`
Purpose string `json:"purpose,omitempty"`
// EarlierHistory contains the string states actually stated by sections, in
// order. It is not positional and its length is not a section count.
EarlierHistory []string `json:"earlierHistory,omitempty" nullable:"false"`
Outcome string `json:"outcome,omitempty"`
SessionOrigin string `json:"sessionOrigin,omitempty"`
}
TranscriptSessionHeader is the bounded metadata projection of the served session detail. It excludes nested records and preserves the absence of source members which would otherwise acquire a typed zero value.
func NewTranscriptSessionHeader ¶ added in v0.54.0
func NewTranscriptSessionHeader(sessionDetail json.RawMessage) (TranscriptSessionHeader, error)
NewTranscriptSessionHeader projects the served sessionDetail object, using exact decoded member names. It must not be passed an envelope or a typed re-encoding of the served document.
func WithholdSessionHeaderRepository ¶ added in v0.54.0
func WithholdSessionHeaderRepository(h TranscriptSessionHeader) TranscriptSessionHeader
WithholdSessionHeaderRepository omits repository identity from a header.
type TranscriptTurn ¶ added in v0.42.0
type TranscriptTurn struct {
TurnDetail
// Truncated reports that this turn's own text was bounded by the served-text
// bound. ByteLength is the pre-bound size of content plus every
// toolCalls[].arguments and toolCalls[].result: the size the turn had before
// the bound was applied, so the truncation notice can name what the full read
// will return. A segment's ByteLength is the sum of these values; the served
// bytes of a truncated turn are at most its ByteLength.
Truncated bool `json:"truncated"`
ByteLength int `json:"byteLength" minimum:"0" maximum:"9007199254740991"`
// DisplayNumber is the optional display label computed by CookTranscriptRows
// over the whole stored partition, never over one segment's turns. When any
// turn in a segment carries one, every served turn in that segment carries
// one, and a consumer shows it as given.
DisplayNumber string `` /* 348-byte string literal not displayed */
}
TranscriptTurn is one served turn: the single TurnDetail definition plus the read's own facts. Nothing is copied flat, so a segment and the single-turn continuation read share one projection and one truncation story.
type TranscriptUpdateLicense ¶
type TranscriptUpdateLicense string
TranscriptUpdateLicense is the license value the owner update operation accepts: any license on the canonical License menu, PLUS the empty string, which CLEARS the license.
The empty string is a real member of this operation's value set rather than a missing value, and that is the whole point of the type: it is what lets a caller distinguish "do not touch the license" (omit the field entirely) from "remove the license" (send ""). Collapsing the two would make the irrevocability rule below unexpressible.
Clearing is NOT always permitted. A license that was actually granted can never be cleared, because a Creative Commons grant is irrevocable for anyone who already received the work, so an un-license would misrepresent the legal state. The server refuses that with 400. Clearing a transcript that was never licensed is an accepted no-op, and replacing one menu license with a different one stays allowed.
const TranscriptUpdateLicenseClear TranscriptUpdateLicense = ""
TranscriptUpdateLicenseClear is the value that clears the license. It is spelled as a named constant so callers express the intent rather than an unexplained empty string.
func (TranscriptUpdateLicense) IsValid ¶
func (l TranscriptUpdateLicense) IsValid() bool
IsValid reports whether the value is either the clear sentinel or a license on the canonical menu. It derives the menu from AllLicenses rather than repeating it, so widening the license menu widens this operation automatically.
func (TranscriptUpdateLicense) JSONSchema ¶
func (TranscriptUpdateLicense) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TranscriptUpdateLicense) String ¶
func (l TranscriptUpdateLicense) String() string
type TranscriptUpdateRequest ¶
type TranscriptUpdateRequest struct {
// Title replaces the transcript title when non-nil. The bound mirrors the
// storage column, which is VARCHAR(500) and is enforced by nothing else on
// the way in: an over-long title reaches the database and surfaces as an
// opaque server error rather than a refusal naming the limit. Declaring it
// lets a client catch the problem before it sends the request.
//
// The two limits count differently, and the difference is recorded here
// rather than discovered later. The column counts CODE POINTS; a JavaScript
// validator generated from this bound counts UTF-16 CODE UNITS, so an astral
// character costs two there and one in the column. The direction is the safe
// one: a JavaScript count is never smaller than the code-point count, so
// nothing this bound accepts can be rejected by the column. The cost is at
// the other end, where a title of more than 250 astral characters is refused
// client-side though the column would take it. That band was judged worth
// the far commoner case of an ordinary over-long title turning into a caught
// validation error instead of an opaque server failure.
Title *string `json:"title,omitempty" maxLength:"500"`
// Description replaces the transcript description when non-nil.
Description *string `json:"description,omitempty"`
// Visibility replaces the access level when non-nil.
Visibility *TranscriptUpdateVisibility `json:"visibility,omitempty"`
// License preserves when nil, clears when it points at the clear sentinel,
// and replaces when it points at a canonical menu license.
License *TranscriptUpdateLicense `json:"license,omitempty"`
}
TranscriptUpdateRequest is the body of PATCH /api/v1/transcripts/{id}.
Every field is a pointer and every field is optional, because omission is meaningful: a nil field means "leave this unchanged", NOT "set this to the zero value". Title and Description are therefore settable to the empty string (a caller pointing at "" clears the text) without that being confusable with omitting them.
License carries the third state described on TranscriptUpdateLicense: nil preserves, a pointer to the clear sentinel removes, and a pointer to a menu value replaces.
JSON null is REFUSED on every field, and the refusal is the point. A caller reaching for null almost always means "clear this", but the village decodes a null into the same nil pointer an omitted field produces, so null would silently mean PRESERVE - the opposite of the obvious reading, on exactly the fields where clearing is what a caller wants. Rather than declare that trap, this contract rejects null and gives each intent its own unambiguous spelling: omit the field to leave it unchanged, and send the empty string to clear a title, a description, or a license. This is a deliberate narrowing of what the village tolerates, in the same spirit as the visibility menu: the contract never promises behavior the server lacks, it only declines to bless a spelling whose meaning would surprise the caller.
Unknown fields are refused for the same reason. The village accepts and silently discards a "tags" field, so a client that sent tags would receive a success and believe they applied; refusing the field turns that silent no-op into an actionable error.
func (*TranscriptUpdateRequest) UnmarshalJSON ¶
func (r *TranscriptUpdateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes an owner-update body at the trust boundary, refusing two things the permissive default would wave through: an unknown field, and an explicit null.
Both refusals exist because the alternative is a SILENT wrong answer rather than a loud one. An unknown field (notably "tags", which the village decodes and discards) would otherwise be dropped and reported as success. An explicit null would otherwise decode to the same nil pointer an omitted field produces, so a caller who sent null meaning "clear this" would get "leave it unchanged" and no indication anything was ignored.
func (TranscriptUpdateRequest) Validate ¶
func (r TranscriptUpdateRequest) Validate() error
type TranscriptUpdateVisibility ¶
type TranscriptUpdateVisibility string
TranscriptUpdateVisibility is the closed set of visibility values the owner update operation accepts.
It is deliberately NARROWER than the general Visibility enum. Visibility carries a third member for organization-scoped access, which this operation does not declare: organization visibility is a deferred capability, not merely an unimplemented one, so declaring it here would publish deferred scope into the contract and advertise a value a client cannot successfully send. The general Visibility enum is unchanged; only what THIS operation declares is constrained.
const ( // TranscriptUpdateVisibilityPrivate restricts the transcript to its owner. TranscriptUpdateVisibilityPrivate TranscriptUpdateVisibility = "private" // TranscriptUpdateVisibilityPublic makes the transcript openly readable. TranscriptUpdateVisibilityPublic TranscriptUpdateVisibility = "public" )
func (TranscriptUpdateVisibility) IsValid ¶
func (v TranscriptUpdateVisibility) IsValid() bool
IsValid reports whether the value is one of the accepted variants.
func (TranscriptUpdateVisibility) JSONSchema ¶
func (TranscriptUpdateVisibility) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TranscriptUpdateVisibility) String ¶
func (v TranscriptUpdateVisibility) String() string
type TranscriptUsagePresence ¶ added in v0.54.0
type TranscriptUsagePresence string
TranscriptUsagePresence states a partition's usage evidence availability.
const ( TranscriptUsagePresent TranscriptUsagePresence = "present" TranscriptUsageEmpty TranscriptUsagePresence = "empty" TranscriptUsageUnknown TranscriptUsagePresence = "unknown" )
func (TranscriptUsagePresence) IsValid ¶ added in v0.54.0
func (v TranscriptUsagePresence) IsValid() bool
func (TranscriptUsagePresence) JSONSchema ¶ added in v0.54.0
func (TranscriptUsagePresence) JSONSchema() (jsonschema.Schema, error)
type TranscriptViewerProjection ¶ added in v0.54.0
type TranscriptViewerProjection string
TranscriptViewerProjection is the viewer class used for a projection, not an access-control decision.
const ( TranscriptViewerProjectionAnonymous TranscriptViewerProjection = "anonymous" TranscriptViewerProjectionAuthenticated TranscriptViewerProjection = "authenticated" )
func (TranscriptViewerProjection) IsValid ¶ added in v0.54.0
func (v TranscriptViewerProjection) IsValid() bool
func (TranscriptViewerProjection) JSONSchema ¶ added in v0.54.0
func (TranscriptViewerProjection) JSONSchema() (jsonschema.Schema, error)
type TranscriptWindow ¶ added in v0.42.0
type TranscriptWindow struct {
SessionID SessionID `json:"sessionId"`
Revision string `json:"revision" minLength:"1"`
// RequestedAnchor is the turn identity the caller asked for. It differs from
// AnchorTurn when the read snapped to a user turn, and the viewer says so.
RequestedAnchor int `json:"requestedAnchor" minimum:"0" maximum:"9007199254740991"`
// AnchorTurn is the resolved user turn the window is centred on. It always
// lies inside [firstTurn, lastTurn].
AnchorTurn int `json:"anchorTurn" minimum:"0" maximum:"9007199254740991"`
// Span is the number of assistant turns collected on each side. It is
// validated 1..10 (TranscriptWindowSpanMinimum..TranscriptWindowSpanMaximum;
// the struct tags restate the two constants and a test holds them equal): the
// design value narrows a window and cannot widen it past the design.
Span int `json:"span" minimum:"1" maximum:"10"`
FirstTurn int `json:"firstTurn" minimum:"0" maximum:"9007199254740991"`
LastTurn int `json:"lastTurn" minimum:"0" maximum:"9007199254740991"`
// Segments is the ordered, contiguous run of segment ordinals that covers
// [firstTurn, lastTurn]. The viewer loads exactly these.
Segments []int `json:"segments" nullable:"false"`
HasOlder bool `json:"hasOlder"`
HasNewer bool `json:"hasNewer"`
}
TranscriptWindow is the descriptor of an anchor window: where the window is, never what is in it. It carries no turn content, so a jump can never be the oversized payload. A viewer loads the covering segments through the segment read.
func ResolveTranscriptWindow ¶ added in v0.51.0
func ResolveTranscriptWindow(sessionID SessionID, revision string, requestedAnchor, span int, turns []TranscriptWindowTurn, refs []TranscriptSegmentRef) (TranscriptWindow, error)
ResolveTranscriptWindow resolves an anchor to a user turn (the anchor itself, else the nearest lower user turn, else the nearest higher), collects up to span assistant turns on each side, and names the contiguous segment run that covers the range. turns are in transcript order and refs are the directory cut from the same turns. It never reads turn content. The result passes TranscriptWindow.Validate and ValidateTranscriptWindowCoverage; a span outside TranscriptWindowSpanMinimum..TranscriptWindowSpanMaximum is refused by the former.
func (TranscriptWindow) Validate ¶ added in v0.42.0
func (w TranscriptWindow) Validate() error
Validate checks the descriptor's own invariants: a positive span within the design bound, an anchor inside the window, and an ascending contiguous segment run. Coverage of [firstTurn, lastTurn] is checked against the directory by ValidateTranscriptWindowCoverage, because the descriptor deliberately carries no refs.
type TranscriptWindowTurn ¶ added in v0.51.0
TranscriptWindowTurn is the identity and role of one turn: all a window needs, so a server need not keep turn content to resolve one.
type TrendsPayload ¶
type TrendsPayload struct {
Days []DayStats `json:"days"`
TotalTokens int `json:"totalTokens"`
TotalSessions int `json:"totalSessions"`
}
TrendsPayload is the data sent on the trends WebSocket channel.
type TurnContentPart ¶ added in v0.45.0
type TurnContentPart struct {
Type TurnPartType `json:"type"`
// Text is the ordered text block. It is set only for a text part.
Text string `json:"text,omitempty"`
// Image is the ordered image block. It is set only for an image part.
Image *ImagePart `json:"image,omitempty" nullable:"false"`
}
TurnContentPart is one ordered content block of a turn. Parts preserve source order and replace no existing field: Content remains the concatenated text fallback and ToolCalls remains tool evidence.
type TurnDetail ¶
type TurnDetail struct {
Index int `json:"index"`
Role Role `json:"role"`
Content string `json:"content"`
// ContentParts preserves the ordered text and image blocks of a turn. It is
// additional evidence, never a replacement: Content remains the concatenated
// text fallback and ToolCalls remains tool evidence. Parts stay in source
// order, and an image-only turn keeps its carrier turn with empty Content.
ContentParts []TurnContentPart `json:"contentParts,omitempty" nullable:"false"`
ToolCalls []ToolCallDetail `json:"toolCalls,omitempty"`
Timestamp time.Time `json:"timestamp"`
Depth int `json:"depth"`
ParentIndex *int `json:"parentIndex,omitempty"`
AgentName string `json:"agentName,omitempty"`
// ObservedModel is the exact model identifier observed while producing this
// assistant or subagent turn. It is optional source evidence: when present it
// uses valid UTF-8 with no leading or trailing Unicode whitespace, while accepted
// bytes are preserved exactly. Producers enforce the assistant-only role condition; generated shape
// validators do not infer it from Role.
ObservedModel ObservedModelID `json:"observedModel,omitempty"`
// ThinkingLevel/ThinkingLevelRaw are assistant-turn evidence: set only on
// assistant-generated output, never user or system turns. Raw follows the
// same "differs from canonical, including unmapped" rule as the session field.
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
SourceEntryRef SourceEntryRef `json:"sourceEntryRef,omitempty"`
Provenance *ContentProvenance `json:"provenance,omitempty"`
Usage *UsageDetail `json:"usage,omitempty"`
// Command is present when this turn invoked a skill or a user-defined
// slash command. It is optional and safely ignorable; the invocation name
// is also in Content. Producers set it on the turn that carries the
// invocation, whatever Role that turn has: a harness-injected command
// wrapper is commonly a RoleSystem turn. It is never set for built-in
// harness commands. Consumers must not infer Role from Command or Command
// from Role.
Command *CommandInvocation `json:"command,omitempty"`
// ControlKind names the control record this turn was projected from. Its
// values are "mode", "permission-mode", "attachment", "agent-name", and
// "custom-title". It is producer-owned evidence: a consumer must never infer
// it from Role, Content, or any other field, and must treat a turn without
// controlKind as an ordinary turn. A compaction notice (Claude
// "compact-boundary", Codex "compacted") is a system row and never carries
// controlKind.
ControlKind *string `json:"controlKind,omitempty"`
// Enrichment fields — propagated from session_entries.
EntryType EntryType `json:"entryType,omitempty"`
HasThinking bool `json:"hasThinking,omitempty"`
StopReason *StopReason `json:"stopReason,omitempty"`
TokensIn *int `json:"tokensIn,omitempty"`
TokensOut *int `json:"tokensOut,omitempty"`
}
TurnDetail is a turn with full content for the detail view.
type TurnOutlineRow ¶ added in v0.67.0
type TurnOutlineRow struct {
Position int `json:"position" minimum:"0"`
RecordedIndexState TranscriptRecordedIndexState `json:"recordedIndexState"`
RecordedIndex *int `json:"recordedIndex,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
DisplayNumber string `json:"displayNumber,omitempty" minLength:"1" pattern:"^[1-9][0-9]*[a-z]*$"`
Role Role `json:"role"`
EntryType EntryType `json:"entryType"`
Depth int `json:"depth" minimum:"0"`
ParentIndex *int `json:"parentIndex,omitempty" minimum:"0" nullable:"false"`
TimestampMs int64 `json:"timestampMs"`
HasProse bool `json:"hasProse"`
HasToolUse bool `json:"hasToolUse"`
ToolKind ToolCallKind `json:"toolKind,omitempty"`
ToolNames []string `json:"toolNames,omitempty" nullable:"false"`
HasThinking bool `json:"hasThinking"`
IsError bool `json:"isError"`
Compaction bool `json:"compaction"`
ResumeBoundary bool `json:"resumeBoundary"`
SubagentStubs []TurnOutlineSubagentStub `json:"subagentStubs,omitempty" nullable:"false"`
}
TurnOutlineRow is one structural, content-free page-1 turn shell built from indexed metadata without opening immutable content blobs.
func (TurnOutlineRow) Validate ¶ added in v0.67.0
func (r TurnOutlineRow) Validate() error
Validate checks coordinates, closed sets, display number, and subagent stubs.
type TurnOutlineSubagentStub ¶ added in v0.67.0
type TurnOutlineSubagentStub struct {
SubagentSessionID SessionID `json:"subagentSessionId"`
}
TurnOutlineSubagentStub links a spawning turn outline row to a child subagent session without hydrating child-session metadata at first paint.
func (TurnOutlineSubagentStub) Validate ¶ added in v0.67.0
func (s TurnOutlineSubagentStub) Validate() error
Validate checks that the subagent stub names a valid local session ID.
type TurnPartType ¶ added in v0.45.0
type TurnPartType string
TurnPartType is the closed kind set of one ordered turn content part.
const ( // TurnPartTypeText is an ordered text block of a turn. TurnPartTypeText TurnPartType = "text" // TurnPartTypeImage is an ordered image block of a turn. TurnPartTypeImage TurnPartType = "image" )
func (TurnPartType) IsValid ¶ added in v0.45.0
func (t TurnPartType) IsValid() bool
IsValid reports whether the part type is a published kind.
func (TurnPartType) JSONSchema ¶ added in v0.45.0
func (TurnPartType) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TurnPartType) String ¶ added in v0.45.0
func (t TurnPartType) String() string
type TypeDefinition ¶
type TypeDefinition struct {
// TypeID is the dot-notation identifier (e.g., "quality.my_signal").
// Must match the CHECK (type_id LIKE '%.%') constraint.
TypeID string
// DisplayName is the human-readable name.
DisplayName string
// Description is optional free-text documentation.
Description string
// FamilyID is the UUID FK to annotation_families.id.
FamilyID string
// ValueDomain defines permissible values for this type.
ValueDomain ValueDomain
// LowerIsBetter is nil for non-ordinal types, false for higher-is-better, true for lower-is-better.
LowerIsBetter *bool
// Origin is who created this type (system, user, group).
Origin TypeOrigin
// AllowedTargetKinds specifies which target kinds this type allows (V16).
// Nil or empty means all target kinds are allowed.
AllowedTargetKinds []TargetKind
}
TypeDefinition is the input for registering a new annotation type.
type TypeDependency ¶
type TypeDependency struct {
// TypeID is the dependent annotation type.
TypeID string
// DependsOn is the type that must be computed first.
DependsOn string
// Required: true means this dependency must be satisfied before TypeID can produce a value.
Required bool
// Rationale documents why this dependency exists.
Rationale string
}
TypeDependency represents a dependency edge in the annotation_type_deps table.
type TypeFilter ¶
type TypeFilter struct {
// Status filters to types with this status (e.g., StatusActive).
// Zero value includes all statuses except deprecated/retired (unless IncludeDeprecated is set).
Status AnnotationStatus
// FamilyID filters to types in this family by UUID FK. "" means all families.
FamilyID string
// Origin filters to types from this origin. Zero value means all origins.
Origin TypeOrigin
// IncludeDeprecated includes deprecated types when true.
// Has no effect when Status is set (Status takes precedence).
IncludeDeprecated bool
}
TypeFilter constrains which annotation types ListTypes returns. Zero values mean "no filter" (include all non-deprecated types).
type TypeOrigin ¶
type TypeOrigin string
TypeOrigin identifies who created an annotation type.
const ( OriginSystem TypeOrigin = "system" OriginUser TypeOrigin = "user" OriginGroup TypeOrigin = "group" )
func (TypeOrigin) IsValid ¶
func (o TypeOrigin) IsValid() bool
IsValid returns true if the type origin is one of the known variants.
func (TypeOrigin) JSONSchema ¶
func (TypeOrigin) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (TypeOrigin) String ¶
func (o TypeOrigin) String() string
type UICapabilitiesResponse ¶ added in v0.1.1
type UICapabilitiesResponse struct {
UICapabilities []string `` /* 422-byte string literal not displayed */
}
UICapabilitiesResponse reports optional UI behavior enabled for the running local Peasant server. Capability token meanings and lifecycle are owned by Peasant, not by the schema module. Omitted and empty both mean no optional capabilities; consumers compare known tokens by exact membership and ignore unknown tokens. Producers emit tokens in sorted order without duplicates.
type UnifiedMetadata ¶
type UnifiedMetadata struct {
SchemaVersion int `json:"schemaVersion"`
SessionID SessionID `json:"sessionId"`
ParentUUID *SessionID `json:"parentUuid"` // nil for root sessions, pointer for nullable JSON
ModelHarness Harness `json:"harness"`
Model ModelID `json:"model"`
Version string `json:"version"` // provider tool version (e.g. "2.1.47")
// ThinkingLevel is the session-level seed: the earliest valid root-assistant
// level observation, or the stored seed on replay. Absent means unknown.
ThinkingLevel ThinkingLevel `json:"thinkingLevel,omitempty"`
// ThinkingLevelRaw is the exact native spelling when it differs from the
// emitted canonical value (including when no canonical could be mapped);
// absent when nothing was observed or the spelling is canonical.
ThinkingLevelRaw ThinkingLevelRaw `json:"thinkingLevelRaw,omitempty"`
// ThinkingLevelHistory records the in-session level changes observed after
// the seed, in source order, with consecutive duplicates collapsed. The
// session's first value stays in ThinkingLevel/ThinkingLevelRaw above; each
// entry here carries the later canonical level and/or its exact native
// spelling. Empty when the session never changed level or none was observed.
ThinkingLevelHistory []ThinkingLevelChange `json:"thinkingLevelHistory,omitempty"`
Timestamp TimestampInfo `json:"timestamp"`
Source SourceInfo `json:"source"`
Git GitContext `json:"git"`
Project ProjectContext `json:"project"`
HostSlug HostSlug `json:"hostSlug"`
Stats SessionStats `json:"stats"`
Subagents []SubagentRef `json:"subagents"`
RootSessionID *SessionID `json:"rootSessionId,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
CWD string `json:"cwd,omitempty"` // Real project working directory (v7+)
DerivedAt *int64 `json:"derivedAt,omitempty"` // Unix ms when metadata.json was derived from DB (v8+); nil if written before DB insert
Diagnostics DiagnosticsInfo `json:"diagnostics"`
ContentHash string `json:"contentHash"` // SHA3-256 of transcript bytes
MetadataHash string `json:"metadataHash"` // SHA3-256 of metadata (excluding hashes + redaction)
Redaction RedactionInfo `json:"redaction"`
// AdapterVersion identifies the Peasant adapter/parser that successfully
// produced this artifact, not the native harness release in Version.
// Omission means unknown historical provenance; a present value must be positive.
AdapterVersion *int `` /* 230-byte string literal not displayed */
}
UnifiedMetadata is the on-disk JSON stored alongside each raw transcript. It drives the adapter layer for downstream consumers and incremental diff logic.
func NewUnifiedMetadata ¶
func NewUnifiedMetadata() UnifiedMetadata
NewUnifiedMetadata creates a UnifiedMetadata with SchemaVersion set to MetadataSchemaVersion and empty slices initialized (not nil) so JSON serialization produces [] instead of null.
func (UnifiedMetadata) MarshalJSON ¶ added in v0.15.0
func (m UnifiedMetadata) MarshalJSON() ([]byte, error)
MarshalJSON preserves optional producer provenance and refuses invalid revisions even when the metadata was assembled directly rather than decoded from JSON.
func (*UnifiedMetadata) UnmarshalJSON ¶
func (m *UnifiedMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes UnifiedMetadata, accepting the legacy pre-v9 on-disk harness key. The canonical key is json:"harness" (v9+); pre-v9 files wrote json:"modelHarness". When the canonical key is absent but the legacy key is present, the legacy value is adopted so a pre-v9 file still reads its harness correctly in the window before the v9 DIFF-stage re-extract rewrites it. AdapterVersion is positive when present; omission represents unknown provenance.
type UnusualSignal ¶
type UnusualSignal struct {
Kind string `json:"kind"` // e.g. "retryLoops"
Label string `json:"label"` // plain, neutral
PerChange float64 `json:"perChange"` // this change's per-conversation rate
PerProject float64 `json:"perProject"` // the project's per-conversation baseline
}
UnusualSignal is one neutral rate-elevation: a per-conversation rate for this change that runs notably above the project baseline. Facts for orientation — the surface shows, it does not grade.
type UnverifiedPullRequest ¶ added in v0.36.0
type UnverifiedPullRequest struct {
Owner string `json:"owner" minLength:"1"`
Repo string `json:"repo" minLength:"1"`
Number int `json:"number" minimum:"1" maximum:"9007199254740991"`
URL string `json:"url" minLength:"1"`
Source UnverifiedPullRequestSource `json:"source"`
}
UnverifiedPullRequest is evidence from a recorded command, not a verified attachment.
func (*UnverifiedPullRequest) UnmarshalJSON ¶ added in v0.36.0
func (p *UnverifiedPullRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON requires a concrete locator instead of treating absent source as an invented zero-index call.
func (UnverifiedPullRequest) Validate ¶ added in v0.36.0
func (p UnverifiedPullRequest) Validate() error
Validate checks the canonical URL and exact, safe source coordinates.
type UnverifiedPullRequestSource ¶ added in v0.36.0
type UnverifiedPullRequestSource struct {
TurnIndex int `json:"turnIndex" minimum:"0" maximum:"9007199254740991"`
ToolCallIndex int `json:"toolCallIndex" minimum:"0" maximum:"9007199254740991"`
ToolCallID string `json:"toolCallId,omitempty" minLength:"1"`
}
UnverifiedPullRequestSource locates the original call in the main transcript.
func (*UnverifiedPullRequestSource) UnmarshalJSON ¶ added in v0.36.0
func (s *UnverifiedPullRequestSource) UnmarshalJSON(data []byte) error
UnmarshalJSON rejects explicit null on an optional source ID.
type UsageCompleteness ¶ added in v0.16.0
type UsageCompleteness string
const ( UsageComplete UsageCompleteness = "complete" UsagePartial UsageCompleteness = "partial" UsageUnknown UsageCompleteness = "unknown" )
func NewUsageCompleteness ¶ added in v0.16.0
func NewUsageCompleteness(raw string) (UsageCompleteness, error)
func (UsageCompleteness) IsValid ¶ added in v0.16.0
func (v UsageCompleteness) IsValid() bool
func (UsageCompleteness) JSONSchema ¶ added in v0.16.0
func (UsageCompleteness) JSONSchema() (jsonschema.Schema, error)
type UsageDetail ¶ added in v0.16.0
type UsageDetail struct {
OwnerID UsageOwnerID `json:"ownerId"`
SourceEntryRef SourceEntryRef `json:"sourceEntryRef"`
Scope UsageScope `json:"scope"`
Completeness UsageCompleteness `json:"completeness"`
Tokens *TokenUsageDetail `json:"tokens,omitempty"`
Cost *RecordedCostDetail `json:"cost,omitempty"`
}
type UsageOwnerID ¶ added in v0.16.0
type UsageOwnerID string
type UsageScope ¶ added in v0.16.0
type UsageScope string
const ( UsageScopeAssistant UsageScope = "assistant" UsageScopeTool UsageScope = "tool" UsageScopeSummary UsageScope = "summary" )
func NewUsageScope ¶ added in v0.16.0
func NewUsageScope(raw string) (UsageScope, error)
func (UsageScope) IsValid ¶ added in v0.16.0
func (v UsageScope) IsValid() bool
func (UsageScope) JSONSchema ¶ added in v0.16.0
func (UsageScope) JSONSchema() (jsonschema.Schema, error)
type ValidGenExpectation ¶
type ValidGenExpectation struct {
Parses bool `yaml:"parses"`
WantID string `yaml:"want_id"` // casing name whose value is the expected normalized ID
FromURLPerForm bool `yaml:"from_url_per_form"` // take FromURL from each ref_form
}
ValidGenExpectation is the expectation attached to the valid generator.
type ValidGeneration ¶
type ValidGeneration struct {
Axes []string `yaml:"axes"`
Expect ValidGenExpectation `yaml:"expect"`
}
ValidGeneration declares the valid cross-product and its attached expectation.
type ValueDomain ¶
type ValueDomain struct {
Kind ValueDomainKind `json:"kind"`
Datatype AnnotationDatatype `json:"datatype"`
PermissibleValues []string `json:"permissibleValues,omitempty"` // for enumerated
ConstraintSpec string `json:"constraintSpec,omitempty"` // for described; JSON
}
ValueDomain defines the permissible values for an annotation type (ISO 11179). For enumerated domains, PermissibleValues holds the finite set of allowed strings. For described domains, ConstraintSpec holds a JSON-encoded range or pattern.
type ValueDomainKind ¶
type ValueDomainKind string
ValueDomainKind distinguishes enumerated (finite set of allowed values) from described (range or pattern constraint) annotation value domains (ISO 11179).
const ( DomainEnumerated ValueDomainKind = "enumerated" DomainDescribed ValueDomainKind = "described" )
func (ValueDomainKind) IsValid ¶
func (k ValueDomainKind) IsValid() bool
IsValid returns true if the value domain kind is one of the known variants.
func (ValueDomainKind) JSONSchema ¶
func (ValueDomainKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (ValueDomainKind) String ¶
func (k ValueDomainKind) String() string
type VillageAPIKey ¶ added in v0.61.0
type VillageAssignableCollectiveRole ¶ added in v0.31.0
type VillageAssignableCollectiveRole string
VillageAssignableGroupRole is the smaller role menu accepted by the member role update endpoint.
type VillageAssignableGroupRole
deprecated
added in
v0.1.3
type VillageAssignableGroupRole = VillageAssignableCollectiveRole
Deprecated: use VillageAssignableCollectiveRole.
const ( VillageAssignableGroupRoleContributor VillageAssignableGroupRole = "contributor" VillageAssignableGroupRoleMember VillageAssignableGroupRole = "member" )
func (VillageAssignableGroupRole) JSONSchema ¶ added in v0.1.3
func (VillageAssignableGroupRole) JSONSchema() (jsonschema.Schema, error)
type VillageAttestationType ¶ added in v0.61.0
type VillageAttestationType string
VillageAttestationType is the closed menu of usage attestations.
const ( VillageAttestationUsedInTraining VillageAttestationType = "used_in_training" VillageAttestationReferenced VillageAttestationType = "referenced" VillageAttestationEvaluated VillageAttestationType = "evaluated" VillageAttestationDeployed VillageAttestationType = "deployed" )
func (VillageAttestationType) IsValid ¶ added in v0.61.0
func (t VillageAttestationType) IsValid() bool
func (VillageAttestationType) JSONSchema ¶ added in v0.61.0
func (VillageAttestationType) JSONSchema() (jsonschema.Schema, error)
func (VillageAttestationType) String ¶ added in v0.61.0
func (t VillageAttestationType) String() string
type VillageAvailableRepositoriesResponse ¶ added in v0.22.0
type VillageAvailableRepositoriesResponse struct {
Repositories []VillageAvailableRepository `json:"repositories" nullable:"false"`
}
type VillageAvailableRepository ¶ added in v0.22.0
type VillageAvailableRepository struct {
Owner string `json:"owner"`
Name string `json:"name"`
IsPrivate bool `json:"is_private"`
PublisherCount int32 `json:"publisher_count" minimum:"0"`
}
VillageAvailableRepository is one repository the App can offer a collective, used to populate the repository picker before a link is created. PublisherCount counts the distinct members who shared a transcript from this repository with this collective; transcripts not shared with it are not counted.
type VillageBatchReviewRequest ¶ added in v0.1.3
type VillageBatchReviewRequest struct {
TranscriptIDs []TranscriptID `json:"transcript_ids" nullable:"false"`
Status VillageReviewDecision `json:"status"`
}
type VillageBatchReviewResponse ¶ added in v0.1.3
type VillageBatchReviewResponse struct {
Decided []TranscriptID `json:"decided" nullable:"false"`
AlreadyDecided []TranscriptID `json:"already_decided" nullable:"false"`
}
type VillageBatchShareEntry ¶ added in v0.1.3
type VillageBatchShareEntry struct {
}
type VillageBatchShareRequest ¶ added in v0.1.3
type VillageBatchShareRequest struct {
}
type VillageBatchShareResponse ¶ added in v0.1.3
type VillageBatchShareResponse struct {
}
type VillageBatchShareSelectionRequest ¶ added in v0.62.0
type VillageBatchShareSelectionRequest struct {
}
VillageBatchShareSelectionRequest writes one exact selection. TranscriptIDs lists every session to offer, roots and helpers alike; the server does not expand a root into its helpers. PrivateApprovals lists the private transcripts among them whose owner approved their visibility. One request offers at most VillageContributionSelectionMaxTranscripts sessions; a client with a larger selection sends it as several requests, and a body over the bound is a 400.
type VillageCollective ¶ added in v0.31.0
type VillageCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
Creator VillagePublicOwner `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode"`
DataAccess VillageGroupDataAccess `json:"data_access"`
LinkedGithubOrg *string `json:"linked_github_org"`
DisplayMembers bool `json:"display_members"`
TranscriptDeletionPolicy VillageTranscriptDeletionPolicy `json:"transcript_deletion_policy"`
// PostPromptsCheck controls whether the prompts check is created on pull
// requests in this collective's linked repositories. Defaults to true.
PostPromptsCheck bool `json:"post_prompts_check"`
// PromptsCheckMode decides the check conclusion when no prompts are attached.
PromptsCheckMode VillagePromptsCheckMode `json:"prompts_check_mode"`
}
VillageGroup is the full collective row returned by create, update, and detail routes. Creator is the person who created the collective as this viewer may see them, resolved by the server per viewer; the same holds on every collective row.
type VillageCollectiveAcceptanceMode ¶ added in v0.31.0
type VillageCollectiveAcceptanceMode string
VillageGroupAcceptanceMode is the closed acceptance policy menu for a collective.
type VillageCollectiveContributor ¶ added in v0.31.0
type VillageCollectiveContributor struct {
Contributor VillagePublicOwner `json:"contributor"`
TranscriptCount int32 `json:"transcript_count"`
}
VillageCollectiveContributor is one contributor row with its transcript count. Contributor is the person as the viewer may see them; the server resolves anonymity per viewer.
type VillageCollectiveDataAccess ¶ added in v0.31.0
type VillageCollectiveDataAccess string
VillageGroupDataAccess is the closed read policy menu for a collective's pooled transcript data.
type VillageCollectiveDetailRecord ¶ added in v0.31.0
type VillageCollectiveDetailRecord struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
Creator VillagePublicOwner `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode"`
DataAccess VillageGroupDataAccess `json:"data_access"`
LinkedGithubOrg *string `json:"linked_github_org"`
DisplayMembers bool `json:"display_members"`
TranscriptDeletionPolicy VillageTranscriptDeletionPolicy `json:"transcript_deletion_policy"`
PostPromptsCheck *bool `json:"post_prompts_check,omitempty"`
PromptsCheckMode *VillagePromptsCheckMode `json:"prompts_check_mode,omitempty"`
}
VillageGroupDetailRecord preserves the released collective detail fields. Optional prompts settings are facts supplied by a capable producer, not defaults.
type VillageCollectiveDetailResponse ¶ added in v0.31.0
type VillageCollectiveDetailResponse struct {
Group VillageGroupDetailRecord `json:"group"`
Members []VillageGroupMember `json:"members" nullable:"false"`
Stats VillageGroupTranscriptStats `json:"stats"`
Models []VillageGroupModelBreakdown `json:"models" nullable:"false"`
Contributors []VillageGroupContributor `json:"contributors" nullable:"false"`
CanRead bool `json:"can_read"`
YourRole VillageGroupViewerRole `json:"your_role"`
Transcripts []VillageGroupTranscript `json:"transcripts" nullable:"false"`
PendingMembers []VillageGroupMember `json:"pending_members,omitempty" nullable:"false"`
}
func (VillageCollectiveDetailResponse) Validate ¶ added in v0.33.0
func (r VillageCollectiveDetailResponse) Validate() error
Validate checks the people the flat collective detail shows: every member, pending member, contributor, and transcript owner is a declared public owner shape, and an anonymous member lists no organizations.
type VillageCollectiveInvitation ¶ added in v0.34.0
type VillageCollectiveInvitation struct {
ID VillageUUID `json:"id"`
Collective VillageInvitedCollective `json:"collective"`
InvitedBy VillagePublicOwner `json:"invited_by"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
VillageCollectiveInvitation is one invitation as the invited person sees it. InvitedBy is the inviting owner as this viewer may see them: an owner who is not discoverable is anonymous here, and a client says "an owner of <collective>" instead of a handle.
func (VillageCollectiveInvitation) Validate ¶ added in v0.34.0
func (i VillageCollectiveInvitation) Validate() error
Validate refuses an invitation a producer must not emit.
type VillageCollectiveInvitationRequest ¶ added in v0.34.0
type VillageCollectiveInvitationRequest struct {
Username string `json:"username" minLength:"1"`
}
VillageCollectiveInvitationRequest invites a person to a collective by their Village username. The username is what the owner typed; the server answers the same way whether or not an account holds it.
type VillageCollectiveInvitationSent ¶ added in v0.34.0
type VillageCollectiveInvitationSent struct {
ID VillageUUID `json:"id"`
InvitedUsername string `json:"invited_username" minLength:"1"`
InvitedBy VillagePublicOwner `json:"invited_by"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
VillageCollectiveInvitationSent is one open invitation as the collective's owners see it. InvitedUsername is the handle the inviting owner typed, lowercased; it is never resolved to a person, so the row says nothing about whether an account holds that handle. There is deliberately no status: an invitation the person declined is listed exactly like a pending one until it expires. InvitedBy is the owner who sent it as this viewer may see them.
func (VillageCollectiveInvitationSent) Validate ¶ added in v0.34.0
func (s VillageCollectiveInvitationSent) Validate() error
Validate refuses a row a producer must not emit.
type VillageCollectiveInvitationsSentResponse ¶ added in v0.34.0
type VillageCollectiveInvitationsSentResponse struct {
Invitations []VillageCollectiveInvitationSent `json:"invitations" nullable:"false"`
}
VillageCollectiveInvitationsSentResponse lists a collective's open invitations for its owners: pending and declined ones that have not expired, in one indistinguishable list.
func (VillageCollectiveInvitationsSentResponse) Validate ¶ added in v0.34.0
func (r VillageCollectiveInvitationsSentResponse) Validate() error
Validate refuses a list a producer must not emit.
type VillageCollectiveMember ¶ added in v0.31.0
type VillageCollectiveMember struct {
Role VillageGroupRole `json:"role"`
JoinedAt time.Time `json:"joined_at"`
Member VillagePublicOwner `json:"member"`
GithubOrgs []string `json:"github_orgs" nullable:"false"`
}
VillageGroupMember is one member row in a collective roster. Member is the person as the viewer may see them: the server resolves anonymity per viewer (collective owners see every member's profile). GithubOrgs is empty when Member is anonymous, because an organization login can identify a person.
type VillageCollectiveMemberRoleRequest ¶ added in v0.31.0
type VillageCollectiveMemberRoleRequest struct {
Role VillageAssignableGroupRole `json:"role"`
}
type VillageCollectiveMemberUsernameRequest
deprecated
added in
v0.31.0
type VillageCollectiveMemberUsernameRequest struct {
Username string `json:"username"`
}
VillageCollectiveMemberUsernameRequest was the body of the removed owner add-member operation.
Deprecated: no operation accepts it. An owner invites a person with VillageCollectiveInvitationRequest instead. It stays exported, with its deprecated alias, for the released alias window.
type VillageCollectiveModelBreakdown ¶ added in v0.31.0
type VillageCollectiveRole ¶ added in v0.31.0
type VillageCollectiveRole string
VillageGroupRole is the role stored for a user in one collective.
type VillageCollectiveSearchResponse ¶ added in v0.1.3
type VillageCollectiveSearchResponse struct {
Collectives []VillageCollectiveSearchResult `json:"collectives" nullable:"false"`
}
type VillageCollectiveSearchResult ¶ added in v0.1.3
type VillageCollectiveSearchResult struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
LinkedGithubOrg *string `json:"linked_github_org"`
MemberCount int32 `json:"member_count"`
TranscriptCount int32 `json:"transcript_count"`
}
VillageCollectiveSearchResult is one collective returned by search surfaces.
type VillageCollectiveStatusRoleResponse ¶ added in v0.31.0
type VillageCollectiveStatusRoleResponse struct {
Status string `json:"status"`
Role VillageGroupRole `json:"role"`
}
type VillageCollectiveSubmission ¶ added in v0.1.3
type VillageCollectiveSubmission struct {
TranscriptID TranscriptID `json:"transcript_id"`
GroupID VillageUUID `json:"group_id"`
Title *string `json:"title"`
EventNum int32 `json:"event_num"`
Status VillageShareStatus `json:"status"`
RecordedAt time.Time `json:"recorded_at"`
}
type VillageCollectiveTranscript ¶ added in v0.31.0
type VillageCollectiveTranscript struct {
ID TranscriptID `json:"id"`
LocalID SessionID `json:"local_id"`
Title *string `json:"title"`
Description *string `json:"description"`
Visibility VillageTranscriptVisibility `json:"visibility"`
ModelProvider string `json:"model_provider"`
ModelName *string `json:"model_name"`
HarnessVersion *string `json:"harness_version"`
SessionStart *time.Time `json:"session_start"`
SessionEnd *time.Time `json:"session_end"`
TurnCount *int32 `` /* 299-byte string literal not displayed */
// ConversationTurnCount is the number of conversation turns as published;
// null means unmeasured.
ConversationTurnCount *int64 `json:"conversation_turn_count" minimum:"0" maximum:"9007199254740991"`
// DisplayedTurnCount is the count a reader is shown: conversation_turn_count
// when measured, else turn_count; resolved by the server.
DisplayedTurnCount *int64 `json:"displayed_turn_count" minimum:"0" maximum:"9007199254740991"`
TokenCount *int32 `json:"token_count"`
BlobSizeBytes *int64 `json:"blob_size_bytes"`
SchemaVersion string `json:"schema_version"`
PublishedAt time.Time `json:"published_at"`
UpdatedAt time.Time `json:"updated_at"`
ParentSessionID *SessionID `json:"parent_session_id"`
// ParentTranscriptID is the transcript published from the session named by
// ParentSessionID, resolved by the server at read time within the same
// owner, because a session id is unique only per owner and the owner's id
// is not on the wire. It is null when nothing started this session, when
// that session is not published, or when this viewer may not read it, so
// it never discloses a transcript the viewer cannot open. Readers group
// children under parents by this id, never by matching session ids.
ParentTranscriptID *TranscriptID `json:"parent_transcript_id"`
IngestedAt *time.Time `json:"ingested_at"`
SourceFormat *SourceFormat `json:"source_format"`
// The repository fields below (git_branch, git_remote, project_hash,
// project_name, project_display_name, project_name_source,
// project_remote_label) identify the owner's repository, so each is null
// when the owner is anonymous to this viewer, as well as when it was not
// recorded. The server decides; Validate refuses any of them beside an
// anonymous owner.
GitBranch *string `json:"git_branch"`
GitRemote *string `json:"git_remote"`
ProjectHash *ProjectHash `json:"project_hash"`
ProjectName *string `json:"project_name"`
ProjectDisplayName *string `json:"project_display_name"`
ProjectNameSource *VillageProjectNameSource `json:"project_name_source"`
ProjectRemoteLabel *string `json:"project_remote_label"`
ToolCallCount *int32 `json:"tool_call_count"`
SubagentCount *int32 `json:"subagent_count"`
DurationMs *int64 `json:"duration_ms"`
Subagents *[]map[string]interface{} `json:"subagents"`
DiagnosticsWarnings *[]DiagnosticEntry `json:"diagnostics_warnings"`
DiagnosticsPartial *bool `json:"diagnostics_partial"`
TokensIn *int64 `json:"tokens_in"`
TokensOut *int64 `json:"tokens_out"`
TitleGenerated *string `json:"title_generated"`
Outcome *SessionOutcome `json:"outcome"`
FilesTouched *int32 `json:"files_touched"`
LinesChanged *int32 `json:"lines_changed"`
RetryLoops *int32 `json:"retry_loops"`
RetryTokensWasted *int32 `json:"retry_tokens_wasted"`
WithinSessionReverts *int32 `json:"within_session_reverts"`
SignalDensity *float32 `json:"signal_density"`
SpecQualityScore *float32 `json:"spec_quality_score"`
ExplorationRatio *float32 `json:"exploration_ratio"`
ScopeBreadth *int32 `json:"scope_breadth"`
DiscoveryTurns *int32 `json:"discovery_turns"`
M2TokenOutcomeRatio *float32 `json:"m2_token_outcome_ratio"`
M3UniqueToolCount *int32 `json:"m3_unique_tool_count"`
M4ErrorRecoveryCount *int32 `json:"m4_error_recovery_count"`
M4ConsecutiveErrorMax *int32 `json:"m4_consecutive_error_max"`
M5ContextUtilizationPct *float32 `json:"m5_context_utilization_pct"`
M5PeakContextTokens *int32 `json:"m5_peak_context_tokens"`
M5AvgMessageTokens *int32 `json:"m5_avg_message_tokens"`
M6OutputSurvivalPct *float32 `json:"m6_output_survival_pct"`
M6LinesSurvived *int32 `json:"m6_lines_survived"`
M6LinesTotal *int32 `json:"m6_lines_total"`
M7SpecWordCount *int32 `json:"m7_spec_word_count"`
M7SpecHasExamples *bool `json:"m7_spec_has_examples"`
M7SpecHasConstraints *bool `json:"m7_spec_has_constraints"`
ComputedAt *time.Time `json:"computed_at"`
ComputeVersion *int32 `json:"compute_version"`
ContentHash *TranscriptContentHash `json:"content_hash"`
LicenseID *License `json:"license_id"`
SessionOrigin SessionOrigin `json:"session_origin"`
Owner VillagePublicOwner `json:"owner"`
InputSubmissionCount *int64 `json:"input_submission_count,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
RootSessionID *SessionID `json:"root_session_id,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
// PullRequests is shown even when Owner is anonymous: a pull request the
// owner attached is public by the owner's own act.
PullRequests VillagePullRequestsSummary `json:"pull_requests"`
}
VillageGroupTranscript deliberately lists the transcript fields instead of embedding VillageTranscript. Village flattens its embedded response on the JSON wire, and this shape preserves required fields in OpenAPI and TypeScript generation. Owner is the transcript's owner as this viewer may see them.
func (VillageCollectiveTranscript) Validate ¶ added in v0.33.0
func (t VillageCollectiveTranscript) Validate() error
Validate checks the owner and that an anonymous owner's repository fields are null.
type VillageCollectiveTranscriptStats ¶ added in v0.31.0
type VillageCollectiveTranscriptStats struct {
TotalTranscripts int32 `json:"total_transcripts"`
ContributorCount int32 `json:"contributor_count"`
// TotalTurns sums displayed_turn_count over the collective's transcripts.
TotalTurns int64 `json:"total_turns"`
TotalDurationMs int64 `json:"total_duration_ms"`
TotalTokens int64 `json:"total_tokens"`
PullRequestCount int32 `json:"pull_request_count" minimum:"0"`
}
VillageGroupTranscriptStats totals a collective's transcripts. PullRequestCount counts the distinct pull requests whose attachment is in state attached, includes a transcript counted in TotalTranscripts, and that the caller may read under the visibility rule of VillageTranscriptPullRequestsResponse, failing closed; detached pull requests are not counted.
type VillageCollectiveViewerRole ¶ added in v0.31.0
type VillageCollectiveViewerRole string
VillageGroupViewerRole is the viewer's role in one collective. The empty value is the current wire value for a signed-out or non-member viewer on the group-detail response.
type VillageContributableResponse ¶ added in v0.1.3
type VillageContributableResponse struct {
GroupID VillageUUID `json:"group_id"`
Transcripts []VillageContributableTranscript `json:"transcripts" nullable:"false"`
}
type VillageContributableTranscript ¶ added in v0.1.3
type VillageContributableTranscript struct {
ID TranscriptID `json:"id"`
LocalID SessionID `json:"local_id"`
Title *string `json:"title"`
Visibility VillageTranscriptVisibility `json:"visibility"`
ProjectHash ProjectHash `json:"project_hash"`
ProjectDisplayName string `json:"project_display_name"`
ProjectNameSource VillageProjectNameSource `json:"project_name_source"`
GitBranch *string `json:"git_branch"`
ParentSessionID *SessionID `json:"parent_session_id"`
SessionOrigin SessionOrigin `json:"session_origin"`
ModelProvider string `json:"model_provider"`
PublishedAt time.Time `json:"published_at"`
InputSubmissionCount *int64 `json:"input_submission_count,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
RootSessionID *SessionID `json:"root_session_id,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
// SessionStart is when the session began. It is absent when unknown.
SessionStart *time.Time `json:"session_start,omitempty" nullable:"false" description:"When the session began. Absent when unknown."`
// SessionEnd is when the session's last turn happened. It is absent when
// unknown.
SessionEnd *time.Time `json:"session_end,omitempty" nullable:"false" description:"When the session's last turn happened. Absent when unknown."`
// ParentTranscriptID is the published transcript of the parent session. It
// is absent for a root, and for a helper whose parent is not published.
ParentTranscriptID *TranscriptID `` /* 183-byte string literal not displayed */
// LatestStatus is the status of the latest contribution attempt in this
// collective; absence means no attempt. already_shared stays and is true
// only for pending and approved.
LatestStatus *VillageShareStatus `` /* 216-byte string literal not displayed */
}
VillageContributableTranscript is one of the caller's own transcripts it may offer to a collective. Its owner is always the caller, shown their own profile, so its repository fields are never withheld.
type VillageContributableView ¶ added in v0.62.0
type VillageContributableView string
VillageContributableView is the closed view menu of the contributable operation. Omitting the parameter keeps the flat whole-library response, so the flat response has no token. The menu is distinct from the grouped-view menu that the pending, my-shares, transcript and detail reads share, which accepts only grouped.
const ( // VillageContributableViewGrouped selects the grouped helper-list envelope. VillageContributableViewGrouped VillageContributableView = "grouped" // VillageContributableViewPaged selects one page of root sessions, each with // its family of helpers. VillageContributableViewPaged VillageContributableView = "paged" // VillageContributableViewSnapshot selects the compact record of every // session in the matching families of one project. VillageContributableViewSnapshot VillageContributableView = "snapshot" )
func NewVillageContributableView ¶ added in v0.62.0
func NewVillageContributableView(raw string) (VillageContributableView, error)
func (VillageContributableView) IsValid ¶ added in v0.62.0
func (v VillageContributableView) IsValid() bool
func (VillageContributableView) JSONSchema ¶ added in v0.62.0
func (VillageContributableView) JSONSchema() (jsonschema.Schema, error)
type VillageContributedCollective ¶ added in v0.1.3
type VillageContributedCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
LinkedGithubOrg *string `json:"linked_github_org"`
ApprovedCount int32 `json:"approved_count" minimum:"0"`
PendingCount int32 `json:"pending_count" minimum:"0"`
RejectedAttemptCount int32 `json:"rejected_attempt_count" minimum:"0"`
WithdrawnAttemptCount int32 `json:"withdrawn_attempt_count" minimum:"0"`
}
func (*VillageContributedCollective) UnmarshalJSON ¶ added in v0.31.0
func (v *VillageContributedCollective) UnmarshalJSON(data []byte) error
func (VillageContributedCollective) Validate ¶ added in v0.31.0
func (v VillageContributedCollective) Validate() error
type VillageContributedCollectivesResponse ¶ added in v0.1.3
type VillageContributedCollectivesResponse struct {
Collectives []VillageContributedCollective `json:"collectives" nullable:"false"`
}
func (*VillageContributedCollectivesResponse) UnmarshalJSON ¶ added in v0.31.0
func (v *VillageContributedCollectivesResponse) UnmarshalJSON(data []byte) error
func (VillageContributedCollectivesResponse) Validate ¶ added in v0.31.0
func (v VillageContributedCollectivesResponse) Validate() error
type VillageContributionAttemptReconciliation ¶ added in v0.31.0
type VillageContributionAttemptReconciliation string
VillageContributionAttemptReconciliation describes the effect on retained evidence. Superseded is a valid older pending observation, not an error.
const ( VillageContributionAttemptInserted VillageContributionAttemptReconciliation = "inserted" VillageContributionAttemptUnchanged VillageContributionAttemptReconciliation = "unchanged" VillageContributionAttemptUpdated VillageContributionAttemptReconciliation = "updated" VillageContributionAttemptSuperseded VillageContributionAttemptReconciliation = "superseded" )
type VillageContributionErrorCode ¶ added in v0.62.0
type VillageContributionErrorCode string
VillageContributionErrorCode is the closed machine-readable reason a contribution request was refused. It rides beside the human-readable error text; a client branches on the code and never parses the text.
const ( // VillageContributionErrorMoved: a root now belongs to another project; the // detail names it in current_project_hash. VillageContributionErrorMoved VillageContributionErrorCode = "moved" // VillageContributionErrorMissing: the transcript is not among the caller's // published transcripts. VillageContributionErrorMissing VillageContributionErrorCode = "missing" // VillageContributionErrorPrivateUnapproved: a private transcript was // selected without a matching private approval. VillageContributionErrorPrivateUnapproved VillageContributionErrorCode = "private_unapproved" // VillageContributionErrorConflict: the transcript changed in a way that // conflicts with the request. VillageContributionErrorConflict VillageContributionErrorCode = "conflict" // VillageContributionErrorPolicy: the collective's policy refuses the // request as a whole. Its detail omits transcript_id. VillageContributionErrorPolicy VillageContributionErrorCode = "policy" // VillageContributionErrorMembership: the caller may not contribute to the // collective. VillageContributionErrorMembership VillageContributionErrorCode = "membership" // VillageContributionErrorStaleSelection: the selection no longer matches // the library; read it again. VillageContributionErrorStaleSelection VillageContributionErrorCode = "stale_selection" // VillageContributionErrorSnapshotTimeout: the snapshot did not finish in time. VillageContributionErrorSnapshotTimeout VillageContributionErrorCode = "snapshot_timeout" // VillageContributionErrorSnapshotBusy: the server is already building the // maximum number of snapshots. VillageContributionErrorSnapshotBusy VillageContributionErrorCode = "snapshot_busy" // VillageContributionErrorSnapshotTooLarge: the snapshot of the project // would exceed the size limit; narrow the search with q or provider and read // it again. Nothing partial is returned. VillageContributionErrorSnapshotTooLarge VillageContributionErrorCode = "snapshot_too_large" )
func NewVillageContributionErrorCode ¶ added in v0.62.0
func NewVillageContributionErrorCode(raw string) (VillageContributionErrorCode, error)
func (VillageContributionErrorCode) IsValid ¶ added in v0.62.0
func (c VillageContributionErrorCode) IsValid() bool
func (VillageContributionErrorCode) JSONSchema ¶ added in v0.62.0
func (VillageContributionErrorCode) JSONSchema() (jsonschema.Schema, error)
type VillageContributionErrorDetail ¶ added in v0.62.0
type VillageContributionErrorDetail struct {
TranscriptID *TranscriptID `` /* 148-byte string literal not displayed */
Code VillageContributionErrorCode `json:"code" description:"The machine-readable reason for this transcript."`
// CurrentProjectHash names the project a moved transcript now belongs to.
CurrentProjectHash *ProjectHash `json:"current_project_hash,omitempty" nullable:"false" description:"The project a moved transcript now belongs to."`
}
VillageContributionErrorDetail is one per-transcript reason inside a refusal. A request-level reason such as policy omits transcript_id.
type VillageContributionErrorResponse ¶ added in v0.62.0
type VillageContributionErrorResponse struct {
Error string `json:"error" description:"The human-readable refusal. Always present."`
// Code is the primary reason for the refusal.
Code *VillageContributionErrorCode `` /* 181-byte string literal not displayed */
// Details carries the per-transcript reasons. A request-level reason such
// as policy has a detail without transcript_id.
Details []VillageContributionErrorDetail `` /* 173-byte string literal not displayed */
}
VillageContributionErrorResponse is the refusal body of a contribution write. It is the common envelope plus the machine-readable reason: Error is always present and is the only field a client of the common envelope reads, and Code and Details are additive.
type VillageContributionFamilyMember ¶ added in v0.62.0
type VillageContributionFamilyMember struct {
// Transcript is the member's own row. Its project_hash and
// project_display_name are the member's own project, which may differ from
// the project of the family's root. already_shared on the row marks a
// member that is already live; a live member stays locked in a selection.
Transcript VillageContributableTranscript `json:"transcript"`
// Matched is true when this member itself matched q. It is absent when the
// request carried no q.
Matched *bool `` /* 133-byte string literal not displayed */
}
VillageContributionFamilyMember is one session of a contribution family: the contributable row, plus whether it matched the request's q search. A family appears when its root or any helper matches, so a member can be present only because another member matched.
type VillageContributionPageItem ¶ added in v0.62.0
type VillageContributionPageItem struct {
Root VillageContributionFamilyMember `` /* 205-byte string literal not displayed */
Helpers []VillageContributionFamilyMember `` /* 177-byte string literal not displayed */
}
VillageContributionPageItem is one family: a root session and every helper that descends from it. The family belongs to its root's project, whatever project each helper is in. Selecting the root selects its helpers by default. A session whose chain of parents loops back on itself is a root with no helpers taken from the loop.
type VillageContributionPageResponse ¶ added in v0.62.0
type VillageContributionPageResponse struct {
GroupID VillageUUID `json:"group_id"`
Items []VillageContributionPageItem `` /* 447-byte string literal not displayed */
// NextCursor is the opaque cursor of the following page. It is absent on
// the last page.
NextCursor *string `json:"next_cursor,omitempty" nullable:"false" description:"The opaque cursor of the following page. Absent on the last page."`
HasMore bool `json:"has_more"`
}
VillageContributionPageResponse is one page of families. Its size is counted in root sessions. The page carries no global counts; the project picker is the count authority. Items are ordered by the last activity of each family's root session, newest first: the root's session_end, or its session_start when that is unknown, or its published_at when both are unknown. Items with the same last activity are ordered by the root's transcript id ascending. Helpers never affect the position of their family.
type VillageContributionProjectPage ¶ added in v0.62.0
type VillageContributionProjectPage struct {
Projects []VillageContributionProjectSummary `json:"projects" nullable:"false"`
NextCursor *string `json:"next_cursor,omitempty" nullable:"false" description:"The opaque cursor of the following page. Absent on the last page."`
HasMore bool `json:"has_more"`
// MatchingTotal is the sessions in all matching families.
MatchingTotal int `` /* 173-byte string literal not displayed */
// SelectableTotal is the sessions among them that are not already live.
SelectableTotal int `` /* 201-byte string literal not displayed */
Providers []VillageContributionProviderFacet `json:"providers" nullable:"false"`
}
VillageContributionProjectPage is one page of the project picker. Its page size is counted in projects; MatchingTotal, SelectableTotal and the provider counts are in sessions across every page.
type VillageContributionProjectSummary ¶ added in v0.62.0
type VillageContributionProjectSummary struct {
ProjectHash ProjectHash `json:"project_hash"`
ProjectDisplayName string `json:"project_display_name"`
ProjectNameSource VillageProjectNameSource `json:"project_name_source"`
RepositoryState *string `json:"repository_state,omitempty" nullable:"false"`
// MatchingCount is the sessions in the project's matching families.
MatchingCount int `` /* 165-byte string literal not displayed */
// SelectableCount is the sessions among them that are not already live.
SelectableCount int `` /* 182-byte string literal not displayed */
}
VillageContributionProjectSummary is one project in the picker. Its counts are in sessions: every transcript in the matching families whose root is in the project.
type VillageContributionProviderFacet ¶ added in v0.62.0
type VillageContributionProviderFacet struct {
Provider string `json:"provider"`
Count int `` /* 147-byte string literal not displayed */
}
VillageContributionProviderFacet counts the matching sessions of one model provider.
type VillageContributionSnapshotRecord ¶ added in v0.62.0
type VillageContributionSnapshotRecord struct {
ID TranscriptID `json:"id"`
// Title is the session's title, null when the session has none. It is the
// same value the session's contributable row carries.
Title *string `` /* 183-byte string literal not displayed */
Visibility VillageTranscriptVisibility `json:"visibility"`
// LatestStatus is the status of the latest contribution attempt; absence
// means no attempt.
LatestStatus *VillageShareStatus `` /* 133-byte string literal not displayed */
// ProjectHash is the session's own project, which may differ from the
// project of the root of its family.
ProjectHash ProjectHash `json:"project_hash" description:"The session's own project, which may differ from the project of the root of its family."`
ParentTranscriptID *TranscriptID `` /* 183-byte string literal not displayed */
}
VillageContributionSnapshotRecord is the compact record of one session in a snapshot: its identity, title, visibility, latest contribution status, own project and parent link, and nothing else. The title is carried so a client can name every session a person is asked to consent to, including sessions it never loaded as a row.
type VillageContributionSnapshotResponse ¶ added in v0.62.0
type VillageContributionSnapshotResponse struct {
GroupID VillageUUID `json:"group_id"`
ProjectHash ProjectHash `json:"project_hash" description:"The project of the family roots. Helpers in the records may belong to other projects."`
Records []VillageContributionSnapshotRecord `json:"records" nullable:"false"`
Count int `` /* 150-byte string literal not displayed */
}
VillageContributionSnapshotResponse is the exact selection set of one project: every session in every matching family whose root is in that project. It has no record-count cap, but the encoded response body is limited to VillageContributionSnapshotMaxBytes (8 MiB). A snapshot that would exceed the limit is refused whole with a 413 whose code is snapshot_too_large, and nothing partial is returned; the client narrows the search with q or provider and reads the snapshot again. The server may also refuse with the 503 codes snapshot_timeout or snapshot_busy. Count equals len(Records) and counts sessions, not roots.
func (VillageContributionSnapshotResponse) PrepareJSONSchema ¶ added in v0.62.0
func (VillageContributionSnapshotResponse) PrepareJSONSchema(s *jsonschema.Schema) error
PrepareJSONSchema states the size limit on the response component, which struct tags cannot describe.
type VillageContributionStatus ¶ added in v0.1.3
type VillageContributionStatus string
VillageContributionStatus is the status a new contribution can open in.
const ( VillageContributionStatusApproved VillageContributionStatus = "approved" VillageContributionStatusPending VillageContributionStatus = "pending" )
func (VillageContributionStatus) JSONSchema ¶ added in v0.1.3
func (VillageContributionStatus) JSONSchema() (jsonschema.Schema, error)
type VillageCreateAPIKeyRequest ¶ added in v0.61.0
type VillageCreateAPIKeyRequest struct {
Label string `json:"label,omitempty"`
}
type VillageCreateAttestationRequest ¶ added in v0.61.0
type VillageCreateAttestationRequest struct {
OrgLogin string `json:"org_login" minLength:"1"`
AttestationType VillageAttestationType `json:"attestation_type"`
Note string `json:"note,omitempty" description:"Empty or omitted stores no note (null)."`
}
--- transcripts
type VillageCreateCollectiveRequest ¶ added in v0.31.0
type VillageCreateCollectiveRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode,omitempty"`
DataAccess VillageGroupDataAccess `json:"data_access,omitempty"`
LinkedGithubOrg *string `json:"linked_github_org,omitempty"`
}
VillageCreateGroupRequest creates a collective. LinkedGithubOrg accepts null as "no organization", exactly as the update request does.
type VillageCreateGroupRequest
deprecated
added in
v0.1.3
type VillageCreateGroupRequest = VillageCreateCollectiveRequest
Deprecated: use VillageCreateCollectiveRequest.
type VillageCreatedAPIKey ¶ added in v0.61.0
type VillageCreatedAPIKey struct {
CreatedAt time.Time `` /* 130-byte string literal not displayed */
ID VillageUUID `json:"id"`
Key string `json:"key" description:"The plaintext key. Returned only here, once."`
Label string `json:"label" description:"The label as sent; an empty label is stored as null and listed as null."`
Prefix string `json:"prefix"`
}
Members in alphabetical order: the handler emitted a map.
type VillageDeprecatedGroupedContributableResponse
deprecated
added in
v0.31.0
type VillageDeprecatedGroupedContributableResponse struct {
GroupID VillageUUID `json:"groupId"`
TranscriptList VillageSessionListPayload `json:"transcriptList"`
}
VillageDeprecatedGroupedContributableResponse preserves the released grouped envelope on GET /api/v1/groups/{id}/contributable during the alias window.
Deprecated: use VillageGroupedContributableResponse on the collectives route.
func (VillageDeprecatedGroupedContributableResponse) Validate ¶ added in v0.31.0
func (r VillageDeprecatedGroupedContributableResponse) Validate() error
type VillageDiscoverabilityRequest ¶ added in v0.61.0
type VillageDiscoverabilityRequest struct {
IsDiscoverable *bool `json:"is_discoverable" required:"true" nullable:"false"`
}
--- account
type VillageEnrichedTranscriptShare ¶ added in v0.19.0
type VillageEnrichedTranscriptShare struct {
}
type VillageErrorResponse ¶ added in v0.1.3
type VillageErrorResponse struct {
Error string `json:"error"`
}
VillageErrorResponse is the common JSON refusal envelope emitted by Village handlers through writeError.
type VillageGitHubWebhookPayload ¶ added in v0.17.0
VillageGitHubWebhookPayload is GitHub's event payload, forwarded verbatim. Village verifies the HMAC over the raw body and reads only the fields the event needs, so the contract leaves the object open.
func (VillageGitHubWebhookPayload) JSONSchema ¶ added in v0.17.0
func (VillageGitHubWebhookPayload) JSONSchema() (jsonschema.Schema, error)
type VillageGroup
deprecated
added in
v0.1.3
type VillageGroup = VillageCollective
Deprecated: use VillageCollective. Retained for the complete alias release window.
type VillageGroupAcceptanceMode
deprecated
added in
v0.1.3
type VillageGroupAcceptanceMode = VillageCollectiveAcceptanceMode
Deprecated: use VillageCollectiveAcceptanceMode.
const ( VillageGroupAcceptanceOpen VillageGroupAcceptanceMode = "open" VillageGroupAcceptanceVerifiedOnly VillageGroupAcceptanceMode = "verified_only" VillageGroupAcceptanceCurated VillageGroupAcceptanceMode = "curated" )
func (VillageGroupAcceptanceMode) JSONSchema ¶ added in v0.1.3
func (VillageGroupAcceptanceMode) JSONSchema() (jsonschema.Schema, error)
type VillageGroupContributor
deprecated
added in
v0.1.3
type VillageGroupContributor = VillageCollectiveContributor
Deprecated: use VillageCollectiveContributor.
type VillageGroupDataAccess
deprecated
added in
v0.1.3
type VillageGroupDataAccess = VillageCollectiveDataAccess
Deprecated: use VillageCollectiveDataAccess.
const ( VillageGroupDataAccessMembersOnly VillageGroupDataAccess = "members_only" VillageGroupDataAccessContributors VillageGroupDataAccess = "contributors" VillageGroupDataAccessPublic VillageGroupDataAccess = "public" )
func (VillageGroupDataAccess) JSONSchema ¶ added in v0.1.3
func (VillageGroupDataAccess) JSONSchema() (jsonschema.Schema, error)
type VillageGroupDetailRecord
deprecated
added in
v0.19.0
type VillageGroupDetailRecord = VillageCollectiveDetailRecord
Deprecated: use VillageCollectiveDetailRecord.
func (VillageGroupDetailRecord) Validate ¶ added in v0.19.0
func (r VillageGroupDetailRecord) Validate() error
type VillageGroupDetailResponse
deprecated
added in
v0.1.3
type VillageGroupDetailResponse = VillageCollectiveDetailResponse
Deprecated: use VillageCollectiveDetailResponse.
type VillageGroupMember
deprecated
added in
v0.1.3
type VillageGroupMember = VillageCollectiveMember
Deprecated: use VillageCollectiveMember.
type VillageGroupMemberRoleRequest
deprecated
added in
v0.1.3
type VillageGroupMemberRoleRequest = VillageCollectiveMemberRoleRequest
Deprecated: use VillageCollectiveMemberRoleRequest.
type VillageGroupMemberUsernameRequest
deprecated
added in
v0.1.3
type VillageGroupMemberUsernameRequest = VillageCollectiveMemberUsernameRequest
Deprecated: use VillageCollectiveMemberUsernameRequest.
type VillageGroupModelBreakdown
deprecated
added in
v0.1.3
type VillageGroupModelBreakdown = VillageCollectiveModelBreakdown
Deprecated: use VillageCollectiveModelBreakdown.
type VillageGroupRole
deprecated
added in
v0.1.3
type VillageGroupRole = VillageCollectiveRole
Deprecated: use VillageCollectiveRole.
const ( VillageGroupRoleOwner VillageGroupRole = "owner" VillageGroupRoleMember VillageGroupRole = "member" VillageGroupRoleContributor VillageGroupRole = "contributor" VillageGroupRolePending VillageGroupRole = "pending" )
func (VillageGroupRole) JSONSchema ¶ added in v0.1.3
func (VillageGroupRole) JSONSchema() (jsonschema.Schema, error)
type VillageGroupStatusRoleResponse
deprecated
added in
v0.1.3
type VillageGroupStatusRoleResponse = VillageCollectiveStatusRoleResponse
Deprecated: use VillageCollectiveStatusRoleResponse.
type VillageGroupTranscript
deprecated
added in
v0.1.3
type VillageGroupTranscript = VillageCollectiveTranscript
Deprecated: use VillageCollectiveTranscript.
type VillageGroupTranscriptStats
deprecated
added in
v0.1.3
type VillageGroupTranscriptStats = VillageCollectiveTranscriptStats
Deprecated: use VillageCollectiveTranscriptStats.
type VillageGroupViewerRole
deprecated
added in
v0.1.3
type VillageGroupViewerRole = VillageCollectiveViewerRole
Deprecated: use VillageCollectiveViewerRole.
const ( VillageGroupViewerRoleNone VillageGroupViewerRole = "" VillageGroupViewerRoleOwner VillageGroupViewerRole = "owner" VillageGroupViewerRoleMember VillageGroupViewerRole = "member" VillageGroupViewerRoleContributor VillageGroupViewerRole = "contributor" VillageGroupViewerRolePending VillageGroupViewerRole = "pending" )
func (VillageGroupViewerRole) JSONSchema ¶ added in v0.1.3
func (VillageGroupViewerRole) JSONSchema() (jsonschema.Schema, error)
type VillageGroupedCollectiveDetailResponse ¶ added in v0.31.0
type VillageGroupedCollectiveDetailResponse struct {
Group VillageGroupDetailRecord `json:"group"`
Members []VillageGroupMember `json:"members" nullable:"false"`
Stats VillageGroupTranscriptStats `json:"stats"`
Models []VillageGroupModelBreakdown `json:"models" nullable:"false"`
Contributors []VillageGroupContributor `json:"contributors" nullable:"false"`
CanRead bool `json:"can_read"`
YourRole VillageGroupViewerRole `json:"your_role"`
TranscriptList VillageSessionListPayload `json:"transcriptList"`
PendingMembers []VillageGroupMember `json:"pending_members,omitempty" nullable:"false"`
}
type VillageGroupedContributableResponse ¶ added in v0.19.0
type VillageGroupedContributableResponse struct {
GroupID VillageUUID `json:"group_id"`
TranscriptList VillageSessionListPayload `json:"transcriptList"`
}
func (VillageGroupedContributableResponse) Validate ¶ added in v0.19.0
func (r VillageGroupedContributableResponse) Validate() error
type VillageGroupedGroupDetailResponse
deprecated
added in
v0.19.0
type VillageGroupedGroupDetailResponse = VillageGroupedCollectiveDetailResponse
Deprecated: use VillageGroupedCollectiveDetailResponse.
func (VillageGroupedGroupDetailResponse) Validate ¶ added in v0.19.0
func (r VillageGroupedGroupDetailResponse) Validate() error
type VillageHealthResponse ¶ added in v0.61.0
type VillageHealthResponse struct {
Status string `json:"status" description:"Always ok when the process answers."`
BuildRevision string `json:"buildRevision,omitempty" pattern:"^[0-9a-f]{7,12}$"`
Migrations *int64 `` /* 155-byte string literal not displayed */
Serves []string `` /* 214-byte string literal not displayed */
}
--- health
type VillageHelperMembersPayload ¶ added in v0.19.0
type VillageHelperMembersPayload struct {
Members []VillageSessionListItem `json:"members" nullable:"false"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
Limit int `json:"limit" minimum:"1" maximum:"9007199254740991"`
Total int `json:"total" minimum:"0" maximum:"9007199254740991"`
}
func (*VillageHelperMembersPayload) UnmarshalJSON ¶ added in v0.19.0
func (p *VillageHelperMembersPayload) UnmarshalJSON(raw []byte) error
func (VillageHelperMembersPayload) Validate ¶ added in v0.19.0
func (p VillageHelperMembersPayload) Validate() error
type VillageInvitedCollective ¶ added in v0.34.0
type VillageInvitedCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name" minLength:"1"`
Description *string `json:"description"`
AcceptanceMode VillageCollectiveAcceptanceMode `json:"acceptance_mode"`
}
VillageInvitedCollective is the collective an invitation names, as its invitee sees it. An invitation discloses this summary even when the collective is visible only to its members: deciding needs it.
type VillageLinkRepositoryRequest ¶ added in v0.1.3
type VillageLinkRepositoryRequest struct {
Owner string `json:"owner"`
Name string `json:"name"`
// InstallationID is the GitHub App installation that grants the App access
// to the repository. It is OPTIONAL: Village resolves the installation from
// the repository using the App's own credentials, so a caller that does not
// already know the id (for example a repository chosen from a picker) omits
// it. Supplying it is still accepted and is used as given.
InstallationID *int64 `json:"installation_id,omitempty"`
}
type VillageLinkedRepositoriesResponse ¶ added in v0.1.3
type VillageLinkedRepositoriesResponse struct {
Repositories []VillageLinkedRepository `json:"repositories" nullable:"false"`
}
type VillageLinkedRepository ¶ added in v0.1.3
type VillageLinkedRepository struct {
ID VillageUUID `json:"id"`
GroupID VillageUUID `json:"group_id"`
Owner string `json:"owner"`
Name string `json:"name"`
InstallationID int64 `json:"installation_id"`
IsPrivate bool `json:"is_private"`
LinkedBy VillagePublicOwner `json:"linked_by"`
LastSyncedAt *time.Time `json:"last_synced_at"`
CreatedAt *time.Time `json:"created_at"`
}
VillageLinkedRepository is one repository linked to a collective. LinkedBy is the person who linked it as this viewer may see them, resolved by the server per viewer.
type VillageListTranscriptAttestation ¶ added in v0.19.0
type VillageListTranscriptAttestation struct {
TranscriptID TranscriptID `json:"transcript_id"`
OrgLogin string `json:"org_login"`
AttestationType string `json:"attestation_type"`
CreatedAt time.Time `json:"created_at"`
}
type VillageListUserOrganization ¶ added in v0.19.0
type VillageListUserOrganization struct {
OrgLogin string `json:"org_login"`
AvatarURL *string `json:"avatar_url"`
}
VillageListUserOrganization is one visible organization of a listed transcript's owner. It carries no user id: the row it sits in already names its owner as the viewer may see them.
type VillageManualAnnotationRequest ¶ added in v0.61.0
type VillageManualAnnotationRequest struct {
TypeID string `json:"typeId" minLength:"1"`
Value string `json:"value" minLength:"1"`
EntryIndex *int `json:"entryIndex" required:"true" nullable:"false" minimum:"0"`
EndIndex *int `` /* 130-byte string literal not displayed */
IsPrimary bool `json:"isPrimary,omitempty"`
Reason *string `json:"reason,omitempty"`
}
type VillageMetadataUserOrganization ¶ added in v0.19.0
type VillageMyInvitationsResponse ¶ added in v0.34.0
type VillageMyInvitationsResponse struct {
Invitations []VillageCollectiveInvitation `json:"invitations" nullable:"false"`
}
VillageMyInvitationsResponse lists the caller's own pending invitations that have not expired. It never lists anyone else's.
func (VillageMyInvitationsResponse) Validate ¶ added in v0.34.0
func (r VillageMyInvitationsResponse) Validate() error
Validate refuses a list a producer must not emit.
type VillageNotificationEmail ¶ added in v0.34.0
type VillageNotificationEmail struct {
Address string `json:"address" minLength:"3" maxLength:"254"`
Verified bool `json:"verified"`
}
VillageNotificationEmail is the caller's own notification address. Verified is false until the caller confirms the address with the token Village emailed to it; Village sends invitation emails only to a verified address.
func (VillageNotificationEmail) Validate ¶ added in v0.34.0
func (e VillageNotificationEmail) Validate() error
Validate refuses an address a producer must not emit.
type VillageOrganizationCollective ¶ added in v0.31.0
type VillageOrganizationCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
MemberCount int32 `json:"member_count" minimum:"0"`
TranscriptCount int32 `json:"transcript_count" minimum:"0"`
}
VillageOrganizationCollective is the existing viewer-permitted collective projection returned by the organization read. It deliberately carries neither rosters nor a locally reconstructed visibility decision.
func (*VillageOrganizationCollective) UnmarshalJSON ¶ added in v0.31.0
func (v *VillageOrganizationCollective) UnmarshalJSON(data []byte) error
type VillageOrganizationCollectivesResponse ¶ added in v0.31.0
type VillageOrganizationCollectivesResponse struct {
Collectives []VillageOrganizationCollective `json:"collectives" nullable:"false"`
}
VillageOrganizationCollectivesResponse is the narrow metadata consumer view of GET /orgs/{login}. The existing endpoint also returns organization stats and members; additive fields are permitted but are not retained by this contract projection or used to derive permissions.
func (*VillageOrganizationCollectivesResponse) UnmarshalJSON ¶ added in v0.31.0
func (v *VillageOrganizationCollectivesResponse) UnmarshalJSON(data []byte) error
func (VillageOrganizationCollectivesResponse) Validate ¶ added in v0.31.0
func (v VillageOrganizationCollectivesResponse) Validate() error
type VillageOrganizationSearchResponse ¶ added in v0.61.0
type VillageOrganizationSearchResponse struct {
Organizations []VillageOrganizationSearchResult `json:"organizations" nullable:"false"`
}
type VillageOrganizationSearchResult ¶ added in v0.61.0
type VillageOrganizationSearchResult struct {
OrgLogin string `json:"org_login"`
AvatarURL *string `json:"avatar_url"`
MemberCount int32 `json:"member_count"`
TranscriptCount int32 `json:"transcript_count"`
}
--- organizations, tags
type VillageOrganizationVisibilityRequest ¶ added in v0.61.0
type VillageOrganizationVisibilityRequest struct {
Visible bool `json:"visible,omitempty" description:"Omitted means false."`
}
type VillageOrganizationVisibilityResponse ¶ added in v0.61.0
type VillagePendingShare ¶ added in v0.1.3
type VillagePendingShare struct {
ParentTranscriptID *TranscriptID `json:"parent_transcript_id"`
// ProjectHash, ProjectName and Branch identify the owner's repository, so
// each is null when the owner is anonymous to this viewer, as well as when
// it was not recorded.
}
VillagePendingShare is one submission awaiting a collective owner's review. Owner is the submitter as this viewer may see them.
func (VillagePendingShare) Validate ¶ added in v0.33.0
func (p VillagePendingShare) Validate() error
Validate checks the submitter and that an anonymous submitter's repository fields are null.
type VillageProjectCollective ¶ added in v0.61.0
type VillageProjectCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
LinkedGithubOrg *string `json:"linked_github_org"`
TranscriptCount int32 `json:"transcript_count" description:"Approved transcripts of this project in the collective."`
}
type VillageProjectDisplayNameRequest ¶ added in v0.61.0
type VillageProjectDisplayNameRequest struct {
DisplayName string `json:"display_name" description:"Trimmed; must be non-empty and at most 255 bytes."`
}
type VillageProjectNameSource ¶ added in v0.1.3
type VillageProjectNameSource string
VillageProjectNameSource is the closed set of tiers that can produce a resolved project display name.
const ( VillageProjectNameSourceOverride VillageProjectNameSource = "override" VillageProjectNameSourceConsented VillageProjectNameSource = "consented" VillageProjectNameSourceRemote VillageProjectNameSource = "remote" VillageProjectNameSourcePath VillageProjectNameSource = "path" VillageProjectNameSourcePrivacy VillageProjectNameSource = "privacy" )
func (VillageProjectNameSource) JSONSchema ¶ added in v0.1.3
func (VillageProjectNameSource) JSONSchema() (jsonschema.Schema, error)
type VillagePromptRequest ¶ added in v0.17.0
type VillagePromptRequest struct {
Owner string `json:"owner"`
Name string `json:"name"`
Number int `json:"number"`
State VillagePullRequestAttachmentState `json:"state"`
Remote string `json:"remote"`
HeadRemote string `json:"head_remote"`
RequestedAt time.Time `json:"requested_at"`
}
VillagePromptRequest is one attachment waiting on the caller's machine. Remote is the full name of the repository the pull request was opened against, and HeadRemote the full name of the repository its head came from: a fork's repository, or the base itself for a same-repository pull request. Together they let the CLI match the repository it is pushing, normalizing its own git remote first, without re-deriving either rule, so a push from a clone of a fork matches the request waiting on that fork's author.
type VillagePromptRequestsResponse ¶ added in v0.17.0
type VillagePromptRequestsResponse struct {
Requests []VillagePromptRequest `json:"requests" nullable:"false"`
}
type VillagePromptsCheckMode ¶ added in v0.17.0
type VillagePromptsCheckMode string
VillagePromptsCheckMode decides the check-run conclusion a collective's linked repositories receive when no prompts are attached.
const ( // VillagePromptsCheckInformational: neutral when nothing is attached. The default. VillagePromptsCheckInformational VillagePromptsCheckMode = "informational" // VillagePromptsCheckRequired: failure when nothing is attached, so branch protection can require prompts. VillagePromptsCheckRequired VillagePromptsCheckMode = "required" )
func (VillagePromptsCheckMode) IsValid ¶ added in v0.17.0
func (m VillagePromptsCheckMode) IsValid() bool
func (VillagePromptsCheckMode) JSONSchema ¶ added in v0.17.0
func (VillagePromptsCheckMode) JSONSchema() (jsonschema.Schema, error)
func (VillagePromptsCheckMode) String ¶ added in v0.17.0
func (m VillagePromptsCheckMode) String() string
type VillagePublicCollective ¶ added in v0.31.0
type VillagePublicCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode"`
DataAccess VillageGroupDataAccess `json:"data_access"`
LinkedGithubOrg *string `json:"linked_github_org"`
CreatedAt time.Time `json:"created_at"`
MemberCount int32 `json:"member_count"`
TranscriptCount int32 `json:"transcript_count"`
}
VillagePublicGroup is the compact row returned by GET /api/v1/groups/public.
type VillagePublicGroup
deprecated
added in
v0.1.3
type VillagePublicGroup = VillagePublicCollective
Deprecated: use VillagePublicCollective.
type VillagePublicOwner ¶ added in v0.33.0
type VillagePublicOwner struct {
Kind VillagePublicOwnerKind `json:"-"`
ID VillageUUID `json:"-"`
Username string `json:"-"`
DisplayName *string `json:"-"`
AvatarURL *string `json:"-"`
}
VillagePublicOwner is a person as another viewer sees them: the owner of a transcript, a collective member or contributor, or an annotation author.
The server resolves anonymity for each viewer. Consumers render what they receive and never re-derive the rule: they do not compare a discoverable flag, a membership, or a username to decide whether to show a person. The wire carries one of two shapes, selected by kind:
- profile: {"kind":"profile","id","username","display_name","avatar_url"}. id and username are required; display_name and avatar_url are always present and may be null.
- anonymous: {"kind":"anonymous"} and nothing else.
A viewer always receives their own profile, so "this is mine" is exactly IsAccount(viewerID): a profile whose id is the viewer's own. An anonymous value never matches.
Adding a kind is an additive contract change. Readers treat an unknown kind as anonymous (see VillagePublicOwnerKind).
The Go fields carry no JSON tags of their own: MarshalJSON and UnmarshalJSON own the wire shape, and JSONSchema declares it.
func AnonymousVillageOwner ¶ added in v0.33.0
func AnonymousVillageOwner() VillagePublicOwner
AnonymousVillageOwner returns the anonymous shape.
func NewVillagePublicProfile ¶ added in v0.33.0
func NewVillagePublicProfile(id VillageUUID, username string, displayName, avatarURL *string) VillagePublicOwner
NewVillagePublicProfile returns the profile shape of a person.
func (VillagePublicOwner) IsAccount ¶ added in v0.33.0
func (o VillagePublicOwner) IsAccount(account VillageUUID) bool
IsAccount reports whether the value is the profile of the given Village account. Readers use it for "is this mine": an anonymous value is never the viewer's, because the server always shows viewers their own profile.
func (VillagePublicOwner) IsProfile ¶ added in v0.33.0
func (o VillagePublicOwner) IsProfile() bool
IsProfile reports whether the value shows a person's profile. Every other kind, including one this contract version does not know, is anonymous.
func (VillagePublicOwner) JSONSchema ¶ added in v0.33.0
func (VillagePublicOwner) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer: exactly one closed object per kind, discriminated by a constant kind.
func (VillagePublicOwner) MarshalJSON ¶ added in v0.33.0
func (o VillagePublicOwner) MarshalJSON() ([]byte, error)
MarshalJSON emits exactly the field set of the value's kind. It refuses a value Validate refuses, so a producer cannot send identity on an anonymous value or an undefined kind.
func (*VillagePublicOwner) UnmarshalJSON ¶ added in v0.33.0
func (o *VillagePublicOwner) UnmarshalJSON(data []byte) error
UnmarshalJSON reads a person the way every reader must:
- profile requires every declared field and keeps only those;
- anonymous keeps nothing but its kind, whatever else arrives;
- a kind this contract version does not know decodes to AnonymousVillageOwner(), exactly as the generated TypeScript reader does, so no identity from the unknown shape is kept and re-encoding the decoded value always succeeds.
Fields a later version adds to a shape are ignored, as the generated TypeScript reader ignores them, so adding a field or a kind stays additive.
func (VillagePublicOwner) Validate ¶ added in v0.33.0
func (o VillagePublicOwner) Validate() error
Validate refuses a value a producer must not emit: an unknown kind, a profile without a canonical id or a username, or an anonymous value that carries any identifying field.
type VillagePublicOwnerKind ¶ added in v0.33.0
type VillagePublicOwnerKind string
VillagePublicOwnerKind selects how a person is shown to the viewer of a response: their public profile, or anonymous.
The set is closed for producers and open for readers. A later contract version may add a kind (for example an organization credit); a reader that meets a kind it does not know MUST treat the person as anonymous: it renders no identity and never infers one. VillagePublicOwner.UnmarshalJSON decodes such a kind to AnonymousVillageOwner() for Go readers.
const ( // VillagePublicOwnerProfile carries the person's public profile: id, // username, display name, and avatar. VillagePublicOwnerProfile VillagePublicOwnerKind = "profile" // VillagePublicOwnerAnonymous carries no identifying field at all, not // even an id: a stable id would link one anonymous person's transcripts. VillagePublicOwnerAnonymous VillagePublicOwnerKind = "anonymous" )
func (VillagePublicOwnerKind) IsValid ¶ added in v0.33.0
func (k VillagePublicOwnerKind) IsValid() bool
IsValid reports whether k is a kind this contract version defines.
func (VillagePublicOwnerKind) JSONSchema ¶ added in v0.33.0
func (VillagePublicOwnerKind) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (VillagePublicOwnerKind) String ¶ added in v0.33.0
func (k VillagePublicOwnerKind) String() string
type VillagePullRequestAttachedTranscript ¶ added in v0.17.0
type VillagePullRequestAttachedTranscript struct {
TranscriptID TranscriptID `json:"transcript_id"`
Position int `json:"position"`
PreviousVisibility VillageTranscriptVisibility `json:"previous_visibility"`
Title *string `json:"title"`
SessionStart *time.Time `json:"session_start"`
}
VillagePullRequestAttachedTranscript is one transcript in an attachment, in chain order, with the visibility to restore on detach.
type VillagePullRequestAttachment ¶ added in v0.17.0
type VillagePullRequestAttachment struct {
ID VillageUUID `json:"id"`
Owner string `json:"owner"`
Name string `json:"name"`
Number int `json:"number"`
Title *string `json:"title"`
HeadRef *string `json:"head_ref"`
HeadSHA string `json:"head_sha"`
IsPrivateRepository bool `json:"is_private_repository"`
State VillagePullRequestAttachmentState `json:"state"`
Author VillagePublicOwner `json:"author"`
RequestedBy *VillagePublicOwner `json:"requested_by"`
CommentID *int64 `json:"comment_id"`
CheckRunID *int64 `json:"check_run_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ConfirmedAt *time.Time `json:"confirmed_at"`
DetachedAt *time.Time `json:"detached_at"`
}
VillagePullRequestAttachment is one pull request's attachment row. Title and HeadRef are the pull request's title and head branch; they are null when Village does not know them.
Author is the pull request's author and RequestedBy the person who asked for prompts, each as this viewer may see them, resolved by the server per viewer. RequestedBy is null when no request was recorded. A requester without a Village account is anonymous, exactly like a hidden one, so the shape never reveals whether a GitHub user has a Village account.
type VillagePullRequestAttachmentResponse ¶ added in v0.17.0
type VillagePullRequestAttachmentResponse struct {
Attachment VillagePullRequestAttachment `json:"attachment"`
Digest *PromptDigest `json:"digest"`
Transcripts []VillagePullRequestAttachedTranscript `json:"transcripts" nullable:"false"`
ViewerIsAuthor bool `json:"viewer_is_author"`
}
VillagePullRequestAttachmentResponse is the read, confirm, and detach response. Digest is null until the attachment reaches preview or attached.
type VillagePullRequestAttachmentState ¶ added in v0.17.0
type VillagePullRequestAttachmentState string
VillagePullRequestAttachmentState is the closed lifecycle of one pull request's prompt attachment. The design's state machine names each transition; the wire only carries the current state.
const ( // VillagePullRequestAttachmentRequested: a non-author asked; nothing is exposed. VillagePullRequestAttachmentRequested VillagePullRequestAttachmentState = "requested" // VillagePullRequestAttachmentWaiting: the author consented; no matching transcript exists yet. VillagePullRequestAttachmentWaiting VillagePullRequestAttachmentState = "waiting" // VillagePullRequestAttachmentPreview: the digest is computed and awaits the author's confirm on Village. VillagePullRequestAttachmentPreview VillagePullRequestAttachmentState = "preview" // VillagePullRequestAttachmentAttached: the comment is posted and the transcripts are shared. VillagePullRequestAttachmentAttached VillagePullRequestAttachmentState = "attached" // VillagePullRequestAttachmentDetached: the comment is deleted and prior visibility restored. VillagePullRequestAttachmentDetached VillagePullRequestAttachmentState = "detached" )
func (VillagePullRequestAttachmentState) IsValid ¶ added in v0.17.0
func (s VillagePullRequestAttachmentState) IsValid() bool
func (VillagePullRequestAttachmentState) JSONSchema ¶ added in v0.17.0
func (VillagePullRequestAttachmentState) JSONSchema() (jsonschema.Schema, error)
func (VillagePullRequestAttachmentState) String ¶ added in v0.17.0
func (s VillagePullRequestAttachmentState) String() string
type VillagePullRequestRef ¶ added in v0.25.0
type VillagePullRequestRef struct {
Owner string `json:"owner" minLength:"1"`
Name string `json:"name" minLength:"1"`
Number int `json:"number" minimum:"1"`
}
VillagePullRequestRef names one pull request. A pull request the owner attached is shown even when the owner is anonymous; attaching is the owner's own act, and the pull request is public on GitHub. A later per-transcript credit choice may revisit this.
func (VillagePullRequestRef) Validate ¶ added in v0.25.0
func (r VillagePullRequestRef) Validate() error
Validate checks that the reference names a repository and a pull request.
type VillagePullRequestsSummary ¶ added in v0.25.0
type VillagePullRequestsSummary struct {
Count int32 `json:"count" minimum:"0"`
Recent []VillagePullRequestRef `json:"recent" nullable:"false"`
}
VillagePullRequestsSummary summarizes the pull requests a transcript is attached to, for a list row. Count is the number of pull requests whose attachment is in state attached and that the caller may read under the visibility rule of VillageTranscriptPullRequestsResponse, failing closed; detached pull requests are not counted. Recent holds the most recent of them, at most as many as the server shows, so a row reads "#42, #45 +2" without one read per row. A pull request the owner attached is shown even when the owner is anonymous; attaching is the owner's own act.
func (VillagePullRequestsSummary) Validate ¶ added in v0.25.0
func (s VillagePullRequestsSummary) Validate() error
Validate checks that the recent list fits in the count and does not repeat.
type VillageRemoveCollectiveMemberResponse ¶ added in v0.31.0
type VillageRemoveGroupMemberResponse
deprecated
added in
v0.1.3
type VillageRemoveGroupMemberResponse = VillageRemoveCollectiveMemberResponse
Deprecated: use VillageRemoveCollectiveMemberResponse.
type VillageRepositoryCommit ¶ added in v0.1.3
type VillageRepositoryCommitsResponse ¶ added in v0.1.3
type VillageResolvedProject ¶ added in v0.61.0
type VillageResolvedProject struct {
ProjectHash ProjectHash `json:"project_hash"`
ProjectDisplayName string `json:"project_display_name"`
ProjectNameSource VillageProjectNameSource `json:"project_name_source"`
ProjectRemoteLabel string `json:"project_remote_label"`
}
--- projects
type VillageReviewDecision ¶ added in v0.1.3
type VillageReviewDecision string
VillageReviewDecision is the closed decision menu for collective review actions.
const ( VillageReviewDecisionApproved VillageReviewDecision = "approved" VillageReviewDecisionRejected VillageReviewDecision = "rejected" )
func (VillageReviewDecision) JSONSchema ¶ added in v0.1.3
func (VillageReviewDecision) JSONSchema() (jsonschema.Schema, error)
type VillageReviewShareRequest ¶ added in v0.1.3
type VillageReviewShareRequest struct {
}
type VillageReviewShareResponse ¶ added in v0.1.3
type VillageReviewShareResponse struct {
}
type VillageSessionListItem ¶ added in v0.19.0
type VillageSessionListItem struct {
Kind SessionListItemKind `json:"kind"`
Transcript *VillageSessionRow `json:"transcript,omitempty"`
Context *HelperContextSummary `json:"context,omitempty"`
HelperGroups []HelperGroupSummary `json:"helperGroups,omitempty" nullable:"false"`
}
func (VillageSessionListItem) Validate ¶ added in v0.19.0
func (i VillageSessionListItem) Validate() error
type VillageSessionListPayload ¶ added in v0.19.0
type VillageSessionListPayload struct {
Items []VillageSessionListItem `json:"items" nullable:"false"`
Page int `json:"page" minimum:"1" maximum:"9007199254740991"`
Limit int `json:"limit" minimum:"1" maximum:"9007199254740991"`
TotalItems int `json:"totalItems" minimum:"0" maximum:"9007199254740991"`
OrdinarySessionTotal int `json:"ordinarySessionTotal" minimum:"0" maximum:"9007199254740991"`
HelperThreadTotal int `json:"helperThreadTotal" minimum:"0" maximum:"9007199254740991"`
}
func (VillageSessionListPayload) Validate ¶ added in v0.19.0
func (p VillageSessionListPayload) Validate() error
type VillageSessionRow ¶ added in v0.19.0
type VillageSessionRow struct {
Session VillageTranscript `json:"session"`
Owner VillagePublicOwner `json:"owner"`
Collective *VillageGroupTranscript `json:"collective,omitempty"`
Pending *VillagePendingShare `json:"pending,omitempty"`
Contributable *VillageContributableTranscript `json:"contributable,omitempty"`
}
VillageSessionRow preserves the complete transcript summary, its owner as this viewer may see them, and the one route-specific projection that produced it. A route arm that carries an owner mirrors Owner exactly.
func (VillageSessionRow) Validate ¶ added in v0.19.0
func (r VillageSessionRow) Validate() error
Validate checks the route arm and the shared identity and count mirrors.
type VillageSetNotificationEmailRequest ¶ added in v0.34.0
type VillageSetNotificationEmailRequest struct {
Address string `json:"address" minLength:"3" maxLength:"254"`
}
VillageSetNotificationEmailRequest sets the caller's notification address, replacing any earlier one, and makes Village email a verification token to it. The new address is unverified until that token is confirmed.
func (VillageSetNotificationEmailRequest) Validate ¶ added in v0.34.0
func (r VillageSetNotificationEmailRequest) Validate() error
Validate refuses an address a client must not send.
type VillageShareEvent ¶ added in v0.1.3
type VillageShareEvent struct {
}
func (*VillageShareEvent) UnmarshalJSON ¶ added in v0.31.0
func (v *VillageShareEvent) UnmarshalJSON(data []byte) error
func (VillageShareEvent) Validate ¶ added in v0.31.0
func (event VillageShareEvent) Validate() error
Validate checks the historical wire payload before reconciliation or emission. A null decided_at is valid for an initially auto-approved attempt and for rejected history recorded before the decision time was captured. In the rejected case the null is honest unknown evidence, not a decision time: callers must not infer one from recorded_at or from the ordinal.
type VillageShareEventActor ¶ added in v0.1.3
type VillageShareEventActor string
VillageShareEventActor is the actor class attached to one share event. It is an actor class, not a user identity.
const ( )
func VillageContributionAttemptActor ¶ added in v0.31.0
func VillageContributionAttemptActor(status VillageShareStatus) (VillageShareEventActor, error)
VillageContributionAttemptActor returns the status's actor capacity, not a moderator identity or proof that manual review occurred. Initial automatic approval has moderator capacity even without a decision timestamp.
func (VillageShareEventActor) JSONSchema ¶ added in v0.1.3
func (VillageShareEventActor) JSONSchema() (jsonschema.Schema, error)
type VillageShareStatus ¶ added in v0.1.3
type VillageShareStatus string
VillageShareStatus is the full share-attempt ledger status menu. Pending, approved, and rejected can appear in current projections; retracted and revoked are terminal states kept for the historical event ledger.
const ( )
func (VillageShareStatus) JSONSchema ¶ added in v0.1.3
func (VillageShareStatus) JSONSchema() (jsonschema.Schema, error)
type VillageShareTranscriptRequest ¶ added in v0.1.3
type VillageShareTranscriptRequest struct {
}
type VillageStatusResponse ¶ added in v0.1.3
type VillageStatusResponse struct {
Status string `json:"status"`
}
type VillageTag ¶ added in v0.19.0
type VillageTag struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
}
type VillageTagUsage ¶ added in v0.61.0
type VillageTagUsage struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
UsageCount int64 `json:"usage_count"`
}
type VillageTranscript ¶ added in v0.1.3
type VillageTranscript struct {
ID TranscriptID `json:"id"`
LocalID SessionID `json:"local_id"`
Title *string `json:"title"`
Description *string `json:"description"`
Visibility VillageTranscriptVisibility `json:"visibility"`
ModelProvider string `json:"model_provider"`
ModelName *string `json:"model_name"`
HarnessVersion *string `json:"harness_version"`
SessionStart *time.Time `json:"session_start"`
SessionEnd *time.Time `json:"session_end"`
TurnCount *int32 `` /* 299-byte string literal not displayed */
// ConversationTurnCount is the number of conversation turns as published;
// null means unmeasured.
ConversationTurnCount *int64 `json:"conversation_turn_count" minimum:"0" maximum:"9007199254740991"`
// DisplayedTurnCount is the count a reader is shown: conversation_turn_count
// when measured, else turn_count; resolved by the server.
DisplayedTurnCount *int64 `json:"displayed_turn_count" minimum:"0" maximum:"9007199254740991"`
TokenCount *int32 `json:"token_count"`
BlobSizeBytes *int64 `json:"blob_size_bytes"`
SchemaVersion string `json:"schema_version"`
PublishedAt time.Time `json:"published_at"`
UpdatedAt time.Time `json:"updated_at"`
ParentSessionID *SessionID `json:"parent_session_id"`
// ParentTranscriptID is the transcript published from the session named by
// ParentSessionID, resolved by the server at read time within the same
// owner, because a session id is unique only per owner and the owner's id
// is not on the wire. It is null when nothing started this session, when
// that session is not published, or when this viewer may not read it, so
// it never discloses a transcript the viewer cannot open. Readers group
// children under parents by this id, never by matching session ids.
ParentTranscriptID *TranscriptID `json:"parent_transcript_id"`
IngestedAt *time.Time `json:"ingested_at"`
SourceFormat *SourceFormat `json:"source_format"`
// The repository fields below (git_branch, git_remote, project_hash,
// project_name, project_display_name, project_name_source,
// project_remote_label) identify the owner's repository, so each is null
// when the owner is anonymous to this viewer, as well as when it was not
// recorded. The server decides; Validate refuses any of them beside an
// anonymous owner.
GitBranch *string `json:"git_branch"`
GitRemote *string `json:"git_remote"`
ProjectHash *ProjectHash `json:"project_hash"`
ProjectName *string `json:"project_name"`
ProjectDisplayName *string `json:"project_display_name"`
ProjectNameSource *VillageProjectNameSource `json:"project_name_source"`
ProjectRemoteLabel *string `json:"project_remote_label"`
ToolCallCount *int32 `json:"tool_call_count"`
SubagentCount *int32 `json:"subagent_count"`
DurationMs *int64 `json:"duration_ms"`
Subagents *[]map[string]interface{} `json:"subagents"`
DiagnosticsWarnings *[]DiagnosticEntry `json:"diagnostics_warnings"`
DiagnosticsPartial *bool `json:"diagnostics_partial"`
TokensIn *int64 `json:"tokens_in"`
TokensOut *int64 `json:"tokens_out"`
TitleGenerated *string `json:"title_generated"`
Outcome *SessionOutcome `json:"outcome"`
FilesTouched *int32 `json:"files_touched"`
LinesChanged *int32 `json:"lines_changed"`
RetryLoops *int32 `json:"retry_loops"`
RetryTokensWasted *int32 `json:"retry_tokens_wasted"`
WithinSessionReverts *int32 `json:"within_session_reverts"`
SignalDensity *float32 `json:"signal_density"`
SpecQualityScore *float32 `json:"spec_quality_score"`
ExplorationRatio *float32 `json:"exploration_ratio"`
ScopeBreadth *int32 `json:"scope_breadth"`
DiscoveryTurns *int32 `json:"discovery_turns"`
M2TokenOutcomeRatio *float32 `json:"m2_token_outcome_ratio"`
M3UniqueToolCount *int32 `json:"m3_unique_tool_count"`
M4ErrorRecoveryCount *int32 `json:"m4_error_recovery_count"`
M4ConsecutiveErrorMax *int32 `json:"m4_consecutive_error_max"`
M5ContextUtilizationPct *float32 `json:"m5_context_utilization_pct"`
M5PeakContextTokens *int32 `json:"m5_peak_context_tokens"`
M5AvgMessageTokens *int32 `json:"m5_avg_message_tokens"`
M6OutputSurvivalPct *float32 `json:"m6_output_survival_pct"`
M6LinesSurvived *int32 `json:"m6_lines_survived"`
M6LinesTotal *int32 `json:"m6_lines_total"`
M7SpecWordCount *int32 `json:"m7_spec_word_count"`
M7SpecHasExamples *bool `json:"m7_spec_has_examples"`
M7SpecHasConstraints *bool `json:"m7_spec_has_constraints"`
ComputedAt *time.Time `json:"computed_at"`
ComputeVersion *int32 `json:"compute_version"`
ContentHash *TranscriptContentHash `json:"content_hash"`
LicenseID *License `json:"license_id"`
SessionOrigin SessionOrigin `json:"session_origin"`
InputSubmissionCount *int64 `json:"input_submission_count,omitempty" minimum:"0" maximum:"9007199254740991" nullable:"false"`
RootSessionID *SessionID `json:"root_session_id,omitempty"`
Purpose SessionPurpose `json:"purpose,omitempty"`
Relationships []SessionRelationship `json:"relationships,omitempty"`
}
VillageTranscript is the current transcript row projection used by Village web list and collective routes. Storage object keys and source-machine paths are not part of this public projection, and neither is the owner: every envelope that carries a transcript carries its owner beside it as a VillagePublicOwner, resolved for the viewer.
type VillageTranscriptAnnotationsResponse ¶ added in v0.61.0
type VillageTranscriptAnnotationsResponse struct {
Annotations []AnnotationSummary `json:"annotations" nullable:"false"`
}
type VillageTranscriptAttestation ¶ added in v0.19.0
type VillageTranscriptAttestation struct {
ID VillageUUID `json:"id"`
TranscriptID TranscriptID `json:"transcript_id"`
OrgLogin string `json:"org_login"`
AttestationType string `json:"attestation_type"`
Note *string `json:"note"`
CreatedAt time.Time `json:"created_at"`
Attester VillagePublicOwner `json:"attester"`
}
VillageTranscriptAttestation is one organization's attestation on a transcript. Attester is the person who made it as this viewer may see them, resolved by the server per viewer, so an anonymous owner attesting their own transcript stays anonymous here too.
type VillageTranscriptCollective ¶ added in v0.1.3
type VillageTranscriptCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
LinkedGithubOrg *string `json:"linked_github_org"`
}
type VillageTranscriptCollectivesResponse ¶ added in v0.1.3
type VillageTranscriptCollectivesResponse struct {
Collectives []VillageTranscriptCollective `json:"collectives" nullable:"false"`
}
type VillageTranscriptCommit ¶ added in v0.61.0
type VillageTranscriptCommit struct {
Sha string `json:"sha"`
Message *string `` /* 241-byte string literal not displayed */
AuthorName *string `` /* 196-byte string literal not displayed */
AuthorEmail *string `` /* 198-byte string literal not displayed */
AuthoredAt *int64 `json:"authoredAt" format:"int64" description:"Unix milliseconds."`
CommittedAt *int64 `json:"committedAt" format:"int64" description:"Unix milliseconds."`
Order int32 `json:"order"`
}
type VillageTranscriptCommitsResponse ¶ added in v0.61.0
type VillageTranscriptCommitsResponse struct {
Commits []VillageTranscriptCommit `json:"commits" nullable:"false"`
}
type VillageTranscriptDeletionPolicy ¶ added in v0.1.3
type VillageTranscriptDeletionPolicy string
VillageTranscriptDeletionPolicy is the closed policy menu used when a member leaves a collective.
const ( VillageTranscriptDeletionUserChoice VillageTranscriptDeletionPolicy = "user_choice" VillageTranscriptDeletionMandatory VillageTranscriptDeletionPolicy = "mandatory" )
func (VillageTranscriptDeletionPolicy) JSONSchema ¶ added in v0.1.3
func (VillageTranscriptDeletionPolicy) JSONSchema() (jsonschema.Schema, error)
type VillageTranscriptIntegrity ¶ added in v0.37.0
type VillageTranscriptIntegrity struct {
FlaggedTurns []int `` /* 296-byte string literal not displayed */
}
VillageTranscriptIntegrity is served when the transcript is flagged, to every caller allowed to read it; presence is the flag. FlaggedTurns are zero-based positions in the top-level SessionDetailPayload.turns array of the content whose bare hash is the same response's transcript.content_hash (never TurnDetail.index values, never positions in earlierHistory or child sessions); empty when the flag is sticky and the current copy has no flagged turn.
func (VillageTranscriptIntegrity) PrepareJSONSchema ¶ added in v0.37.0
func (VillageTranscriptIntegrity) PrepareJSONSchema(s *jsonschema.Schema) error
PrepareJSONSchema bounds every flagged_turns item, which struct tags cannot reach.
func (*VillageTranscriptIntegrity) UnmarshalJSON ¶ added in v0.37.0
func (i *VillageTranscriptIntegrity) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown members and a null flagged_turns.
func (VillageTranscriptIntegrity) Validate ¶ added in v0.37.0
func (i VillageTranscriptIntegrity) Validate() error
Validate refuses a null, unsorted, repeated or out-of-range position. The turn count is not on this body; village holds the content and bounds the positions against it.
type VillageTranscriptListResponse ¶ added in v0.19.0
type VillageTranscriptListResponse struct {
Transcripts []VillageTranscriptListRow `json:"transcripts" nullable:"false"`
// NextItems is the following page's rows, up to per_page of them, so a
// client can pre-compute the group keys of the next page without a second
// request. Only an empty NextItems means the traversal is done.
NextItems []VillageTranscriptListRow `json:"next_items" nullable:"false"`
Total int `json:"total"`
AgentTotal int `json:"agent_total"`
Page int `json:"page"`
// PerPage is the page size the requested page was read at and the most
// rows NextItems can carry. The server echoes the requested page and does
// not clamp it.
PerPage int `json:"per_page"`
}
func (VillageTranscriptListResponse) Validate ¶ added in v0.19.0
func (r VillageTranscriptListResponse) Validate() error
type VillageTranscriptListRow ¶ added in v0.19.0
type VillageTranscriptListRow struct {
Transcript VillageTranscript `json:"transcript"`
Tags []VillageTag `json:"tags" nullable:"false"`
Owner VillagePublicOwner `json:"owner"`
OwnerOrgs []VillageListUserOrganization `json:"owner_orgs"`
Attestations []VillageListTranscriptAttestation `json:"attestations"`
// PullRequests is shown even when Owner is anonymous: a pull request the
// owner attached is public by the owner's own act.
PullRequests VillagePullRequestsSummary `json:"pull_requests"`
}
VillageTranscriptListRow is one flat transcript list row. Owner is the transcript's owner as this viewer may see them; OwnerOrgs is empty when Owner is anonymous, because an organization login can identify a person.
type VillageTranscriptMetadataResponse ¶ added in v0.19.0
type VillageTranscriptMetadataResponse struct {
Transcript VillageTranscript `json:"transcript"`
Tags []VillageTag `json:"tags" nullable:"false"`
Owner VillagePublicOwner `json:"owner"`
OwnerOrgs []VillageMetadataUserOrganization `json:"owner_orgs" nullable:"false"`
Attestations []VillageTranscriptAttestation `json:"attestations" nullable:"false"`
// Integrity is present only when the transcript has an open scry flag; served
// to every caller allowed to read the transcript.
Integrity *VillageTranscriptIntegrity `json:"integrity,omitempty" nullable:"false"`
}
VillageTranscriptMetadataResponse is the existing flat transcript metadata response plus viewer-authorized relationship navigation. Durable content remains separate on the content endpoint. Owner is the transcript's owner as this viewer may see them; OwnerOrgs is empty when Owner is anonymous, because an organization login can identify a person.
func (VillageTranscriptMetadataResponse) Validate ¶ added in v0.19.0
func (r VillageTranscriptMetadataResponse) Validate() error
type VillageTranscriptPullRequest ¶ added in v0.25.0
type VillageTranscriptPullRequest struct {
Owner string `json:"owner" minLength:"1"`
Name string `json:"name" minLength:"1"`
Number int `json:"number" minimum:"1"`
Title *string `json:"title"`
HeadRef *string `json:"head_ref"`
State VillagePullRequestAttachmentState `json:"state"`
}
VillageTranscriptPullRequest is one pull request that includes a transcript, for the transcript page's list. It names the pull request and carries its title and head branch when Village knows them. It is narrower than the attachment row on purpose: a reader of a transcript needs to recognize the pull request, not the attachment's internal bookkeeping.
func (VillageTranscriptPullRequest) Validate ¶ added in v0.25.0
func (p VillageTranscriptPullRequest) Validate() error
Validate checks the reference and the state. The read lists only attached and detached pull requests, so a pending request never reaches a reader.
type VillageTranscriptPullRequestsResponse ¶ added in v0.25.0
type VillageTranscriptPullRequestsResponse struct {
PullRequests []VillageTranscriptPullRequest `json:"pull_requests" nullable:"false"`
// UnverifiedPullRequests is separate from attachments; omission means unsupported and [] means no evidence.
UnverifiedPullRequests *[]UnverifiedPullRequest `json:"unverified_pull_requests,omitempty" nullable:"false"`
}
VillageTranscriptPullRequestsResponse is the response of GET /api/v1/transcripts/{id}/pulls: the pull requests that include the transcript, attached or detached, that the caller may read. This is the visibility rule the pull request counts refer to: an attachment on a private repository is listed only to the pull request author, a member of the collective the attachment belongs to, or, for an attached attachment, a reader of the repository, and one whose visibility check cannot complete is omitted.
func (*VillageTranscriptPullRequestsResponse) UnmarshalJSON ¶ added in v0.36.0
func (r *VillageTranscriptPullRequestsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON preserves omission while rejecting an explicit null array.
func (VillageTranscriptPullRequestsResponse) Validate ¶ added in v0.25.0
func (r VillageTranscriptPullRequestsResponse) Validate() error
Validate checks each pull request and that each appears once.
type VillageTranscriptShare ¶ added in v0.1.3
type VillageTranscriptShare struct {
}
type VillageTranscriptVisibility ¶ added in v0.1.3
type VillageTranscriptVisibility string
VillageTranscriptVisibility is the current Village transcript visibility menu. It deliberately uses the Village token shared, not the publish-contract token group used by Visibility.
const ( VillageTranscriptVisibilityPrivate VillageTranscriptVisibility = "private" VillageTranscriptVisibilityPublic VillageTranscriptVisibility = "public" )
func (VillageTranscriptVisibility) JSONSchema ¶ added in v0.1.3
func (VillageTranscriptVisibility) JSONSchema() (jsonschema.Schema, error)
type VillageUUID ¶ added in v0.1.3
type VillageUUID string
VillageUUID is the canonical lowercase UUID string form the Village emits for users, collectives, repositories, and other server-owned rows.
func (VillageUUID) JSONSchema ¶ added in v0.1.3
func (VillageUUID) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (VillageUUID) String ¶ added in v0.1.3
func (id VillageUUID) String() string
type VillageUpdateCollectiveRequest ¶ added in v0.31.0
type VillageUpdateCollectiveRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
DataAccess VillageGroupDataAccess `json:"data_access,omitempty"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode,omitempty"`
LinkedGithubOrg *string `json:"linked_github_org,omitempty"`
DisplayMembers *bool `json:"display_members,omitempty"`
TranscriptDeletionPolicy VillageTranscriptDeletionPolicy `json:"transcript_deletion_policy,omitempty"`
PostPromptsCheck *bool `json:"post_prompts_check,omitempty"`
PromptsCheckMode VillagePromptsCheckMode `json:"prompts_check_mode,omitempty"`
}
VillageUpdateGroupRequest mirrors the current update handler. Name and description are decoded as strings and are written even when omitted, so a caller that wants to preserve them must send their current values.
type VillageUpdateGroupRequest
deprecated
added in
v0.1.3
type VillageUpdateGroupRequest = VillageUpdateCollectiveRequest
Deprecated: use VillageUpdateCollectiveRequest.
type VillageUpdateUserSettingsRequest ¶ added in v0.17.0
type VillageUpdateUserSettingsRequest struct {
PreviewBeforeAttach *bool `json:"preview_before_attach,omitempty"`
AutoAttachPullRequests *bool `json:"auto_attach_pull_requests,omitempty"`
EmailInvitations *bool `json:"email_invitations,omitempty"`
IsDiscoverable *bool `json:"is_discoverable,omitempty" nullable:"false"`
}
VillageUpdateUserSettingsRequest patches the caller's settings. An absent field keeps the stored value. The notification address itself is set, verified, and removed through its own operations, because setting it sends mail.
type VillageUser ¶ added in v0.19.0
type VillageUser struct {
ID VillageUUID `json:"id"`
GithubID int64 `json:"github_id"`
GithubUsername string `json:"github_username"`
DisplayName *string `json:"display_name"`
AvatarURL *string `json:"avatar_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
IsDiscoverable bool `json:"is_discoverable"`
Provider string `json:"provider"`
ProviderUserID string `json:"provider_user_id"`
UsernameChosen bool `json:"username_chosen"`
ProviderUsername *string `json:"provider_username"`
PreviewBeforeAttach bool `json:"preview_before_attach"`
AutoAttachPullRequests bool `json:"auto_attach_pull_requests"`
}
VillageUser is the caller's own complete account record, returned only to that account (GET /api/v1/auth/me). A response that shows a person to anyone else carries a VillagePublicOwner instead.
type VillageUserCollective ¶ added in v0.31.0
type VillageUserCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
Creator VillagePublicOwner `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode"`
DataAccess VillageGroupDataAccess `json:"data_access"`
LinkedGithubOrg *string `json:"linked_github_org"`
DisplayMembers bool `json:"display_members"`
TranscriptDeletionPolicy VillageTranscriptDeletionPolicy `json:"transcript_deletion_policy"`
Role VillageGroupRole `json:"role"`
MemberSince time.Time `json:"member_since"`
MemberCount int32 `json:"member_count"`
TranscriptCount int32 `json:"transcript_count"`
}
VillageUserGroup is one collective the signed-in caller belongs to.
type VillageUserCollectiveShare ¶ added in v0.31.0
type VillageUserCollectiveShare struct {
// null means unmeasured.
ConversationTurnCount *int64 `json:"conversation_turn_count" minimum:"0" maximum:"9007199254740991"`
// DisplayedTurnCount is the count a reader is shown: conversation_turn_count
// when measured, else turn_count; resolved by the server.
ParentTranscriptID *TranscriptID `json:"parent_transcript_id"`
// Status uses the shared lifecycle enum. Current my-shares responses emit the
// live subset today; terminal values are reserved for ledger history.
}
VillageUserCollectiveShare is one of the caller's own live submissions. Owner is the caller's own profile.
type VillageUserGroup
deprecated
added in
v0.1.3
type VillageUserGroup = VillageUserCollective
Deprecated: use VillageUserCollective.
type VillageUserGroupShare
deprecated
added in
v0.1.3
type VillageUserGroupShare = VillageUserCollectiveShare
Deprecated: use VillageUserCollectiveShare.
type VillageUserProjectResponse ¶ added in v0.61.0
type VillageUserProjectResponse struct {
Collectives []VillageProjectCollective `json:"collectives" nullable:"false"`
Owner VillagePublicOwner `json:"owner"`
Project VillageResolvedProject `json:"project"`
Transcripts []VillageTranscript `json:"transcripts" nullable:"false"`
}
type VillageUserSettings ¶ added in v0.17.0
type VillageUserSettings struct {
PreviewBeforeAttach bool `json:"preview_before_attach"`
AutoAttachPullRequests bool `json:"auto_attach_pull_requests"`
NotificationEmail *VillageNotificationEmail `json:"notification_email"`
EmailInvitations bool `json:"email_invitations"`
IsDiscoverable bool `json:"is_discoverable"`
}
VillageUserSettings is the caller's own settings surface. AutoAttachPullRequests is the caller's choice to link their own transcripts to a pull request automatically when it opens in a repository one of their collectives links. It is off by default and never changes who can read a transcript.
NotificationEmail is the caller's own notification address, or null when they have given none. It is the only response in the contract that carries an email address, and only its owner receives it. EmailInvitations is the caller's choice to be emailed when a collective invites them; it is on by default and takes effect only once the address is verified. The one-click unsubscribe link in an invitation email turns it off.
IsDiscoverable controls whether the caller's profile is publicly discoverable.
func (VillageUserSettings) Validate ¶ added in v0.34.0
func (s VillageUserSettings) Validate() error
Validate refuses settings a producer must not emit.
type VillageUserStats ¶ added in v0.25.0
type VillageUserStats struct {
TotalTranscripts int32 `json:"total_transcripts" minimum:"0"`
TotalTurns int64 `json:"total_turns" minimum:"0"`
TotalDurationMs int64 `json:"total_duration_ms" minimum:"0"`
TotalTokens int64 `json:"total_tokens" minimum:"0"`
PullRequestCount int32 `json:"pull_request_count" minimum:"0"`
}
VillageUserStats is the response of GET /api/v1/users/me/stats: totals over every transcript the caller published. PullRequestCount counts the distinct pull requests whose attachment is in state attached, includes one of those transcripts, and that the caller may read under the visibility rule of VillageTranscriptPullRequestsResponse, failing closed; detached pull requests are not counted.
func (VillageUserStats) Validate ¶ added in v0.25.0
func (s VillageUserStats) Validate() error
Validate checks that every total is nonnegative.
type VillageUsernameRequest ¶ added in v0.61.0
type VillageUsernameRequest struct {
Username string `json:"username" description:"Trimmed and lowercased, then matched against ^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$"`
}
type VillageVerifyNotificationEmailRequest ¶ added in v0.34.0
type VillageVerifyNotificationEmailRequest struct {
Token string `json:"token" minLength:"1"`
}
VillageVerifyNotificationEmailRequest confirms the caller's notification address with the token Village emailed to it.
type VillageVisibleCollective ¶ added in v0.31.0
type VillageVisibleCollective struct {
ID VillageUUID `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
Creator VillagePublicOwner `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AcceptanceMode VillageGroupAcceptanceMode `json:"acceptance_mode"`
DataAccess VillageGroupDataAccess `json:"data_access"`
LinkedGithubOrg *string `json:"linked_github_org"`
DisplayMembers bool `json:"display_members"`
TranscriptDeletionPolicy VillageTranscriptDeletionPolicy `json:"transcript_deletion_policy"`
Role *VillageGroupRole `json:"role"`
MemberSince *time.Time `json:"member_since"`
MemberCount int32 `json:"member_count"`
TranscriptCount int32 `json:"transcript_count"`
}
VillageVisibleGroup is one collective the signed-in caller may see. Role and member_since are null when the caller can see the collective but is not a member.
type VillageVisibleGroup
deprecated
added in
v0.1.3
type VillageVisibleGroup = VillageVisibleCollective
Deprecated: use VillageVisibleCollective.
type Visibility ¶
type Visibility string
Visibility controls who can access a published transcript.
const ( VisibilityPrivate Visibility = "private" VisibilityGroup Visibility = "group" VisibilityPublic Visibility = "public" )
func (Visibility) IsValid ¶
func (v Visibility) IsValid() bool
IsValid returns true if the visibility is one of the known variants.
func (Visibility) JSONSchema ¶
func (Visibility) JSONSchema() (jsonschema.Schema, error)
JSONSchema implements jsonschema.Exposer.
func (Visibility) String ¶
func (v Visibility) String() string
type VisibilityIntent ¶
type VisibilityIntent string
VisibilityIntent is the private-before-replacement visibility intent. Public intent never widens access during publish; widening is a separate owner update.
const ( VisibilityIntentPrivate VisibilityIntent = "private" VisibilityIntentPublic VisibilityIntent = "public" )
func (VisibilityIntent) IsValid ¶
func (v VisibilityIntent) IsValid() bool
func (VisibilityIntent) JSONSchema ¶
func (v VisibilityIntent) JSONSchema() (jsonschema.Schema, error)
type WalkthroughStep ¶
type WalkthroughStep struct {
File string `json:"file"`
Line *int `json:"line,omitempty"`
Excerpt string `json:"excerpt"`
}
WalkthroughStep is a single file visit in a session trail.
type WalkthroughTrail ¶
type WalkthroughTrail struct {
SessionID string `json:"sessionId"`
Title string `json:"title"`
Date string `json:"date"`
TurnCount int `json:"turnCount" description:"Trail size as the producer computes it; not a session turn count."`
Steps []WalkthroughStep `json:"steps"`
IsCoherent bool `json:"isCoherent"` // true if linear path, false if scattered
}
WalkthroughTrail is the file path extracted from a single session.
type WeekAvgDuration ¶ added in v0.42.0
type WeekAvgDuration struct {
Week string `json:"week"`
AvgDurationMins float64 `json:"avgDurationMins" minimum:"0"`
Sessions int `json:"sessions" minimum:"0" maximum:"9007199254740991"`
}
WeekAvgDuration is one bucket of the per-active-week average-duration series.
type WeekContributors ¶ added in v0.42.0
type WeekContributors struct {
Week string `json:"week"`
Contributors int `json:"contributors" minimum:"0" maximum:"9007199254740991"`
}
WeekContributors is one bucket of the per-week unique-contributor series.
type WeekCount ¶ added in v0.42.0
type WeekCount struct {
Week string `json:"week"`
Count int `json:"count" minimum:"0" maximum:"9007199254740991"`
}
WeekCount is one bucket of the per-week session-count series. Week is the Monday-of-week UTC date key (YYYY-MM-DD).
type WeekNewContributors ¶ added in v0.42.0
type WeekNewContributors struct {
Week string `json:"week"`
NewContributors int `json:"newContributors" minimum:"0" maximum:"9007199254740991"`
}
WeekNewContributors is one bucket of the new-contributor series: the contributors whose first-ever session falls in that week.
Source Files
¶
- annotation.go
- annotation_enums.go
- annotation_errors.go
- annotation_manifest.go
- annotation_push_request_validate.go
- annotation_push_validate.go
- annotation_registry.go
- annotation_summary_validate.go
- annotation_validate.go
- attachment_route.go
- auth.go
- child_sessions_page.go
- collective_compatibility.go
- collective_contribution_attempt.go
- collective_decode.go
- collective_fetch.go
- collective_observations.go
- command.go
- command_invocation.go
- content.go
- content_capability.go
- content_hash.go
- content_parts.go
- contract_embeds.go
- detail_raw_shape.go
- enum_schema.go
- fixtures.go
- generate.go
- grouped_read_decode.go
- helper_group.go
- identity.go
- jsonschema_compiler.go
- local_api.go
- local_kickstart_api.go
- local_kickstart_preview_stream.go
- local_owner_api.go
- local_publications_api.go
- local_settings_api.go
- local_sync_api.go
- local_sync_page.go
- map_api.go
- metadata.go
- model.go
- owner_update_successor.go
- pagination.go
- prompt_digest.go
- publication_contract.go
- publication_decode.go
- publish.go
- publish_validate.go
- published_association_validate.go
- pull.go
- pull_skip_gate.go
- push_content.go
- quality.go
- redactions.go
- remote_label.go
- retained_unknown.go
- scry.go
- search_api.go
- session_extras.go
- session_graph.go
- specs.go
- specs_embed_gen.go
- testdata_annotations.go
- testdata_attachment_route.go
- testdata_content_capability.go
- testdata_content_parts.go
- testdata_owner_update.go
- testdata_publish.go
- testdata_publish_run.go
- testdata_pull.go
- testdata_quality.go
- testdata_session_graph.go
- testdata_session_graph_durable.go
- testdata_session_origin.go
- testdata_session_teammate.go
- testdata_session_teammate_bounds.go
- testdata_timeline.go
- thinking_level.go
- transcript_capture.go
- transcript_capture_decode.go
- transcript_content_header.go
- transcript_cook_facts.go
- transcript_cook_turn.go
- transcript_cut.go
- transcript_download.go
- transcript_entry_locate.go
- transcript_header_etag.go
- transcript_numbering.go
- transcript_outline.go
- transcript_positioned.go
- transcript_positioned_raw.go
- transcript_positioned_window.go
- transcript_representation.go
- transcript_served_turn.go
- transcript_update.go
- transcript_wire_members.go
- types.go
- unverified_pull_request.go
- usage_metadata.go
- versions.go
- village_account_api.go
- village_api.go
- village_contribution_api.go
- village_integrity_api.go
- village_invitations_api.go
- village_organization_collectives.go
- village_public_owner.go
- village_pulls_api.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gen-enum-corpora
command
Command gen-enum-corpora writes the Local API 0.5.0 enum-exhaustion corpora to their committed artifacts.
|
Command gen-enum-corpora writes the Local API 0.5.0 enum-exhaustion corpora to their committed artifacts. |
|
gen-license-corpus
command
Command gen-license-corpus writes the enum-exhaustion license corpus to the committed artifact.
|
Command gen-license-corpus writes the enum-exhaustion license corpus to the committed artifact. |
|
release-guard
command
Command release-guard validates release tags for the release workflows.
|
Command release-guard validates release tags for the release workflows. |
|
schema-gen
command
|
|
|
Package commandpr detects pull requests created by a recorded shell command.
|
Package commandpr detects pull requests created by a recorded shell command. |
|
Package enumcorpus generates the enum-exhaustion test corpora for the Local API 0.5.0 git+session timeline and insight-first code map closed sets (AssociationConclusion, AssociationEvidenceKind, Confidence, RewriteResolution, RewriteMethod, InsightKind, InsightProvenance, ReadAttributionState, ReadStateGrade) plus a regenerated TargetKind corpus (the file_version member added in the same tag).
|
Package enumcorpus generates the enum-exhaustion test corpora for the Local API 0.5.0 git+session timeline and insight-first code map closed sets (AssociationConclusion, AssociationEvidenceKind, Confidence, RewriteResolution, RewriteMethod, InsightKind, InsightProvenance, ReadAttributionState, ReadStateGrade) plus a regenerated TargetKind corpus (the file_version member added in the same tag). |
|
internal
|
|
|
contractgates
Package contractgates holds the SYNTHETIC-BREAK tests for the schema repo's breaking-change contract gates: oasdiff for the OpenAPI specs and go-apidiff for the exported Go API.
|
Package contractgates holds the SYNTHETIC-BREAK tests for the schema repo's breaking-change contract gates: oasdiff for the OpenAPI specs and go-apidiff for the exported Go API. |
|
release
Package release holds the tag grammar and typed release-kind derivation.
|
Package release holds the tag grammar and typed release-kind derivation. |
|
Package licensecorpus generates the enum-exhaustion test corpus for the closed license menu (schema.AllLicenses).
|
Package licensecorpus generates the enum-exhaustion test corpus for the closed license menu (schema.AllLicenses). |
|
Package openapi builds the committed OpenAPI 3.1 / JSON-Schema artifacts from the Go schema source.
|
Package openapi builds the committed OpenAPI 3.1 / JSON-Schema artifacts from the Go schema source. |
|
Package route holds one typed member per operation that the Village API and Local API documents declare.
|
Package route holds one typed member per operation that the Village API and Local API documents declare. |
|
Package testcase is the pure-data foundation for this module's canonical test-case corpus: a typed, generic Case/Corpus model with closed-set classification and provenance metadata, a pure YAML loader, and pure validators.
|
Package testcase is the pure-data foundation for this module's canonical test-case corpus: a typed, generic Case/Corpus model with closed-set classification and provenance metadata, a pure YAML loader, and pure validators. |
|
assert
Package assert is the testing seam for the test-case corpus: helpers that take *testing.T and fail a test when a corpus violates its own invariants.
|
Package assert is the testing seam for the test-case corpus: helpers that take *testing.T and fail a test when a corpus violates its own invariants. |