@peasant-labs/schema 0.1.0-rc10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +66 -0
  3. package/dist/fixtures/quality.d.ts +81 -0
  4. package/dist/fixtures/quality.js +36 -0
  5. package/dist/fixtures/timeline.d.ts +53 -0
  6. package/dist/fixtures/timeline.js +2 -0
  7. package/dist/fixtures.d.ts +2 -0
  8. package/dist/fixtures.js +2 -0
  9. package/dist/index.d.ts +8 -0
  10. package/dist/index.js +36 -0
  11. package/dist/internal/generated/contract/zod.gen.d.ts +3441 -0
  12. package/dist/internal/generated/contract/zod.gen.js +1623 -0
  13. package/dist/internal/generated/enums.gen.d.ts +406 -0
  14. package/dist/internal/generated/enums.gen.js +445 -0
  15. package/dist/internal/generated/local-api.d.ts +1047 -0
  16. package/dist/internal/generated/local-api.js +1 -0
  17. package/dist/internal/generated/public-contract.gen.d.ts +2 -0
  18. package/dist/internal/generated/public-contract.gen.js +2 -0
  19. package/dist/internal/generated/quality-fixtures.gen.d.ts +2 -0
  20. package/dist/internal/generated/quality-fixtures.gen.js +367 -0
  21. package/dist/internal/generated/testcase.gen.d.ts +17 -0
  22. package/dist/internal/generated/testcase.gen.js +20 -0
  23. package/dist/internal/generated/timeline-fixtures.gen.d.ts +2 -0
  24. package/dist/internal/generated/timeline-fixtures.gen.js +1554 -0
  25. package/dist/internal/generated/versions.gen.d.ts +4 -0
  26. package/dist/internal/generated/versions.gen.js +5 -0
  27. package/dist/internal/generated/village-api.d.ts +652 -0
  28. package/dist/internal/generated/village-api.js +1 -0
  29. package/dist/local-api.d.ts +4 -0
  30. package/dist/local-api.js +1 -0
  31. package/dist/testcase.d.ts +32 -0
  32. package/dist/testcase.js +144 -0
  33. package/dist/types.d.ts +2 -0
  34. package/dist/types.js +2 -0
  35. package/dist/village-api.d.ts +4 -0
  36. package/dist/village-api.js +1 -0
  37. package/package.json +75 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { zActivityEdge, zAnnotationAxis, zAnnotationDatatype, zAnnotationEntryTarget, zAnnotationManifestResponse, zAnnotationPushStatus, zAnnotationPushResult, zAnnotationPushResponse, zAnnotationStatus, zAnnotatorKind, zAnnotatorSummary, zAssociationConclusion, zAssociationEvidenceKind, zAssociationEvidenceObservation, zAssociationID, zBatchCreateAnnotationsErrorResponse, zBatchCreateAnnotationsResponse, zBuiltinCommand, zCLILoginQuery, zChangeBinding, zChangeSummary, zChannelTopic, zChannelSubscription, zChildSessionRef, zCommitInfo, zConfidence, zContentKind, zContractVersion, zCreateAnnotationRequest, zBatchCreateAnnotationsRequest, zCreateAnnotationResponse, zDashboardPayload, zDayStats, zDecayLevel, zDiagnosticEntry, zDiagnosticsInfo, zDiffLineKind, zDiffLine, zDiffHunk, zEdgeViolationKind, zEdgeViolation, zEntryType, zExchangeCodeRequest, zExchangeCodeResponse, zFileChangeStatus, zChangeDiffPayload, zFileChange, zFileFamiliarity, zFrictionCluster, zHarness, zHealthResponse, zHostSlug, zInsightClassification, zInsightKind, zInsightProvenance, zInteractionType, zLicense, zMapEdge, zMapNodeKind, zMessageType, zClientMessage, zMockConfigResponse, zModelID, zModelInfo, zProjectHash, zProjectContext, zProjectResolutionPayload, zProjectSummary, zProjectSummariesPayload, zProvenance, zPublishResponse, zPublishedAssociation, zGitContext, zReadAttributionState, zReadStateGrade, zMapNode, zMapGraphPayload, zMapSlice, zRedactionInfo, zReviewSuggestion, zRewriteMethod, zRewriteResolution, zRole, zScaleKind, zSchemaVersionResponse, zSearchResult, zSearchPayload, zServerMessage, zSessionID, zInsightEvidence, zSessionAssociation, zCommitRef, zRewrittenCommit, zSessionIdentity, zSessionInsight, zSessionOutcome, zQualityMetrics, zSessionScorecard, zSessionStats, zSessionSummary, zSessionsPayload, zShutdownResponse, zSourceFormat, zSourceInfo, zStopReason, zSubagentRef, zTargetKind, zAnnotationPushItem, zAnnotationPushRequest, zAnnotationSummary, zAnnotationsPayload, zPullAnnotation, zQualitySession, zQualityPayload, zTaskSummary, zChangeSession, zMapNodeDetailPayload, zProjectTasksPayload, zTimelineSessionRef, zReviewListPayload, zTimestampInfo, zToolCallKind, zSessionEntry, zPublishRequest, zToolCallDetail, zTranscriptID, zPullSkipGateItem, zPullSkipGateRequest, zPullSkipGateResult, zPullSkipGateResponse, zTrendsPayload, zTurnDetail, zSessionDetailPayload, zTranscriptContent, zTypeOrigin, zUnifiedMetadata, zUnusualSignal, zChangeDetailPayload, zValueDomainKind, zValueDomain, zAnnotationTypeSummary, zTaxonomyFamilyNode, zTaxonomyNode, zVisibility, zPullTranscriptInfo, zPullListResponse, zWalkthroughStep, zWalkthroughTrail, zFamiliarityPayload } from "./contract/zod.gen.js";
