Skip to content

Commit e0bb361

Browse files
committed
create contributor array in activity claim and split contributorJSON into two schemas
1 parent 1bbc6c0 commit e0bb361

File tree

5 files changed

+124
-38
lines changed

5 files changed

+124
-38
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
"@hypercerts-org/lexicon": minor
3+
---
4+
5+
Refactor contributions structure and split contributor lexicon
6+
7+
**Breaking Changes:**
8+
9+
- **Activity lexicon (`org.hypercerts.claim.activity`):**
10+
- Renamed `contributions` field to `contributors`
11+
- Replaced `contributions` array (array of strongRefs) with new `contributors` array containing contributor objects
12+
- Each contributor object has three fields:
13+
- `contributorInformation` (required): string (DID/identifier) or strongRef to `org.hypercerts.claim.contributorInformation#main`
14+
- `weight` (optional): positive number (stored as string)
15+
- `contributionDetails` (optional): string or strongRef to `org.hypercerts.claim.contributionDetails#main`
16+
- Renamed internal `contribution` object type to `contributor`
17+
- Renamed string wrapper defs: `contributorInformationString``contributorIdentity`, `contributionDetailsString``contributorRole`
18+
- Updated `contributorRole` string limits: maxLength 10000, maxGraphemes 1000
19+
20+
- **Contributor lexicon (`org.hypercerts.claim.contributor`):**
21+
- Split into two separate lexicon files:
22+
- `org.hypercerts.claim.contributorInformation`: new lexicon file containing `identifier`, `displayName`, `image` (contributor profile information)
23+
- `org.hypercerts.claim.contributionDetails`: new lexicon file containing `role`, `contributionDescription`, `startDate`, `endDate` (contribution-specific details)
24+
- The original `org.hypercerts.claim.contributor` lexicon has been removed
25+
26+
Existing contributions using the old structure will need to be migrated to the new format.

SCHEMAS.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,30 @@ Hypercerts-specific lexicons for tracking impact work and claims.
1515

1616
#### Properties
1717

18-
| Property | Type | Required | Description | Comments |
19-
| ------------------ | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
20-
| `title` | `string` | yes | Title of the hypercert. | maxLength: 256 |
21-
| `shortDescription` | `string` | yes | Short blurb of the impact work done. | maxLength: 3000, maxGraphemes: 300 |
22-
| `description` | `string` | no | Optional longer description of the impact work done. | maxLength: 30000, maxGraphemes: 3000 |
23-
| `image` | `union` | no | The hypercert visual representation as a URI or image blob. | |
24-
| `workScope` | `ref` | no | A strong reference to a record defining the scope of work. The record referenced should describe the logical scope using label-based conditions. | |
25-
| `startDate` | `string` | no | When the work began | |
26-
| `endDate` | `string` | no | When the work ended | |
27-
| `contributions` | `ref` | no | A strong reference to the contributions done to create the impact in the hypercerts. The record referenced must conform with the lexicon org.hypercerts.claim.contributor. | |
28-
| `rights` | `ref` | no | A strong reference to the rights that this hypercert has. The record referenced must conform with the lexicon org.hypercerts.claim.rights. | |
29-
| `locations` | `ref` | no | An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location. | |
30-
| `createdAt` | `string` | yes | Client-declared timestamp when this record was originally created | |
18+
| Property | Type | Required | Description | Comments |
19+
| ------------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
20+
| `title` | `string` | yes | Title of the hypercert. | maxLength: 256 |
21+
| `shortDescription` | `string` | yes | Short blurb of the impact work done. | maxLength: 3000, maxGraphemes: 300 |
22+
| `description` | `string` | no | Optional longer description of the impact work done. | maxLength: 30000, maxGraphemes: 3000 |
23+
| `image` | `union` | no | The hypercert visual representation as a URI or image blob. | |
24+
| `workScope` | `ref` | no | A strong reference to a record defining the scope of work. The record referenced should describe the logical scope using label-based conditions. | |
25+
| `startDate` | `string` | no | When the work began | |
26+
| `endDate` | `string` | no | When the work ended | |
27+
| `contributors` | `ref` | no | An array of contributor objects, each containing contributor information, weight, and contribution details. | |
28+
| `rights` | `ref` | no | A strong reference to the rights that this hypercert has. The record referenced must conform with the lexicon org.hypercerts.claim.rights. | |
29+
| `locations` | `ref` | no | An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location. | |
30+
| `createdAt` | `string` | yes | Client-declared timestamp when this record was originally created | |
3131

3232
#### Defs
3333

34+
##### contributor
35+
36+
| Property | Type | Required | Description |
37+
| ------------------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
38+
| `contributorInformation` | `union` | yes | Contributor information as a string (DID or identifier) or strong reference to for instance org.hypercerts.claim.contributorInformation#main. |
39+
| `weight` | `string` | no | The relative weight/importance of this contribution (stored as a string to avoid float precision issues). Must be a positive numeric value. Weights do not need to sum to a specific total; normalization can be performed by the consuming application as needed. |
40+
| `contributionDetails` | `union` | no | Contribution details as a string or strong reference to org.hypercerts.claim.contributionDetails#main. |
41+
3442
##### activityWeight
3543

