Skip to content

Commit 09b67a0

Browse files
committed
docs(docs): Proposals flow done
1 parent e23777e commit 09b67a0

File tree

8 files changed

+295
-149
lines changed

8 files changed

+295
-149
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Voting Process
22
nav:
33
- Parameters Hierarchy and Pub/Sub Discovery: parameters_hierarchy_and_discovery.md
4+
- Proposals, Templates, and Pub/Sub Discovery: proposals_templates_and_discovery.md
45
- Voting Protocol Cryptography Schema: crypto.md
56
- Jörmungandr Voting Transaction (Historical): jormungandr_vote_format_historical.md
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
Title: Proposals, Templates, and Pub/Sub Discovery
3+
Authors:
4+
- Steven Johnson <[email protected]>
5+
Created: 2025-11-05
6+
order: 2
7+
---
8+
9+
## Abstract
10+
11+
Shows how Proposal documents relate to their Templates, how submission state is determined,
12+
and how all artifacts are discovered and validated in a decentralized pub/sub network.
13+
14+
## Documents and Roles
15+
16+
* [Proposal](../docs/proposal.md): the authored content.
17+
* [Proposal Form Template](../docs/proposal_form_template.md): defines schema and form hints.
18+
* [Proposal Submission Action](../docs/proposal_submission_action.md): signals `final`, `draft`, or `hide`.
19+
* *Optional [Proposal Comment](../docs/proposal_comment.md)* and
20+
*[Proposal Comment Form Template](../docs/proposal_comment_form_template.md)* artifacts exist;
21+
* *Optional [Proposal Moderation Action](../docs/proposal_moderation_action.md)* artifacts exist;
22+
23+
## Relationships
24+
25+
* A Proposal references a Proposal Form Template via [`metadata.template`](../metadata.md#template)
26+
and a system parameters anchor via [`metadata.parameters`](../metadata.md#parameters).
27+
* The template’s own [`parameters`](../metadata.md#parameters) must transitively align to the
28+
same Brand/Campaign/Category chain.
29+
* A Proposal Submission Action references the Proposal via `metadata.ref` and repeats `metadata.parameters`,
30+
linked to [`ref`](../metadata.md#ref) for consistency.
31+
* Multiple collaborators may exist; all listed collaborators must submit equivalent `final`
32+
actions to be considered final by the deadline.
33+
34+
The Deadline for a Proposal to be Final will be defined in the applicable parameters document(s),
35+
typically the Category Parameters document.
36+
37+
## Versioning and Collaboration
38+
39+
* Proposal [`id`](../metadata.md#id) and [`ver`](../metadata.md#ver) are [UUIDv7][RFC9562-V7].
40+
* The first Proposal version must be signed by the original author;
41+
later versions may be signed by the author or a collaborator from the immediately prior version.
42+
See: [Proposal validation](../docs/proposal.md#validation).
43+
* Collaborators are listed in `metadata.collaborators`;
44+
actions from collaborators confirm or rescind participation.
45+
See: [Proposal Submission Action](../docs/proposal_submission_action.md).
46+
47+
## Pub/Sub Discovery Model
48+
49+
### Overview
50+
51+
* Publication and topic routing are defined by the parameters anchor (brand/campaign/category).
52+
See: [Parameters Hierarchy and Discovery](parameters_hierarchy_and_discovery.md) for topic
53+
scope, naming, and subscription strategies.
54+
* Producers publish each document to the topic derived from its `metadata.parameters`.
55+
* Consumers subscribe to the relevant topics for their chosen anchor(s) and filter by document type.
56+
57+
### Discovery Workflow
58+
59+
1. Discover templates
60+
* Subscribe to the anchor topic(s) and collect all
61+
[Proposal Form Template](../docs/proposal_form_template.md) documents.
62+
* For each `template.id`, select the latest `template.ver` (respecting `revocations`).
63+
* The resulting set enumerates which proposal templates are enabled at the given anchor.
64+
2. Discover proposals
65+
* Collect or Publish new [Proposal](../docs/proposal.md) documents that reference one of the
66+
discovered templates via `metadata.template`.
67+
* Enforce that `metadata.parameters` on the proposal matches the anchor and links to the same
68+
parameters chain as the template.
69+
3. Ingest submission actions
70+
* Collect [Proposal Submission Action](../docs/proposal_submission_action.md) documents by
71+
proposal `metadata.ref`.
72+
* Track the latest action per signer (author or listed collaborator): `final`, `draft`, or `hide`.
73+
* A proposal is eligible to be “final” only if all required signers have a latest `final`
74+
action by the configured deadline.
75+
4. Apply moderation and policy
76+
* If present, process [Proposal Moderation Action](../docs/proposal_moderation_action.md)
77+
artifacts that may hide or disqualify proposals (policy‑dependent).
78+
* Respect `hide` semantics from submission actions and moderation decisions in UI and candidate
79+
selection.
80+
5. Handle revocations
81+
* Honor [`revocations`](../metadata.md#revocations) on proposals or related artifacts.
82+
Implementations should treat comments under a revoked proposal as revoked for visibility,
83+
unless the proposal is re‑instated.
84+
6. Comments
85+
* [Proposal Comment](../docs/proposal_comment.md) documents attach to a proposal;
86+
replies attach to another comment.
87+
* All comments and replies must link to the same proposal; cross‑proposal replies are invalid.
88+
* Comments may be moderated via [Proposal Moderation Action](../docs/proposal_moderation_action.md)
89+
and hidden/redacted accordingly.
90+
91+
### Finalization
92+
93+
* At the configured moderation/finalization deadline (from parameters), compute the final set of
94+
candidate proposals for the contest at the same anchor level.
95+
* The candidate set consists of proposals that are “final” (per signer unanimity) and not
96+
disqualified by moderation.
97+
* These candidates feed into the contest voting process (described in the voting flow documentation).
98+
99+
### Flow (Mermaid)
100+
101+
```mermaid
102+
flowchart TD
103+
A["Subscribe to Topics per Anchor<br/>(Brand/Campaign/Category)"] --> B[Discover Templates]
104+
B --> C[Discover/Publish Proposals<br/>referencing template + parameters]
105+
C --> D[Ingest/Publish Submission Actions<br/>author + collaborators]
106+
D --> E{By deadline:<br/>all-final?}
107+
E -- No --> F[Status: Draft/Hidden]
108+
E -- Yes --> G[Status: Final Candidate]
109+
C --> H[Ingest Moderation Actions]
110+
H --> I{Moderated?}
111+
I -- No --> K[No change]
112+
I -- Yes --> J[Hide/Disqualify<br/>per policy]
113+
G --> L[Candidate Set]
114+
K --> L
115+
L --> M[Contest Voting Inputs]
116+
```
117+
118+
### Consumer Pipeline
119+
120+
1. Template intake
121+
* Verify signature, type, id/ver, `metadata.parameters`, and payload schema validity.
122+
* Index by `(template-id, ver)` and by anchor.
123+
2. Proposal intake
124+
* Verify signature, `metadata.template`, `metadata.parameters` (linked to template),
125+
and payload against the template schema.
126+
* Track authorship and collaborators; index by `(proposal-id, ver)` and by anchor.
127+
3. Submission Action intake
128+
* Verify signature from author or collaborator; verify `metadata.ref`
129+
points to the intended proposal and `metadata.parameters` matches (linked_refs to `ref`).
130+
* For each signer, record latest action: `final`, `draft`, or `hide`.
131+
* A proposal is “final” iff all listed collaborators (and the author) have a latest
132+
`final` action by the configured deadline.
133+
4. Moderation Action intake (optional)
134+
* Verify signature and policy scope; verify `metadata.ref` points to the intended proposal and
135+
`metadata.parameters` matches.
136+
* Apply moderation outcomes to proposal visibility and eligibility per policy.
137+
138+
### Status Computation
139+
140+
* Final Set: proposals with all required `final` actions, within configured windows defined by
141+
parameters, and not disqualified by moderation.
142+
* Draft Only: proposals with at least one `draft` and no conflicting `final` from that signer.
143+
* Hidden: honor `hide` semantics (author hides the proposal; collaborator hide = collaborator does
144+
not wish to be shown), and apply moderation decisions.
145+
146+
## Validation Summary
147+
148+
* Verify `type`, `id`, `ver`, `kid`, `content type`, and (if present) `content-encoding`.
149+
* Verify `metadata.template` exists and aligns via `metadata.parameters` up the same chain.
150+
* Validate the proposal payload against the referenced template [JSON Schema][JSON Schema-2020-12].
151+
* For submission actions, enforce signer rules and collaborator unanimity for `final`.
152+
* Apply [`revocations`](../metadata.md#revocations) and prefer the highest valid
153+
[`ver`](../metadata.md#ver) per [`id`](../metadata.md#id).
154+
155+
## Content Addressing and Retrieval
156+
157+
* All documents carry a `document_ref` that includes a [CBOR][RFC8949] Tag 42 CID locator.
158+
See: [Document Reference](../metadata.md#document-reference).
159+
* Pub/sub provides dissemination; the CID enables retrieval from content-addressed
160+
storage and ensures immutability.
161+
162+
## Operational Notes
163+
164+
* Timelines and windows come from the applicable parameters (brand/campaign/category/contest);
165+
consumers should enforce submission cutoffs as configured.
166+
* Indexes: maintain by proposal, by anchor, and by template to accelerate UI queries.
167+
168+
[JSON Schema-2020-12]: https://json-schema.org/draft/2020-12
169+
[RFC9562-V7]: https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7
170+
[RFC8949]: https://www.rfc-editor.org/rfc/rfc8949.html

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ line-length = 120
3333
indent-width = 4
3434

3535
# Assume Python 3.13
36-
target-version = "py313"
36+
target-version = "py314"
3737

3838
[lint]
3939
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.

specs/generators/.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
3.14
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
3.14

specs/generators/pages/signed_doc/voting_process/proposals_templates_and_discovery.md.jinja

Lines changed: 83 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ and how all artifacts are discovered and validated in a decentralized pub/sub ne
2424

2525
* A Proposal references a Proposal Form Template via [`metadata.template`](../metadata.md#template)
2626
and a system parameters anchor via [`metadata.parameters`](../metadata.md#parameters).
27-
* The template’s own [`parameters`](../metadata.md#parameters) must transitively align to the
28-
same Brand/Campaign/Category chain.
27+
* The template’s own [`parameters`](../metadata.md#parameters) must transitively align to the
28+
same Brand/Campaign/Category chain.
2929
* A Proposal Submission Action references the Proposal via `metadata.ref` and repeats `metadata.parameters`,
30-
linked to `ref` for consistency.
31-
* Multiple collaborators may exist; all listed collaborators must submit equivalent `final`
32-
actions to be considered final by the deadline.
30+
linked to [`ref`](../metadata.md#ref) for consistency.
31+
* Multiple collaborators may exist; all listed collaborators must submit equivalent `final`
32+
actions to be considered final by the deadline.
3333

3434
The Deadline for a Proposal to be Final will be defined in the applicable parameters document(s),
3535
typically the Category Parameters document.
@@ -46,26 +46,74 @@ typically the Category Parameters document.
4646

4747
## Pub/Sub Discovery Model
4848

49-
All documents are published in the appropriate topic as defined by specs/generators/pages/signed_doc/voting_process/parameters_hierarchy_and_discovery.md.jinja
50-
and their parameters metadata.
51-
52-
To discover the proposal template, a client looks in the appropriate topic for unique document IDs of the proposal template type.
53-
Then they choose the latest version of that template.
54-
This allows a client to determine all the possible proposal templates which are enabled for a given brand, campaign or category.
55-
Client applications then use the templates they discover to allow clients to submit proposal documents which match those templates.
56-
The timing and allowability and other rules are defined by the appropriate prameters document and its parent parameters documents.
57-
Once a proposal is submitted, its automatically draft.
58-
It can be made final by the deadline (as defined by parameters).
59-
If it is, it is a candidate proposal for a contest on the same parameter level.
60-
However, the proposal may be moderated and not be allowed to be a candidate proposal for the contest if a moderation action is submitted against it.
61-
Proposal comments may be attached to a proposal, and they may also be attached to another comment (acting as a reply).
62-
In this case they must link to the same proposal. You cant reply to a proposal comment on a different proposal.
63-
Comments can also be moderated via moderation actions. And in which case the client interface should hide them or show them as moderated and redacted.
64-
Comments and proposals can be revoked by their authors.
65-
When a proposal is revoked, all its comments should also be considered revoked, unless it is subsequently re-instated.
66-
67-
At the campaign moderation deadline, the final set of candidate proposals for the contest is determined.
68-
These are then used in the contest voting process, described elsewhere.
49+
### Overview
50+
51+
* Publication and topic routing are defined by the parameters anchor (brand/campaign/category).
52+
See: [Parameters Hierarchy and Discovery](parameters_hierarchy_and_discovery.md) for topic
53+
scope, naming, and subscription strategies.
54+
* Producers publish each document to the topic derived from its `metadata.parameters`.
55+
* Consumers subscribe to the relevant topics for their chosen anchor(s) and filter by document type.
56+
57+
### Discovery Workflow
58+
59+
1. Discover templates
60+
* Subscribe to the anchor topic(s) and collect all
61+
[Proposal Form Template](../docs/proposal_form_template.md) documents.
62+
* For each `template.id`, select the latest `template.ver` (respecting `revocations`).
63+
* The resulting set enumerates which proposal templates are enabled at the given anchor.
64+
2. Discover proposals
65+
* Collect or Publish new [Proposal](../docs/proposal.md) documents that reference one of the
66+
discovered templates via `metadata.template`.
67+
* Enforce that `metadata.parameters` on the proposal matches the anchor and links to the same
68+
parameters chain as the template.
69+
3. Ingest submission actions
70+
* Collect [Proposal Submission Action](../docs/proposal_submission_action.md) documents by
71+
proposal `metadata.ref`.
72+
* Track the latest action per signer (author or listed collaborator): `final`, `draft`, or `hide`.
73+
* A proposal is eligible to be “final” only if all required signers have a latest `final`
74+
action by the configured deadline.
75+
4. Apply moderation and policy
76+
* If present, process [Proposal Moderation Action](../docs/proposal_moderation_action.md)
77+
artifacts that may hide or disqualify proposals (policy‑dependent).
78+
* Respect `hide` semantics from submission actions and moderation decisions in UI and candidate
79+
selection.
80+
5. Handle revocations
81+
* Honor [`revocations`](../metadata.md#revocations) on proposals or related artifacts.
82+
Implementations should treat comments under a revoked proposal as revoked for visibility,
83+
unless the proposal is re‑instated.
84+
6. Comments
85+
* [Proposal Comment](../docs/proposal_comment.md) documents attach to a proposal;
86+
replies attach to another comment.
87+
* All comments and replies must link to the same proposal; cross‑proposal replies are invalid.
88+
* Comments may be moderated via [Proposal Moderation Action](../docs/proposal_moderation_action.md)
89+
and hidden/redacted accordingly.
90+
91+
### Finalization
92+
93+
* At the configured moderation/finalization deadline (from parameters), compute the final set of
94+
candidate proposals for the contest at the same anchor level.
95+
* The candidate set consists of proposals that are “final” (per signer unanimity) and not
96+
disqualified by moderation.
97+
* These candidates feed into the contest voting process (described in the voting flow documentation).
98+
99+
### Flow (Mermaid)
100+
101+
```mermaid
102+
flowchart TD
103+
A["Subscribe to Topics per Anchor<br/>(Brand/Campaign/Category)"] --> B[Discover Templates]
104+
B --> C[Discover/Publish Proposals<br/>referencing template + parameters]
105+
C --> D[Ingest/Publish Submission Actions<br/>author + collaborators]
106+
D --> E{By deadline:<br/>all-final?}
107+
E -- No --> F[Status: Draft/Hidden]
108+
E -- Yes --> G[Status: Final Candidate]
109+
C --> H[Ingest Moderation Actions]
110+
H --> I{Moderated?}
111+
I -- No --> K[No change]
112+
I -- Yes --> J[Hide/Disqualify<br/>per policy]
113+
G --> L[Candidate Set]
114+
K --> L
115+
L --> M[Contest Voting Inputs]
116+
```
69117

70118
### Consumer Pipeline
71119

@@ -82,20 +130,27 @@ These are then used in the contest voting process, described elsewhere.
82130
* For each signer, record latest action: `final`, `draft`, or `hide`.
83131
* A proposal is “final” iff all listed collaborators (and the author) have a latest
84132
`final` action by the configured deadline.
133+
4. Moderation Action intake (optional)
134+
* Verify signature and policy scope; verify `metadata.ref` points to the intended proposal and
135+
`metadata.parameters` matches.
136+
* Apply moderation outcomes to proposal visibility and eligibility per policy.
85137

86138
### Status Computation
87139

88-
* Final Set: proposals with all required `final` actions, within configured windows defined by parameters.
140+
* Final Set: proposals with all required `final` actions, within configured windows defined by
141+
parameters, and not disqualified by moderation.
89142
* Draft Only: proposals with at least one `draft` and no conflicting `final` from that signer.
90-
* Hidden: honor `hide` semantics (author hides the proposal; collaborator hide = collaborator does not wish to be shown).
143+
* Hidden: honor `hide` semantics (author hides the proposal; collaborator hide = collaborator does
144+
not wish to be shown), and apply moderation decisions.
91145

92146
## Validation Summary
93147

94148
* Verify `type`, `id`, `ver`, `kid`, `content type`, and (if present) `content-encoding`.
95149
* Verify `metadata.template` exists and aligns via `metadata.parameters` up the same chain.
96150
* Validate the proposal payload against the referenced template JSON Schema.
97151
* For submission actions, enforce signer rules and collaborator unanimity for `final`.
98-
* Apply `revocations` and prefer the highest valid `ver` per `id`.
152+
* Apply [`revocations`](../metadata.md#revocations) and prefer the highest valid
153+
[`ver`](../metadata.md#ver) per [`id`](../metadata.md#id).
99154

100155
## Content Addressing and Retrieval
101156

@@ -109,4 +164,3 @@ These are then used in the contest voting process, described elsewhere.
109164
* Timelines and windows come from the applicable parameters (brand/campaign/category/contest);
110165
consumers should enforce submission cutoffs as configured.
111166
* Indexes: maintain by proposal, by anchor, and by template to accelerate UI queries.
112-

specs/generators/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "generators"
33
version = "0.1.0"
4-
requires-python = ">=3.13"
4+
requires-python = ">=3.14"
55
dependencies = [
66
"css-inline>=0.18.0",
77
"great-tables>=0.20.0",
@@ -10,7 +10,7 @@ dependencies = [
1010
"mdformat>=1.0.0",
1111
"mdformat-mkdocs>=4.4.2",
1212
"polars>=1.35.1",
13-
"pydantic>=2.12.3",
13+
"pydantic>=2.12.4",
1414
"pydot>=4.0.1",
1515
"rich>=14.2.0",
1616
"rich-argparse>=1.7.2",

0 commit comments

Comments
 (0)