Repository navigation
docs: add party decentralization guides - #528
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Several guide instructions currently use invalid serials, mishandle per-host credentials, or prescribe an unrecoverable new workflow run.
3 open findings
What changed in this PR
Adds practical guides for DecMan’s three party-decentralization workflows and aligns existing documentation with current behavior.
Changes:
- Adds guides for decentralized-party membership and wallet-held parties.
- Rewrites local-party guidance and updates architecture/configuration references.
- Removes orphaned Rust doc comments affecting CLI help.
| File | Description |
|---|---|
USER_GUIDE.md |
Links the new task guides. |
README.md |
Updates documentation, configuration, and API references. |
docs/USE_CASES.md |
Clarifies add-member constraints and recovery guidance. |
docs/DEPLOYMENT_GUIDE.md |
Documents tenant API keys. |
docs/DECENTRALIZING_AN_EXTERNAL_PARTY.md |
Adds the wallet-held party guide. |
docs/DECENTRALIZING_AN_EXISTING_PARTY.md |
Rewrites guidance for local parties. |
docs/ARCHITECTURE.md |
Updates workflow steps and tenant API scope. |
docs/ADDING_A_MEMBER_TO_A_DECENTRALIZED_PARTY.md |
Adds the decentralized-party membership guide. |
crates/decman/src/config.rs |
Removes a misplaced doc comment. |
crates/decman/src/cli.rs |
Corrects generated CLI help by removing an orphaned comment. |
crates/decman-wallet/README.md |
Corrects failover-hosting guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
scolear
left a comment
There was a problem hiding this comment.
Reviewed d5fe2a1.
I checked the named routes and settings against the code at main. Every /v0/tenant/* route in the three guides exists, with the /execute names from #521. DECPM_TENANT_API_KEYS, DECPM_AUTH0_SCOPE, DECPM_JWT_ROLE_CLAIM and DECPM_EXTERNAL_PARTIES_TTL_SECS all exist in cli.rs. The add-party body and the threshold rule match AddPartyRequest and the check in workflows.rs. The re-add rule matches the error text in proposals/create.rs. The tenant-key gate in middleware/auth.rs works as the README describes. The RetireLegacyKeys steps are correct.
The 308 removed lines are the old external-party content of DECENTRALIZING_AN_EXISTING_PARTY.md. The new external-party guide carries the relay rules, the no-resume rule, the idle reap, marker_cleared and RepairCommitmentsUsingAcs. The warning that the owner node can revoke a converted party's key stays in the local-party guide. Two items are gone from every guide: the /onboard to /execute rename note, and the fetched_at and refreshing polling rule for /external-parties. The rename note was a migration note, so its loss is fine. The polling rule is small, and the TTL setting is still in the README. Neither blocks.
The only Noise mention is the status text that the UI shows today. The guides do not present Noise as the long-term design.
Approve.
Users had no guide for the three ways DecMan decentralizes a party: adding a member to a decentralized party, hosting an external party on several participants, and adding hosts to an existing local party. The existing-party doc mixed external and local parties, and several docs had drifted from the code. Add one task guide per case, with UI and curl steps, prerequisites, downtime, and recovery. Rewrite the existing-party doc for local parties only. Each guide warns that a party must stay idle while a joining host is hosted but not yet importing, which is the order that crashed a MainNet participant on 2026-09-16. Fix stale docs on the way: undocumented env vars including DECPM_TENANT_API_KEYS, the missing authorize routes, the step tables that lack RetireLegacyKeys, the old add-party disconnect order, and an orphaned doc comment that clap printed as --help text for DECPM_REWARD_EXPIRY_READ_INTERVAL_SECS.
The threshold call reused the serial read before the add, so it always answered 409. The external-party loops sent one key to every host, but each host accepts only its own keys. The add-member guide sent wallet-held parties to the local-party guide.
d5fe2a1 to
fe77478
Compare
The rewrite dropped how GET /external-parties caches its list. A caller that reads an empty list right after a restart could think the host holds no external party, when the first scan has not ended yet.


Summary
Users had no guide for the three ways DecMan decentralizes a party. This PR adds one task guide for each case, and fixes docs that had drifted from the code.
New and rewritten guides
docs/ADDING_A_MEMBER_TO_A_DECENTRALIZED_PARTY.md(new) covers the add-party workflow. It lists the prerequisites, the UI and API steps, and the threshold rule. It also covers the joining node's downtime, re-adding a former member, failed runs, and quarantine.docs/DECENTRALIZING_AN_EXTERNAL_PARTY.md(new) covers a wallet-held party. It explains host setup and how to sign a hash. It also covers creating a party, adding hosts, copying the contracts, raising the threshold, and errors.docs/DECENTRALIZING_AN_EXISTING_PARTY.md(rewritten) now covers local parties only. It explains failover and co-validation, gives the curl steps for each, and shows which node signs what.Each guide warns that the party must stay idle while a joining host is hosted but not yet importing. The add-party workflow disconnects the joiner before its hosting takes effect. The tenant add-hosts path does not, which is the order that crashed a MainNet participant on 2026-09-16.
Stale docs fixed
DECPM_TENANT_API_KEYS,DECPM_AUTH0_SCOPEandDECPM_JWT_ROLE_CLAIM. The README route table now listsadd-hosts/authorizeandthreshold/authorize.RetireLegacyKeys. The add-party table now gives the current disconnect order.HostPermission::Submissiongives a wallet-held party failover. It now says that Confirmation hosting already does.cli.rsandconfig.rsis gone. Clap printed it as the--helptext ofDECPM_REWARD_EXPIRY_READ_INTERVAL_SECS.Related issues
None. The code problems found while writing these guides are listed under notes for reviewers.
Type of change
Checklist
cargo fmt -- --checkpassescargo clippy --all-targets --all-features -- -D warningsis cleancargo testpasses. Not run: the only Rust change removes doc comments<type>(<scope>): <subject>conventionHow it was checked
dec-party-manager serve --helpnow prints the right text for--reward-expiry-read-interval-secs.Notes for reviewers
The guides document current behaviour. These code problems turned up on the way, and none of them is fixed here:
HostPermission::Submissionindecman-wallethas no party it can serve. A wallet-held party has its own key, and a local party needsauthorize./v0/tenant/{party}/statusanswers 404 for a Submission host.RetireLegacyKeys, so their pipelines show no labels.serve --testinstead of--insecure.DELETE /acs-import-quarantinehas no admin-role check.