3644
| Property | Type | Required | Description |

lexicons/org/hypercerts/claim/activity.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
"format": "datetime",
5151
"description": "When the work ended"
5252
},
53-
"contributions": {
53+
"contributors": {
5454
"type": "array",
55-
"description": "A strong reference to the contributions done to create the impact in the hypercerts. The record referenced must conform with the lexicon org.hypercerts.claim.contributor.",
55+
"description": "An array of contributor objects, each containing contributor information, weight, and contribution details.",
5656
"items": {
5757
"type": "ref",
58-
"ref": "com.atproto.repo.strongRef"
58+
"ref": "#contributor"
5959
}
6060
},
6161
"rights": {
@@ -79,6 +79,36 @@
7979
}
8080
}
8181
},
82+
"contributor": {
83+
"type": "object",
84+
"required": ["contributorInformation"],
85+
"properties": {
86+
"contributorInformation": {
87+
"type": "union",
88+
"refs": ["#contributorIdentity", "com.atproto.repo.strongRef"],
89+
"description": "Contributor information as a string (DID or identifier) or strong reference to for instance org.hypercerts.claim.contributorInformation#main."
90+
},
91+
"weight": {
92+
"type": "string",
93+
"description": "The relative weight/importance of this contribution (stored as a string to avoid float precision issues). Must be a positive numeric value. Weights do not need to sum to a specific total; normalization can be performed by the consuming application as needed."
94+
},
95+
"contributionDetails": {
96+
"type": "union",
97+
"refs": ["#contributorRole", "com.atproto.repo.strongRef"],
98+
"description": "Contribution details as a string or strong reference to org.hypercerts.claim.contributionDetails#main."
99+
}
100+
}
101+
},
102+
"contributorIdentity": {
103+
"type": "string",
104+
"description": "Contributor information as a string (DID or identifier)."
105+
},
106+
"contributorRole": {
107+
"type": "string",
108+
"description": "Contribution details as a string.",
109+
"maxLength": 10000,
110+
"maxGraphemes": 1000
111+
},
82112
"activityWeight": {
83113
"type": "object",
84114
"required": ["activity", "weight"],

lexicons/org/hypercerts/claim/contributor.json renamed to lexicons/org/hypercerts/claim/contributionDetails.json

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
11
{
22
"lexicon": 1,
3-
"id": "org.hypercerts.claim.contributor",
3+
"id": "org.hypercerts.claim.contributionDetails",
44
"defs": {
55
"main": {
66
"type": "record",
7-
"description": "A contribution made toward a hypercert's impact.",
7+
"description": "Details about a specific contribution including role, description, and timeframe.",
88
"key": "tid",
99
"record": {
1010
"type": "object",
1111
"required": ["createdAt"],
1212
"properties": {
13-
"identifier": {
14-
"type": "string",
15-
"description": "DID or a URI to a social profile of the contributor."
16-
},
17-
"displayName": {
18-
"type": "string",
19-
"description": "Display name of the contributor.",
20-
"maxLength": 100
21-
},
22-
"image": {
23-
"type": "union",
24-
"refs": [
25-
"org.hypercerts.defs#uri",
26-
"org.hypercerts.defs#smallImage"
27-
],
28-
"description": "The contributor visual representation as a URI or image blob."
29-
},
3013
"role": {
3114
"type": "string",
3215
"description": "Role or title of the contributor.",
3316
"maxLength": 100
3417
},
3518
"contributionDescription": {
3619
"type": "string",
37-
"description": "What the contribution concretely achieved.",
38-
"maxLength": 2000,
39-
"maxGraphemes": 500
20+
"description": "What the contribution concretely was.",
21+
"maxLength": 10000,
22+
"maxGraphemes": 1000
4023
},
4124
"startDate": {
4225
"type": "string",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"lexicon": 1,
3+
"id": "org.hypercerts.claim.contributorInformation",
4+
"defs": {
5+
"main": {
6+
"type": "record",
7+
"description": "Contributor information including identifier, display name, and image.",
8+
"key": "tid",
9+
"record": {
10+
"type": "object",
11+
"required": ["createdAt"],
12+
"properties": {
13+
"identifier": {
14+
"type": "string",
15+
"description": "DID or a URI to a social profile of the contributor."
16+
},
17+
"displayName": {
18+
"type": "string",
19+
"description": "Display name of the contributor.",
20+
"maxLength": 100
21+
},
22+
"image": {
23+
"type": "union",
24+
"refs": [
25+
"org.hypercerts.defs#uri",
26+
"org.hypercerts.defs#smallImage"
27+
],
28+
"description": "The contributor visual representation as a URI or image blob."
29+
},
30+
"createdAt": {
31+
"type": "string",
32+
"format": "datetime",
33+
"description": "Client-declared timestamp when this record was originally created."
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)