@peasant-labs/schema 0.1.0-rc6 → 0.1.0-rc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,13 +22,23 @@ same closed-set shape as Go (`Role.User`, `AllRoles`, `isRole`) without
22
22
  maintaining a handwritten second contract. The retired `@peasant-labs/types`
23
23
  package must not receive new wire definitions.
24
24
 
25
+ The generated root Zod schemas enforce the wire's structural shape and selected
26
+ generator-owned local cross-field invariants, including association evidence and
27
+ annotation target rules. The Go `Validate` methods remain authoritative at the
28
+ trust boundary for payload-context and cross-object relationships. TypeScript
29
+ consumer adapters remain responsible for any post-parse semantic handling.
30
+
25
31
  `ProjectHash` is a nominal string identity matching Go's validated newtype.
26
32
  Construct values with `newProjectHash`, narrow unknown wire values with
27
33
  `isProjectHash`, or assert a trust boundary with `validateProjectHash`.
28
34
 
29
- This package is not published yet. Its development version is
30
- `0.0.0-development`; a published package version will follow the schema module
31
- release tag, not an individual OpenAPI document version.
35
+ This package is published to npm as `@peasant-labs/schema`. The committed
36
+ `package.json` in this directory stays `0.0.0-development` + `private: true` as
37
+ a local safety; the schema module's release pipeline stamps the real version
38
+ from the module release tag (not an individual OpenAPI document version) and
39
+ publishes at release time, so every published version corresponds to a tagged
40
+ schema module release. An `-rcN` tag publishes under the npm dist-tag `next`; a
41
+ final `vX.Y.Z` publishes under `latest`.
32
42
 
33
43
  ```ts
34
44
  import {
@@ -1,22 +1,53 @@
1
- import type { CommitRef, SessionID, TimelineSessionRef } from "../index.js";
1
+ import type { CommitRef, RewrittenCommit, SessionAssociation, SessionID, TimelineSessionRef } from "../index.js";
2
2
  import type { Case } from "../testcase.js";
3
3
  export type TimelineFixtureSessionInput = Omit<TimelineSessionRef, "harness"> & {
4
4
  harness: string;
5
5
  };
6
- export type TimelineFixtureCommitInput = Omit<CommitRef, "sessionIds"> & {
6
+ export interface TimelineFixtureEvidenceObservation {
7
+ kind: string;
8
+ recordedCommitHash?: string;
9
+ touchedFilePath?: string;
10
+ branchName?: string;
11
+ windowStartMs?: number;
12
+ windowEndMs?: number;
13
+ }
14
+ export type TimelineFixtureAssociationInput = Omit<SessionAssociation, "conclusion" | "confidence" | "evidence"> & {
15
+ conclusion: string;
16
+ confidence: string;
17
+ evidence: TimelineFixtureEvidenceObservation[] | null;
18
+ };
19
+ export type TimelineFixtureCommitInput = Omit<CommitRef, "sessionIds" | "associations"> & {
7
20
  sessionIds: SessionID[] | null;
21
+ associations: TimelineFixtureAssociationInput[] | null;
8
22
  };
23
+ export type TimelineFixtureRepairKind = "set_session_binding_true" | "replace_successor_association";
24
+ export interface TimelineFixtureSetSessionBindingRepair {
25
+ kind: "set_session_binding_true";
26
+ sessionId: SessionID;
27
+ postMutationValid: boolean;
28
+ }
29
+ export interface TimelineFixtureReplaceSuccessorAssociationRepair {
30
+ kind: "replace_successor_association";
31
+ ghostHash: string;
32
+ successorHash: string;
33
+ associationId: SessionAssociation["id"];
34
+ postMutationValid: boolean;
35
+ }
36
+ export type TimelineFixtureRepair = TimelineFixtureSetSessionBindingRepair | TimelineFixtureReplaceSuccessorAssociationRepair;
9
37
  export interface TimelineFixtureInput {
10
38
  sessions: TimelineFixtureSessionInput[];
11
39
  commits: TimelineFixtureCommitInput[];
40
+ rewrittenCommits?: RewrittenCommit[];
12
41
  }
13
42
  export interface TimelineFixtureExpected {
14
43
  errorContains?: string;
44
+ repair?: TimelineFixtureRepair;
15
45
  }
16
46
  export type TimelineFixtureCase = Case<TimelineFixtureInput, TimelineFixtureExpected> & {
17
47
  family: string;
18
48
  };
19
49
  export interface TimelineFixtureCorpus {
20
50
  cases: TimelineFixtureCase[];
51
+ successorAssociationMirrorCases: TimelineFixtureCase[];
21
52
  }
22
53
  export declare function loadTimelineFixtures(): TimelineFixtureCorpus;