2
+ export type { ActivityEdge, AnnotationEntryTarget, AnnotationManifestResponse, AnnotationPushResult, AnnotationPushResponse, AnnotatorSummary, AssociationEvidenceObservation, AssociationID, BatchCreateAnnotationsErrorResponse, BatchCreateAnnotationsResponse, CLILoginQuery, ChangeSummary, ChannelSubscription, ChildSessionRef, CommitInfo, ContractVersion, CreateAnnotationRequest, BatchCreateAnnotationsRequest, CreateAnnotationResponse, DashboardPayload, DayStats, DiagnosticEntry, DiagnosticsInfo, DiffLine, DiffHunk, EdgeViolation, ExchangeCodeRequest, ExchangeCodeResponse, ChangeDiffPayload, FileChange, FileFamiliarity, FrictionCluster, HealthResponse, HostSlug, InsightClassification, MapEdge, ClientMessage, MockConfigResponse, ModelID, ModelInfo, ProjectHash, ProjectContext, ProjectResolutionPayload, ProjectSummary, ProjectSummariesPayload, Provenance, PublishResponse, PublishedAssociation, GitContext, MapNode, MapGraphPayload, MapSlice, RedactionInfo, ReviewSuggestion, SchemaVersionResponse, SearchResult, SearchPayload, ServerMessage, SessionID, InsightEvidence, SessionAssociation, CommitRef, RewrittenCommit, SessionIdentity, SessionInsight, QualityMetrics, SessionScorecard, SessionStats, SessionSummary, SessionsPayload, ShutdownResponse, SourceInfo, SubagentRef, AnnotationPushItem, AnnotationPushRequest, AnnotationSummary, AnnotationsPayload, PullAnnotation, QualitySession, QualityPayload, TaskSummary, ChangeSession, MapNodeDetailPayload, ProjectTasksPayload, TimelineSessionRef, ReviewListPayload, TimestampInfo, SessionEntry, PublishRequest, ToolCallDetail, TranscriptID, PullSkipGateItem, PullSkipGateRequest, PullSkipGateResult, PullSkipGateResponse, TrendsPayload, TurnDetail, SessionDetailPayload, TranscriptContent, UnifiedMetadata, UnusualSignal, ChangeDetailPayload, ValueDomain, AnnotationTypeSummary, TaxonomyFamilyNode, TaxonomyNode, PullTranscriptInfo, PullListResponse, WalkthroughStep, WalkthroughTrail, FamiliarityPayload } from "./contract/zod.gen.js";
@@ -0,0 +1,2 @@
1
+ // Code generated from the canonical Go/OpenAPI contract. DO NOT EDIT.
2
+ export { zActivityEdge, zAnnotationAxis, zAnnotationDatatype, zAnnotationEntryTarget, zAnnotationManifestResponse, zAnnotationPushStatus, zAnnotationPushResult, zAnnotationPushResponse, zAnnotationStatus, zAnnotatorKind, zAnnotatorSummary, zAssociationConclusion, zAssociationEvidenceKind, zAssociationEvidenceObservation, zAssociationID, zBatchCreateAnnotationsErrorResponse, zBatchCreateAnnotationsResponse, zBuiltinCommand, zCLILoginQuery, zChangeBinding, zChangeSummary, zChannelTopic, zChannelSubscription, zChildSessionRef, zCommitInfo, zConfidence, zContentKind, zContractVersion, zCreateAnnotationRequest, zBatchCreateAnnotationsRequest, zCreateAnnotationResponse, zDashboardPayload, zDayStats, zDecayLevel, zDiagnosticEntry, zDiagnosticsInfo, zDiffLineKind, zDiffLine, zDiffHunk, zEdgeViolationKind, zEdgeViolation, zEntryType, zExchangeCodeRequest, zExchangeCodeResponse, zFileChangeStatus, zChangeDiffPayload, zFileChange, zFileFamiliarity, zFrictionCluster, zHarness, zHealthResponse, zHostSlug, zInsightClassification, zInsightKind, zInsightProvenance, zInteractionType, zLicense, zMapEdge, zMapNodeKind, zMessageType, zClientMessage, zMockConfigResponse, zModelID, zModelInfo, zProjectHash, zProjectContext, zProjectResolutionPayload, zProjectSummary, zProjectSummariesPayload, zProvenance, zPublishResponse, zPublishedAssociation, zGitContext, zReadAttributionState, zReadStateGrade, zMapNode, zMapGraphPayload, zMapSlice, zRedactionInfo, zReviewSuggestion, zRewriteMethod, zRewriteResolution, zRole, zScaleKind, zSchemaVersionResponse, zSearchResult, zSearchPayload, zServerMessage, zSessionID, zInsightEvidence, zSessionAssociation, zCommitRef, zRewrittenCommit, zSessionIdentity, zSessionInsight, zSessionOutcome, zQualityMetrics, zSessionScorecard, zSessionStats, zSessionSummary, zSessionsPayload, zShutdownResponse, zSourceFormat, zSourceInfo, zStopReason, zSubagentRef, zTargetKind, zAnnotationPushItem, zAnnotationPushRequest, zAnnotationSummary, zAnnotationsPayload, zPullAnnotation, zQualitySession, zQualityPayload, zTaskSummary, zChangeSession, zMapNodeDetailPayload, zProjectTasksPayload, zTimelineSessionRef, zReviewListPayload, zTimestampInfo, zToolCallKind, zSessionEntry, zPublishRequest, zToolCallDetail, zTranscriptID, zPullSkipGateItem, zPullSkipGateRequest, zPullSkipGateResult, zPullSkipGateResponse, zTrendsPayload, zTurnDetail, zSessionDetailPayload, zTranscriptContent, zTypeOrigin, zUnifiedMetadata, zUnusualSignal, zChangeDetailPayload, zValueDomainKind, zValueDomain, zAnnotationTypeSummary, zTaxonomyFamilyNode, zTaxonomyNode, zVisibility, zPullTranscriptInfo, zPullListResponse, zWalkthroughStep, zWalkthroughTrail, zFamiliarityPayload } from "./contract/zod.gen.js";
@@ -0,0 +1,2 @@
1
+ import type { QualityFixtures } from "../../fixtures/quality.js";
2
+ export declare const canonicalQualityFixtures: QualityFixtures;
@@ -0,0 +1,367 @@
1
+ export const canonicalQualityFixtures = {
2
+ "sessions": [
3
+ {
4
+ "name": "resolved_typical",
5
+ "id": "sess-000",
6
+ "date": "2025-11-01T00:00:00Z",
7
+ "project": "fortuna",
8
+ "scope": "Personal",
9
+ "title": "Fix authentication middleware",
10
+ "totalTokens": 15000,
11
+ "inputTokens": 13500,
12
+ "outputTokens": 1500,
13
+ "turnCount": 10,
14
+ "toolCalls": 15,
15
+ "outcome": "resolved",
16
+ "filesTouched": 3,
17
+ "linesChanged": 150,
18
+ "durationMinutes": 20,
19
+ "retryLoops": 0,
20
+ "retryTokensWasted": 0,
21
+ "withinSessionReverts": 1,
22
+ "signalDensity": 45.5,
23
+ "specQualityScore": 75,
24
+ "explorationRatio": 25,
25
+ "scopeBreadth": 2,
26
+ "discoveryTurns": 2
27
+ },
28
+ {
29
+ "name": "resolved_high_tokens",
30
+ "id": "sess-001",
31
+ "date": "2025-11-02T00:00:00Z",
32
+ "project": "peasant-api",
33
+ "scope": "Platform Team",
34
+ "title": "Add pagination to API",
35
+ "totalTokens": 85000,
36
+ "inputTokens": 80000,
37
+ "outputTokens": 5000,
38
+ "turnCount": 25,
39
+ "toolCalls": 40,
40
+ "outcome": "resolved",
41
+ "filesTouched": 8,
42
+ "linesChanged": 400,
43
+ "durationMinutes": 50,
44
+ "retryLoops": 1,
45
+ "retryTokensWasted": 5000,
46
+ "withinSessionReverts": 0,
47
+ "signalDensity": 58.2,
48
+ "specQualityScore": 85,
49
+ "explorationRatio": 15,
50
+ "scopeBreadth": 3,
51
+ "discoveryTurns": 3
52
+ },
53
+ {
54
+ "name": "partial_medium",
55
+ "id": "sess-002",
56
+ "date": "2025-11-03T00:00:00Z",
57
+ "project": "data-pipeline",
58
+ "scope": "Growth Team",
59
+ "title": "Refactor database queries",
60
+ "totalTokens": 120000,
61
+ "inputTokens": 110000,
62
+ "outputTokens": 10000,
63
+ "turnCount": 35,
64
+ "toolCalls": 60,
65
+ "outcome": "partial",
66
+ "filesTouched": 10,
67
+ "linesChanged": 350,
68
+ "durationMinutes": 70,
69
+ "retryLoops": 2,
70
+ "retryTokensWasted": 8000,
71
+ "withinSessionReverts": 4,
72
+ "signalDensity": 32.1,
73
+ "specQualityScore": 55,
74
+ "explorationRatio": 45,
75
+ "scopeBreadth": 6,
76
+ "discoveryTurns": 8
77
+ },
78
+ {
79
+ "name": "failed_complex",
80
+ "id": "sess-003",
81
+ "date": "2025-11-04T00:00:00Z",
82
+ "project": "auth-service",
83
+ "scope": "Platform Team",
84
+ "title": "Implement search filters",
85
+ "totalTokens": 200000,
86
+ "inputTokens": 180000,
87
+ "outputTokens": 20000,
88
+ "turnCount": 55,
89
+ "toolCalls": 100,
90
+ "outcome": "failed",
91
+ "filesTouched": 15,
92
+ "linesChanged": 800,
93
+ "durationMinutes": 110,
94
+ "retryLoops": 6,
95
+ "retryTokensWasted": 25000,
96
+ "withinSessionReverts": 5,
97
+ "signalDensity": 18.7,
98
+ "specQualityScore": 25,
99
+ "explorationRatio": 75,
100
+ "scopeBreadth": 8,
101
+ "discoveryTurns": 10
102
+ },
103
+ {
104
+ "name": "resolved_minimal",
105
+ "id": "sess-004",
106
+ "date": "2025-11-05T00:00:00Z",
107
+ "project": "docs-site",
108
+ "scope": "Personal",
109
+ "title": "Update user settings page",
110
+ "totalTokens": 5000,
111
+ "inputTokens": 4500,
112
+ "outputTokens": 500,
113
+ "turnCount": 5,
114
+ "toolCalls": 5,
115
+ "outcome": "resolved",
116
+ "filesTouched": 1,
117
+ "linesChanged": 20,
118
+ "durationMinutes": 10,
119
+ "retryLoops": 0,
120
+ "retryTokensWasted": 0,
121
+ "withinSessionReverts": 0,
122
+ "signalDensity": 62,
123
+ "specQualityScore": 90,
124
+ "explorationRatio": 10,
125
+ "scopeBreadth": 1,
126
+ "discoveryTurns": 1
127
+ }
128
+ ],
129
+ "sets": [
130
+ {
131
+ "name": "project_mix",
132
+ "cases": [
133
+ "resolved_typical",
134
+ "partial_medium"
135
+ ]
136
+ }
137
+ ],
138
+ "variations": {
139
+ "outcomes": [
140
+ {
141
+ "value": "resolved"
142
+ },
143
+ {
144
+ "value": "partial"
145
+ },
146
+ {
147
+ "value": "failed"
148
+ },
149
+ {
150
+ "value": ""
151
+ }
152
+ ],
153
+ "projects": [
154
+ {
155
+ "value": "fortuna"
156
+ },
157
+ {
158
+ "value": "peasant-api"
159
+ },
160
+ {
161
+ "value": "data-pipeline"
162
+ },
163
+ {
164
+ "value": "auth-service"
165
+ },
166
+ {
167
+ "value": "docs-site"
168
+ },
169
+ {
170
+ "value": ""
171
+ },
172
+ {
173
+ "value": "invalid-project"
174
+ }
175
+ ],
176
+ "scopes": [
177
+ {
178
+ "value": "Personal"
179
+ },
180
+ {
181
+ "value": "Platform Team"
182
+ },
183
+ {
184
+ "value": "Growth Team"
185
+ },
186
+ {
187
+ "value": ""
188
+ },
189
+ {
190
+ "value": "Unknown Scope"
191
+ }
192
+ ],
193
+ "taskTitles": [
194
+ {
195
+ "value": "Fix authentication middleware"
196
+ },
197
+ {
198
+ "value": "Add pagination to API"
199
+ },
200
+ {
201
+ "value": "Refactor database queries"
202
+ },
203
+ {
204
+ "value": "Implement search filters"
205
+ },
206
+ {
207
+ "value": "Update user settings page"
208
+ },
209
+ {
210
+ "value": "Fix CORS configuration"
211
+ },
212
+ {
213
+ "value": "Add webhook handlers"
214
+ },
215
+ {
216
+ "value": "Migrate to TypeScript"
217
+ },
218
+ {
219
+ "value": "Optimize image loading"
220
+ },
221
+ {
222
+ "value": "Add rate limiting"
223
+ },
224
+ {
225
+ "value": ""
226
+ }
227
+ ],
228
+ "tokenRatios": [
229
+ {
230
+ "name": "typical_input_heavy",
231
+ "inputRatio": 0.95
232
+ },
233
+ {
234
+ "name": "balanced",
235
+ "inputRatio": 0.5
236
+ },
237
+ {
238
+ "name": "output_heavy",
239
+ "inputRatio": 0.2
240
+ },
241
+ {
242
+ "name": "empty_input",
243
+ "inputRatio": 0
244
+ },
245
+ {
246
+ "name": "empty_output",
247
+ "inputRatio": 1
248
+ }
249
+ ],
250
+ "metrics": {
251
+ "retryLoops": [
252
+ {
253
+ "name": "none",
254
+ "value": 0
255
+ },
256
+ {
257
+ "name": "few",
258
+ "value": 2
259
+ },
260
+ {
261
+ "name": "many",
262
+ "value": 8
263
+ },
264
+ {
265
+ "name": "negative",
266
+ "value": -1
267
+ }
268
+ ],
269
+ "signalDensity": [
270
+ {
271
+ "name": "high",
272
+ "value": 60
273
+ },
274
+ {
275
+ "name": "typical",
276
+ "value": 40
277
+ },
278
+ {
279
+ "name": "low",
280
+ "value": 15
281
+ },
282
+ {
283
+ "name": "zero",
284
+ "value": 0
285
+ },
286
+ {
287
+ "name": "over_100",
288
+ "value": 120
289
+ }
290
+ ],
291
+ "specQualityScore": [
292
+ {
293
+ "name": "perfect",
294
+ "value": 100
295
+ },
296
+ {
297
+ "name": "high",
298
+ "value": 85
299
+ },
300
+ {
301
+ "name": "medium",
302
+ "value": 50
303
+ },
304
+ {
305
+ "name": "low",
306
+ "value": 20
307
+ },
308
+ {
309
+ "name": "zero",
310
+ "value": 0
311
+ },
312
+ {
313
+ "name": "negative",
314
+ "value": -5
315
+ },
316
+ {
317
+ "name": "over_100",
318
+ "value": 150
319
+ }
320
+ ],
321
+ "filesTouched": [
322
+ {
323
+ "name": "none",
324
+ "value": 0
325
+ },
326
+ {
327
+ "name": "few",
328
+ "value": 3
329
+ },
330
+ {
331
+ "name": "typical",
332
+ "value": 8
333
+ },
334
+ {
335
+ "name": "many",
336
+ "value": 15
337
+ },
338
+ {
339
+ "name": "negative",
340
+ "value": -1
341
+ }
342
+ ],
343
+ "linesChanged": [
344
+ {
345
+ "name": "none",
346
+ "value": 0
347
+ },
348
+ {
349
+ "name": "few",
350
+ "value": 20
351
+ },
352
+ {
353
+ "name": "typical",
354
+ "value": 200
355
+ },
356
+ {
357
+ "name": "many",
358
+ "value": 800
359
+ },
360
+ {
361
+ "name": "negative",
362
+ "value": -10
363
+ }
364
+ ]
365
+ }
366
+ }
367
+ };
@@ -0,0 +1,17 @@
1
+ export declare const Classification: Readonly<{
2
+ readonly MustPass: "must-pass";
3
+ readonly MustFail: "must-fail";
4
+ }>;
5
+ export type Classification = (typeof Classification)[keyof typeof Classification];
6
+ export declare const AllClassifications: readonly Classification[];
7
+ export declare function isClassification(value: unknown): value is Classification;
8
+ export declare const ProvenanceSource: Readonly<{
9
+ readonly Requirement: "requirement";
10
+ readonly Bug: "bug";
11
+ readonly Enum: "enum";
12
+ readonly Boundary: "boundary";
13
+ readonly Manual: "manual";
14
+ }>;
15
+ export type ProvenanceSource = (typeof ProvenanceSource)[keyof typeof ProvenanceSource];
16
+ export declare const AllProvenanceSources: readonly ProvenanceSource[];
17
+ export declare function isProvenanceSource(value: unknown): value is ProvenanceSource;
@@ -0,0 +1,20 @@
1
+ // Code generated from the canonical Go/OpenAPI contract. DO NOT EDIT.
2
+ export const Classification = Object.freeze({
3
+ MustPass: "must-pass",
4
+ MustFail: "must-fail",
5
+ });
6
+ export const AllClassifications = Object.freeze([Classification.MustPass, Classification.MustFail]);
7
+ export function isClassification(value) {
8
+ return typeof value === "string" && AllClassifications.includes(value);
9
+ }
10
+ export const ProvenanceSource = Object.freeze({
11
+ Requirement: "requirement",
12
+ Bug: "bug",
13
+ Enum: "enum",
14
+ Boundary: "boundary",
15
+ Manual: "manual",
16
+ });
17
+ export const AllProvenanceSources = Object.freeze([ProvenanceSource.Requirement, ProvenanceSource.Bug, ProvenanceSource.Enum, ProvenanceSource.Boundary, ProvenanceSource.Manual]);
18
+ export function isProvenanceSource(value) {
19
+ return typeof value === "string" && AllProvenanceSources.includes(value);
20
+ }
@@ -0,0 +1,2 @@
1
+ import type { TimelineFixtureCorpus } from "../../fixtures/timeline.js";
2
+ export declare const canonicalTimelineFixtures: TimelineFixtureCorpus;