Skip to content

Commit 3276d6e

Browse files
bitbeckersaspiers
authored andcommitted
feat: change workScope to strongRef in activity lexicon
BREAKING CHANGE: workScope property in org.hypercerts.claim.activity now uses com.atproto.repo.strongRef instead of inline object definition. The workScope definition (withinAllOf, withinAnyOf, withinNoneOf) has been removed from the lexicon. This allows for more flexible work scope definitions by referencing external records rather than embedding the structure directly. Changes: - Update workScope property to reference com.atproto.repo.strongRef - Remove workScope definition from activity lexicon defs - Update README.md documentation and examples - Add changeset for version bump
1 parent 8a35285 commit 3276d6e

File tree

3 files changed

+24
-45
lines changed

3 files changed

+24
-45
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hypercerts-org/lexicon": minor
3+
---
4+
5+
Change workScope from inline object definition to strongRef in activity lexicon. This breaking change removes the workScope definition (withinAllOf, withinAnyOf, withinNoneOf properties) and changes the workScope property to reference an external record via strongRef, allowing for more flexible work scope definitions.

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ const activityRecord = {
6565
$type: ACTIVITY_NSID,
6666
title: "My Impact Work",
6767
shortDescription: "Description here",
68-
workScope: "Scope of work",
68+
workScope: {
69+
uri: "at://did:plc:alice/org.hypercerts.claim.workscope/abc123",
70+
cid: "...",
71+
},
6972
startDate: "2023-01-01T00:00:00Z",
7073
endDate: "2023-12-31T23:59:59Z",
7174
createdAt: new Date().toISOString(),
@@ -286,19 +289,19 @@ Hypercerts-specific lexicons for tracking impact work and claims.
286289

287290
#### Properties
288291

289-
| Property | Type | Required | Description | Comments |
290-
| ------------------ | -------- | -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
291-
| `title` | `string` || Title of the hypercert | |
292-
| `shortDescription` | `string` || Short blurb of the impact work done. | |
293-
| `description` | `string` || Optional longer description of the impact work done. | |
294-
| `image` | `union` || The hypercert visual representation as a URI or image blob | |
295-
| `workScope` | `object` || Logical scope of the work using label-based conditions | Object with `withinAllOf`, `withinAnyOf`, `withinNoneOf` arrays of labels |
296-
| `startDate` | `string` || When the work began | |
297-
| `endDate` | `string` || When the work ended | |
298-
| `contributions` | `array` || A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contributor` |
299-
| `rights` | `ref` || A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
300-
| `locations` | `ref` || An array of strong references to the locations where the work for done hypercert was located | References must conform to `app.certified.location` |
301-
| `createdAt` | `string` || Client-declared timestamp when this record was originally created | |
292+
| Property | Type | Required | Description | Comments |
293+
| ------------------ | -------- | -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
294+
| `title` | `string` || Title of the hypercert | |
295+
| `shortDescription` | `string` || Short blurb of the impact work done. | |
296+
| `description` | `string` || Optional longer description of the impact work done. | |
297+
| `image` | `union` || The hypercert visual representation as a URI or image blob | |
298+
| `workScope` | `ref` || A strong reference to a record defining the scope of work | The record referenced should describe the logical scope using label-based conditions |
299+
| `startDate` | `string` || When the work began | |
300+
| `endDate` | `string` || When the work ended | |
301+
| `contributions` | `array` || A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contributor` |
302+
| `rights` | `ref` || A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
303+
| `locations` | `ref` || An array of strong references to the locations where the work for done hypercert was located | References must conform to `app.certified.location` |
304+
| `createdAt` | `string` || Client-declared timestamp when this record was originally created | |
302305

303306
#### Defs
304307

lexicons/org/hypercerts/claim/activity.json

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
},
3838
"workScope": {
3939
"type": "ref",
40-
"ref": "#workScope"
40+
"ref": "com.atproto.repo.strongRef",
41+
"description": "A strong reference to a record defining the scope of work. The record referenced should describe the logical scope using label-based conditions."
4142
},
4243
"startDate": {
4344
"type": "string",
@@ -78,36 +79,6 @@
7879
}
7980
}
8081
},
81-
"workScope": {
82-
"type": "object",
83-
"description": "Logical scope of the work using label-based conditions. All labels in `withinAllOf` must apply; at least one label in `withinAnyOf` must apply if provided; no label in `withinNoneOf` may apply.",
84-
"properties": {
85-
"withinAllOf": {
86-
"type": "array",
87-
"description": "Labels that MUST all hold for the scope to apply.",
88-
"items": {
89-
"type": "string"
90-
},
91-
"maxLength": 100
92-
},
93-
"withinAnyOf": {
94-
"type": "array",
95-
"description": "Labels of which AT LEAST ONE must hold (optional). If omitted or empty, imposes no additional condition.",
96-
"items": {
97-
"type": "string"
98-
},
99-
"maxLength": 100
100-
},
101-
"withinNoneOf": {
102-
"type": "array",
103-
"description": "Labels that MUST NOT hold for the scope to apply.",
104-
"items": {
105-
"type": "string"
106-
},
107-
"maxLength": 100
108-
}
109-
}
110-
},
11182
"activityWeight": {
11283
"type": "object",
11384
"required": ["activity", "weight"],

0 commit comments

Comments
 (0)