Skip to content

Commit 595cfea

Browse files
feat(docs): signed doc spec 0.04 (#341)
* fix(docs): correct python type annotations in documentation generator (#325) * feat(docs): Consolidate all parameters types into a single parameters reference. * fix(docs): Fix linked references * feat(docs): Start of adding capability to cluster like documents to simplify relationship diagrams. * fix(docs): wip fix of clustered documents * feat(docs): Add document clusters to help with autogenerated diagrams. * fix(docs): fix spelling * fix(Python): fix type * fix(docs): Inter doc links in diagrams * fix(docs): Neils Eyesight Soother * fix(docs): Rename Election Parameters to Decision parameters * fix(docs): python types * fix(docs): add missing doc generator type definitions * fix(general): Updater recommended vscode settings * docs(docs): Better define the document encoding restrictions. (#326) * feat(docs): Add examples for predefined document schemas (#342) * format the blueprint.cue * fix(docs): Update module to latest cue version * feat(docs): WIP formalized definitions of field definitions for json schema templates * feat(docs): WIP * fix(docs): simplify schema with cue format * feat(docs): WIP template defs dictionary * fix(docs): update python files we don't want in git * refactor(docs): reorganize the cue files for better modularity * refactor(docs): Move spec python model for better modularity * docs(docs): Add base of new spec python workspace and modules * fix(docs): remove lin to root ruff.toml which was impacting import sorting * refactor(docs): Reorganize the doc generator into the new module structure * refactor(docs): Cleanup document specification data structure and methods * refactor(docs): Remove last remnants of direct dict accesses. * refactor(docs): remove code obsoleted by refactor * refactor(docs): large cue refactor to stuff that should be common * docs(docs): Add chain metadata to support chained document references. * fix(docs): lint issues * fix(docs): lint issues * fix(docs): CI build issues * docs(docs): wip * docs(docs): Add fully generalized, templated parameters documents to the specification. * fix(docs): form templates do not have templates * fix(docs): remove the parameters from templates on the parameters documents themselves (redundant). * fix(docs): use common parameters definition * feat(docs): Add Representative Profiles and Nomination Forms * feat(docs): Add Rep Profiles, Nominations and Delegations documents * Update contest_delegation.cue Break line with multiple sentences * fix excess lines in null payload description * fix(docs): contest delegation spacing * fix(docs): contest structure fix * fix(docs): structure quick fix * fix(docs): fixed indentation in contest md * fix(docs): contest cue file fix * fix(docs): quick fix on indentation * fix(docs): markdown indentation fix * fix(docs): minor character and structure fix * fix(docs): contest cue file fix * fix(docs): additional indentation fix --------- Co-authored-by: Nathan Bogale <[email protected]>
1 parent 3589838 commit 595cfea

File tree

211 files changed

+14829
-4125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+14829
-4125
lines changed

.config/dictionaries/project.dic

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ ABNF
44
addrr
55
addrs
66
adminer
7+
admon
78
anypolicy
89
apskhem
910
Arissara
1011
asyncio
1112
Attributes
1213
auditability
14+
Auliffe
1315
auxdata
1416
babystep
1517
backpressure
@@ -21,6 +23,7 @@ blockdiag
2123
blockfetch
2224
blosc
2325
bmac
26+
Bogale
2427
bootstrapper
2528
BROTLI
2629
Cabe
@@ -80,6 +83,7 @@ elgamal
8083
encryptor
8184
Errno
8285
Eternl
86+
evalv
8387
excalidraw
8488
explicitely
8589
extn
@@ -160,6 +164,8 @@ ltail
160164
maindbname
161165
mapref
162166
markdownlint
167+
mdformat
168+
mdit
163169
mdlint
164170
mdns
165171
MEMMAP
@@ -175,6 +181,7 @@ mitigations
175181
mkcron
176182
mkdelay
177183
mkdirat
184+
mkdocs
178185
Mmap
179186
moderations
180187
moka
@@ -230,6 +237,7 @@ pypackages
230237
pytest
231238
pytype
232239
qpsg
240+
qrcode
233241
quic
234242
rankdir
235243
rapidoc

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
new
2+
13
## Secrets
24
**/.secret
35

@@ -87,4 +89,10 @@ $RECYCLE.BIN/
8789

8890
# Python stuff
8991
.pytest_cache
90-
__pycache__
92+
__pycache__
93+
py.typed
94+
*.egg-info
95+
.venv
96+
.ruff_cache
97+
dist
98+
*.pyi

.markdownlint-cli2.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
".config/dictionaries/**",
1212
"**/target/**",
1313
"**/.dart_tool/**",
14-
"**/.pytest_cache/**"
14+
"**/.pytest_cache/**",
15+
"**/.venv"
1516
],
1617
// Set standard config options in `/.markdownlint.jsonc`
1718
"config": {

.vscode/settings.recommended.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// Recommended `settings.json` configuration
2+
"$comment": "Recommended `settings.json` configuration",
33
"editor.formatOnSave": true,
44
"editor.codeActionsOnSave": {
55
"source.organizeImports": true,
@@ -37,12 +37,20 @@
3737
"rust",
3838
"rust/c509-certificate",
3939
"rust/cardano-chain-follower",
40+
"rust/catalyst-types",
4041
"rust/catalyst-voting",
42+
"rust/immutable-ledger",
43+
"rust/vote-tx-v1",
44+
"rust/vote-tx-v2",
45+
"rust/signed-doc",
4146
"rust/cbork",
4247
"rust/hermes-ipfs",
48+
"rust/rbac-registration",
49+
"rust/cardano-blockchain-types",
4350
"dart",
4451
"docs",
45-
"general"
52+
"general",
53+
"deps"
4654
],
4755
"conventionalCommits.gitmoji": false,
4856
"markdown.extension.toc.unorderedList.marker": "*",

blueprint.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ global: {
1212
]
1313
providers: {
1414
aws: {
15-
region: "eu-central-1"
15+
region: "eu-central-1"
1616
ecr: registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
17-
role: "arn:aws:iam::332405224602:role/ci"
17+
role: "arn:aws:iam::332405224602:role/ci"
1818
}
1919

2020
docker: credentials: {

docs/src/architecture/08_concepts/signed_doc/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ nav:
33
- Specification: spec.md
44
- Metadata Fields: metadata.md
55
- Document Types: types.md
6+
- Document Templates: templates.md
67
- docs
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
; chain
2+
3+
4+
; Reference to the previous Signed Document in a sequence.
5+
; * `height` is of the CURRENT block.
6+
; * `document_ref` is *ONLY* omitted in the very first document in a sequence.
7+
chain = [height, ? document_ref]
8+
9+
; The consecutive sequence number of the current document
10+
; in the chain.
11+
; The very first document in a sequence is numbered `0` and it
12+
; *MUST ONLY* increment by one for each successive document in
13+
; the sequence.
14+
;
15+
; The FINAL sequence number is encoded with the current height
16+
; sequence value, negated.
17+
;
18+
; For example the following values for height define a chain
19+
; that has 5 documents in the sequence 0-4, the final height
20+
; is negated to indicate the end of the chain:
21+
; `0, 1, 2, 3, -4`
22+
;
23+
; No subsequent document can be chained to a sequence that has
24+
; a final chain height.
25+
height = int
26+
27+
; Reference to a single Signed Document
28+
document_ref = [
29+
document_id,
30+
document_ver,
31+
document_locator
32+
]
33+
34+
; Document ID
35+
document_id = uuid_v7
36+
37+
; UUIDv7
38+
uuid_v7 = #6.37(bytes .size 16)
39+
40+
; Document Version
41+
document_ver = uuid_v7
42+
43+
; Where a document can be located, must be a unique identifier.
44+
document_locator = {
45+
"cid" => cid
46+
}
47+
48+
; IPLD content identifier
49+
; TODO: add size limits if possible
50+
cid = #6.42(bytes)

docs/src/architecture/08_concepts/signed_doc/cddl/document_ref.cddl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
; document_ref
22

33

4-
; Reference to another Signed Document
5-
document_ref = [ 1* [
4+
; Reference to a single Signed Document
5+
document_ref = [
66
document_id,
77
document_ver,
88
document_locator
9-
] ]
9+
]
1010

1111
; Document ID
1212
document_id = uuid_v7
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
; document_refs
2+
3+
4+
; Reference to one or more Signed Documents
5+
document_refs = [ 1* document_ref ]
6+
7+
; Reference to a single Signed Document
8+
document_ref = [
9+
document_id,
10+
document_ver,
11+
document_locator
12+
]
13+
14+
; Document ID
15+
document_id = uuid_v7
16+
17+
; UUIDv7
18+
uuid_v7 = #6.37(bytes .size 16)
19+
20+
; Document Version
21+
document_ver = uuid_v7
22+
23+
; Where a document can be located, must be a unique identifier.
24+
document_locator = {
25+
"cid" => cid
26+
}
27+
28+
; IPLD content identifier
29+
; TODO: add size limits if possible
30+
cid = #6.42(bytes)

docs/src/architecture/08_concepts/signed_doc/cddl/signed_document.cddl

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,23 @@ COSE_Document_Standard_Headers = (
3737
)
3838

3939
; Supported Content Media Types.
40-
; If uint is used, only CoAP Content Formats that match the string format are allowed.
40+
; If the Media Type is supported by COAP, then the `uint` CoAP encoded
41+
; version of the media type must be used, in preference to the string.
4142
media_type = (
42-
(uint .eq (50 / 60)) /
43+
(uint .eq (0 / 50 / 60 / 20000)) /
4344
(tstr .eq (
45+
"application/cbor" /
46+
"application/cddl" /
4447
"application/json" /
4548
"application/schema+json" /
46-
"application/cbor" /
47-
"application/cddl"
49+
"text/css; charset=utf-8" /
50+
"text/css; charset=utf-8; template=handlebars" /
51+
"text/html; charset=utf-8" /
52+
"text/html; charset=utf-8; template=handlebars" /
53+
"text/markdown; charset=utf-8" /
54+
"text/markdown; charset=utf-8; template=handlebars" /
55+
"text/plain; charset=utf-8" /
56+
"text/plain; charset=utf-8; template=handlebars"
4857
))
4958
)
5059

@@ -56,13 +65,14 @@ Signed_Document_Metadata_Headers = (
5665
"type" => document_type
5766
"id" => document_id
5867
"ver" => document_ver
59-
?"ref" => document_ref
60-
?"template" => document_ref
61-
?"reply" => document_ref
68+
?"ref" => document_refs
69+
?"template" => document_refs
70+
?"reply" => document_refs
6271
?"section" => section_ref
6372
?"collaborators" => collaborators
6473
?"revocations" => revocations
65-
?"parameters" => document_ref
74+
?"parameters" => document_refs
75+
?"chain" => chain
6676
)
6777

6878
; Document Type
@@ -80,12 +90,15 @@ uuid_v7 = #6.37(bytes .size 16)
8090
; Document Version
8191
document_ver = uuid_v7
8292

83-
; Reference to another Signed Document
84-
document_ref = [ 1* [
93+
; Reference to one or more Signed Documents
94+
document_refs = [ 1* document_ref ]
95+
96+
; Reference to a single Signed Document
97+
document_ref = [
8598
document_id,
8699
document_ver,
87100
document_locator
88-
] ]
101+
]
89102

90103
; Where a document can be located, must be a unique identifier.
91104
document_locator = {
@@ -111,6 +124,29 @@ catalyst_id_kid = bytes
111124
; List of revoked versions of this document.
112125
revocations = [ * document_ver ] / true
113126

127+
; Reference to the previous Signed Document in a sequence.
128+
; * `height` is of the CURRENT block.
129+
; * `document_ref` is *ONLY* omitted in the very first document in a sequence.
130+
chain = [height, ? document_ref]
131+
132+
; The consecutive sequence number of the current document
133+
; in the chain.
134+
; The very first document in a sequence is numbered `0` and it
135+
; *MUST ONLY* increment by one for each successive document in
136+
; the sequence.
137+
;
138+
; The FINAL sequence number is encoded with the current height
139+
; sequence value, negated.
140+
;
141+
; For example the following values for height define a chain
142+
; that has 5 documents in the sequence 0-4, the final height
143+
; is negated to indicate the end of the chain:
144+
; `0, 1, 2, 3, -4`
145+
;
146+
; No subsequent document can be chained to a sequence that has
147+
; a final chain height.
148+
height = int
149+
114150
; Generic Header definition
115151
COSE_Generic_Headers = ( * COSE_label => COSE_values )
116152

0 commit comments

Comments
 (0)