You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/architecture/08_concepts/signed_doc/docs/conditions.md
+88-37Lines changed: 88 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,15 @@
1
1
# Conditions
2
2
3
3
> **DRAFT STATUS**
4
-
> This document is currently in **DRAFT** status. Development should **NOT** begin until this specification is formally released.
4
+
> This document is currently in **DRAFT** status.
5
+
> Development should **NOT** begin until this specification is formally released.
5
6
> This specification is subject to change without notice.
6
7
7
8
## Description
8
9
9
-
Conditions documents are simple document types published by authoritative parties (such as Catalyst admins) to define terms and conditions that users must accept before submitting documents to the system.
10
+
Conditions documents are simple document types published by authoritative parties
11
+
(such as Catalyst admins) to define terms and conditions that users must accept
12
+
before submitting documents to the system.
10
13
11
14
The Conditions document type supports multiple condition documents for different purposes, such as:
12
15
@@ -17,11 +20,21 @@ The Conditions document type supports multiple condition documents for different
17
20
* Privacy policies
18
21
* Other legal or operational requirements
19
22
20
-
The payload of a Conditions document contains the text of the terms and conditions, typically in Markdown or HTML format. This allows for rich formatting while maintaining human readability.
23
+
The payload of a Conditions document contains the text of the terms and
24
+
conditions, typically in Markdown or HTML format.
25
+
This allows for rich formatting while maintaining human readability.
21
26
22
-
Conditions documents are versioned and can be revoked, enabling administrators to update terms over time while maintaining an auditable history of what terms were in effect at any given time.
27
+
Conditions documents are versioned and can be revoked, enabling administrators to
28
+
update terms over time while maintaining an auditable history of what terms were
29
+
in effect at any given time.
23
30
24
-
Conditions documents are referenced by parameter documents (Brand, Campaign, Category, and Contest Parameters) to specify which conditions are required at each level of the system hierarchy. User-submitted documents (such as Proposals and Comments) must reference all required conditions from their parameter hierarchy, with the act of listing these references and signing the document serving as the user's digital signature and acceptance.
31
+
Conditions documents are referenced by parameter documents (Brand, Campaign,
32
+
Category, and Contest Parameters) to specify which conditions are required at each
33
+
level of the system hierarchy.
34
+
User-submitted documents (such as Proposals and Comments) must reference all
35
+
required conditions from their parameter hierarchy, with the act of listing these
36
+
references and signing the document serving as the user's digital signature and
@@ -34,11 +47,16 @@ Conditions documents are referenced by parameter documents (Brand, Campaign, Cat
34
47
35
48
### Validation
36
49
37
-
The Conditions document *MUST* be a valid signed document according to the Signed Document Standard.
50
+
The Conditions document *MUST* be a valid signed document according to the
51
+
Signed Document Standard.
38
52
39
-
When a Conditions document is referenced in a parameter document's [`conditions`](../metadata.md#conditions) metadata field, the referenced document *MUST* exist and be of type "Conditions".
53
+
When a Conditions document is referenced in a parameter document's
54
+
[`conditions`](../metadata.md#conditions) metadata field, the referenced document
55
+
*MUST* exist and be of type "Conditions".
40
56
41
-
When a Conditions document is referenced in a user-submitted document's [`conditions`](../metadata.md#conditions) metadata field, the referenced document *MUST* exist, be of type "Conditions", and not be revoked.
57
+
When a Conditions document is referenced in a user-submitted document's
58
+
[`conditions`](../metadata.md#conditions) metadata field, the referenced document
59
+
*MUST* exist, be of type "Conditions", and not be revoked.
"description": "An array of references to Conditions documents that define terms and conditions required at this level.",
334
372
"format": "Document Reference",
335
373
"required": "optional",
336
374
"multiple": true,
337
375
"type": ["Conditions"],
338
-
"validation": "If present, must be an array of valid Conditions document references. All referenced documents must exist and be of type 'Conditions'. The array must be sorted according to CBOR Deterministic Encoding rules."
376
+
"validation": "If present, must be an array of valid Conditions document
377
+
references. All referenced documents must exist and be of type 'Conditions'. The
378
+
array must be sorted according to CBOR Deterministic Encoding rules."
"description": "An array of references to all Conditions documents that the user has accepted. Must include ALL conditions required by the parameter hierarchy (Brand → Campaign → Category → Contest).",
386
+
"description": "An array of references to all Conditions documents that the
387
+
user has accepted. Must include ALL conditions required by the parameter
"validation": "Must exactly match the union of all required conditions from the parameter hierarchy. All referenced documents must exist, be valid, and not be revoked. The array must be sorted according to CBOR Deterministic Encoding rules."
393
+
"validation": "Must exactly match the union of all required conditions from
394
+
the parameter hierarchy. All referenced documents must exist, be valid, and not
395
+
be revoked. The array must be sorted according to CBOR Deterministic Encoding
396
+
rules."
351
397
}
352
398
```
353
399
354
400
**Important Notes:**
355
-
- Set `multiple: true` to allow arrays of document references
356
-
- Set `required: "optional"` (but required when conditions are specified in parameter hierarchy for user documents)
357
-
- The validation logic for user documents requires transitive collection from parameter hierarchy
401
+
402
+
* Set `multiple: true` to allow arrays of document references
403
+
* Set `required: "optional"` (but required when conditions are specified in
404
+
parameter hierarchy for user documents)
405
+
* The validation logic for user documents requires transitive collection from
406
+
parameter hierarchy
358
407
359
408
#### 3. Update Document Types Table
360
409
361
410
The `types.md` file will be automatically regenerated from the JSON specification once these changes are made. Ensure the Conditions document type appears in the generated table.
362
411
363
412
### Code Generation Impact
364
413
365
-
Once these changes are made to `signed_doc.json` and the specification is released (draft status removed), the following code will need to be updated:
414
+
Once these changes are made to `signed_doc.json` and the specification is
415
+
released (draft status removed), the following code will need to be updated:
366
416
367
-
-**Rust**: Add `conditions` field to metadata structs and implement validation rules
368
-
-**Python**: Add `conditions` to `DocType` enum and metadata handling
369
-
-**Dart**: Add `conditions` to `DocumentType` enum
370
-
-**Backend Validation**: Implement transitive condition collection and matching logic
371
-
-**CLI Tools**: Add condition querying and acceptance prompts
417
+
***Rust**: Add `conditions` field to metadata structs and implement validation
418
+
rules
419
+
***Python**: Add `conditions` to `DocType` enum and metadata handling
420
+
***Dart**: Add `conditions` to `DocumentType` enum
421
+
***Backend Validation**: Implement transitive condition collection and matching
422
+
logic
423
+
***CLI Tools**: Add condition querying and acceptance prompts
372
424
373
425
## Copyright
374
426
@@ -390,4 +442,3 @@ Once these changes are made to `signed_doc.json` and the specification is releas
0 commit comments