Skip to content

test(voting): whole voting stack on develop, integration check (do not merge) - #1404

Draft
romchornyi wants to merge 23 commits into
developfrom
test/voting-stack-integration
Draft

romchornyi wants to merge 23 commits into
developfrom
test/voting-stack-integration

Conversation

@romchornyi

@romchornyi romchornyi commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Do not merge. This PR is a check, and it will be closed.

This is the whole username voting stack (#1326 → #1327 → #1328 → #1347 → #1366, at 62b5d9a42, #1366's head) with current develop (d5f92c605) merged in. It has one purpose: to see whether CI and the automated review find a blocker in the combined change that the per-PR reviews missed.

🤖 Generated with Claude Code

romchornyi and others added 12 commits November 12, 2026 23:06
Rebuilt on develop for the fifth PR review round. The screen keeps its own NavigationStack in the menu's push (#1220 moved other screens to UIKit pushes); the DashUIKit bar arrives with the vote-from-pills stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 8be3c00648ecd7986c749e06545bf868ac841fbf
Rebuilt on develop with the fifth PR review round: 11 catalog keys the bulk path left unused are gone, the deleted sheet's a11y baseline entry too, and the disabled links filter says it is coming.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 7bb3b1f07f199e284d325345aa578e840f1b52fa
… row, keep contests until voting ends

Rebuilt on develop with the fifth PR review round: VoiceOver reads a request by a short identity, and the Request details review line has its catalog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 72a21762ac409d47e3e4ca2c94324c8d023bb71b
…ur voting keys

Rebuilt with the seventh PR review round: an imported voting key the keychain could not read leaves the node list incomplete, so its tick is not forgotten; develop's WatchApp schemes restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 705f7d279ed8080660e1c1197d8c48c5908ca535
…Quick voting

Rebuilt with the seventh PR review round: Try again leaves a masternode with no vote left as reported and a resend keeps each masternode's own outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 9841a47ea3c8d083c660be20bdf66308dc7e4a51
…st turns complete with the same rows

Eighth PR review round: a vote-mode tick hidden by a partial node list is dropped once the list turns complete, also when the rows stay the same, so a later partial list cannot confirm a node the complete one proved gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: a18e08a04ca8e4f48fe706bc45a9818c6d0fb015
Add your voting keys rechecks the ticks when the node list turns complete with the same rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: e6bf942d4fb698176a99b4420cd4f97210c00fbb
…filter by

Notes from the approval of #1327: a my-vote filter on a wallet whose synced node list holds no voting node now says the wallet has no masternode voting keys instead of a passing fault; the unused sort raw-value test is dropped; the a11y baseline's total matches its findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 0a303a0b45ef738232afe12281e70fb6bbdb64fa
A vote Platform already holds (40304) reads as held instead of try again, and 40301 reads as closed; the caster's PIN-less loop is named castAfterAuthentication; the feature summary says what the vote limit and the kept contests guarantee; store comments no longer cite documents outside the repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: b2105c399150ff8be02655435a531aca472ef6f7
…hidden remembered choice keeps the only row unticked

Ninth PR review round: confirming One vote left or the block dialog rechecks the time and whether Platform closed the contest, so an ended contest is reported and nothing is sent; Add your voting keys no longer ticks the only row while the remembered choice holds a node the incomplete list hides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 3ae0853a1b67a21fa0220d551b443e3a2b93785d
A confirmation past the voting end sends nothing; a hidden remembered choice keeps the only row unticked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 783eeecf1820d5c7652359f3eabcfaf148a55fc3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit e19e48e. Normal review starts when eligible; priority review starts as soon as a slot is available.

romchornyi and others added 9 commits November 13, 2026 16:06
… a hidden node is remembered

Before setup the store has no choice to show when the remembered node is
one an incomplete node list hides; vote mode no longer falls back to the
first row then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 2a63077fe6377526ea5c82e14bc6dc9cf65ebe09
…e plan, tells no progress for a run stopped at the PIN, and names the linked request with links only

- A run before the wallet's sync is done could treat a partial node list as
  the whole wallet; it is refused at the tap and at the run.
- A planned masternode no longer votable made the run drop that name from
  the report; the run now refuses the stale plan.
- A run stopped while the PIN prompt was up no longer reports progress.
- With "Only requests with links" on, the sheet says the linked request
  submitted first gets the approve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: a7f51bc425f048cde47ac3953f9040bc3f4baca7
… end before every send, Try again never resends an unconfirmed vote, the key flow waits for a complete node list, and a second Quick voting tap while opening is ignored

Closes the r13 findings on #1366: the deadline recheck before each cast, the unconfirmed broadcast kept out of Try again, key entry while node resolution is incomplete, concurrent Quick voting starts. The run-coordinator redesign is tracked in #1417.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 7dfe7f5dc168476e84be9a00a08a081e2dcfb15e
…d, opens once after key setup, and never calls an unconfirmed vote not cast

Review round on #1366 (thepastaclaw at b81d6dc):
- deadline recheck at the last point before the broadcast, after the vote count read and key derivation
- the continuation after Add your voting keys opens under the same opening guard as the menu
- a vote that may have landed reads Result not confirmed, is not counted as not cast, and the Quick voting result says so

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 1df255105bd232cf61c78bc424cf7bb65be4ab9e
The nodes read before the wallet's sync is done may not be all of this
wallet's, so the types that read its own votes cannot filter yet and say
the list is still syncing. The store now knows whether the sync was done
when it read the votable nodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: 25a73a91cd14a95b0f65f55fbe51df90debbe25f
…settles the remembered choice

Before the sync is done the registry can return imported nodes while this
wallet's own are not found yet. That resolution is now partial, so the
store does not drop remembered nodes against it and Add your voting keys
keeps hidden ticks. Includes the filter-by-my-vote sync gate from below.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: dfd23434e28115c8f679734815c08d682561ff2f
A my-votes filter before the wallet's sync says the list is still syncing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: dbd2091c5a7194b3723d5dabdfe42d150c974462
Brings the check up to the current stack head (62b5d9a) and develop (d5f92c6). Conflicts: the voting menu entry takes develop's weak navigation controller and drops the tab-bar flag BaseNavigationController already sets; the string catalogs take develop's sorted catalogs plus the stack's own key changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The voting stack has two in-scope correctness blockers. The pushed hosting controller leaves the outer UIKit navigation bar active, allowing an enabled back button to bypass the single-vote hold, and Quick voting does not bind the complete authenticated run to one SDK, wallet, and network context. The date-sort issue is also valid but non-blocking: unknown end dates sort first in newest-to-oldest mode. CI has no failed code checks in the supplied snapshot; accessibility and workflow checks passed, while test-target membership remains queued.

🔴 2 blocking | 🟡 1 suggestion(s)

3 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: Voting host leaves the outer UIKit back button enabled
DashWallet/Sources/UI/DashPay/Voting/UsernameVotingScreen.swift:33-43

UsernameVotingHostingController embeds its view in a SwiftUI NavigationStack but does not conform to NavigationBarDisplayable. Consequently, BaseNavigationController.willShow leaves the outer UIKit navigation bar visible and installs its own back button. The screen's .toolbar(.hidden, for: .navigationBar) hides only the inner SwiftUI bar. The outer button calls backButtonAction, which directly pops this hosting controller because it is not NavigationStackControllable; it does not honor VotingViewModel.holdsScreen. During an in-flight single vote, the visible DashUIKit back button is disabled and the interactive-pop gesture is disabled, but this outer button still allows the user to leave while the vote is busy. didMove stops Quick voting after the pop, but it does not enforce the single-vote hold. Make the hosting controller hide the outer navigation bar/back button, as the other pushed SwiftUI portals do.

extension UsernameVotingHostingController: NavigationBarDisplayable {
    var isBackButtonHidden: Bool { true }
    var isNavigationBarHidden: Bool { true }
}

source: muse-spark-1.3-contributor (phase1-reviewer: general)

🟡 Suggestion: Unknown end dates sort first in date-new-to-old mode
DashWallet/Sources/UI/DashPay/Voting/VotingFilter.swift:145-150

The .dateNewToOld comparator reverses the operands and also passes unknownLast: false. With one known end date and one nil end date, this makes the unknown date compare as earlier, so undated contests appear before all dated contests. The filter documentation and VotingFilterTests.testDateOrdersFollowTheEndAndPutAnUnknownEndLast require unknown dates to remain last in both date directions.

case .dateNewToOld:
    return Self.stableSorted(kept) { Self.ends($1, before: $0) }

source: gpt-6.1-sol (phase2-reviewer: general, ffi-engineer, security-auditor)

🔴 Blocking: Bind the complete voting run to one SDK wallet and network context
DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift:207-217

The production default send closure resolves SwiftDashSDKHost.shared.sdk anew for every node, while cast only checks that an SDK exists and castRun only checks isSDKConnected() before authentication. Every call then suspends during contest reads, history reads, key derivation, or the FFI broadcast. If the wallet runtime stops and restarts, or the user switches wallet/network, the remaining votes can use a newly published SDK and dynamically resolved key source/network after authentication and confirmation were performed against the previous context. The planned node hashes and contender labels can therefore be sent through the wrong wallet or network, or fail with stale-context data. Capture an immutable operation context containing the SDK, active wallet, network, and key source at the start of the operation, use it for every preflight/key/broadcast step, and abort the run when that context changes. The same binding is required for both cast and castRun; retaining only the SDK for one individual send is insufficient.

source: gpt-6.1-sol (phase2-reviewer: general, ffi-engineer, security-auditor)

Review provenance

Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.1-sol (effort low) — This is a large, intricate voting-stack change that modifies masternode vote casting, vote state management, identity verification integration, and SwiftDashSDK-facing code in MasternodeVoteCaster.swift and related services, affecting signed peer-facing governance operations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — ffi-engineer (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `DashWallet/Sources/UI/DashPay/Voting/UsernameVotingScreen.swift`:
- [BLOCKING] DashWallet/Sources/UI/DashPay/Voting/UsernameVotingScreen.swift:33-43: Voting host leaves the outer UIKit back button enabled
  `UsernameVotingHostingController` embeds its view in a SwiftUI `NavigationStack` but does not conform to `NavigationBarDisplayable`. Consequently, `BaseNavigationController.willShow` leaves the outer UIKit navigation bar visible and installs its own back button. The screen's `.toolbar(.hidden, for: .navigationBar)` hides only the inner SwiftUI bar. The outer button calls `backButtonAction`, which directly pops this hosting controller because it is not `NavigationStackControllable`; it does not honor `VotingViewModel.holdsScreen`. During an in-flight single vote, the visible DashUIKit back button is disabled and the interactive-pop gesture is disabled, but this outer button still allows the user to leave while the vote is busy. `didMove` stops Quick voting after the pop, but it does not enforce the single-vote hold. Make the hosting controller hide the outer navigation bar/back button, as the other pushed SwiftUI portals do.

In `DashWallet/Sources/UI/DashPay/Voting/VotingFilter.swift`:
- [SUGGESTION] DashWallet/Sources/UI/DashPay/Voting/VotingFilter.swift:145-150: Unknown end dates sort first in date-new-to-old mode
  The `.dateNewToOld` comparator reverses the operands and also passes `unknownLast: false`. With one known end date and one `nil` end date, this makes the unknown date compare as earlier, so undated contests appear before all dated contests. The filter documentation and `VotingFilterTests.testDateOrdersFollowTheEndAndPutAnUnknownEndLast` require unknown dates to remain last in both date directions.

In `DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift`:
- [BLOCKING] DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift:207-217: Bind the complete voting run to one SDK wallet and network context
  The production default `send` closure resolves `SwiftDashSDKHost.shared.sdk` anew for every node, while `cast` only checks that an SDK exists and `castRun` only checks `isSDKConnected()` before authentication. Every call then suspends during contest reads, history reads, key derivation, or the FFI broadcast. If the wallet runtime stops and restarts, or the user switches wallet/network, the remaining votes can use a newly published SDK and dynamically resolved key source/network after authentication and confirmation were performed against the previous context. The planned node hashes and contender labels can therefore be sent through the wrong wallet or network, or fail with stale-context data. Capture an immutable operation context containing the SDK, active wallet, network, and key source at the start of the operation, use it for every preflight/key/broadcast step, and abort the run when that context changes. The same binding is required for both `cast` and `castRun`; retaining only the SDK for one individual send is insufficient.

@romchornyi

Copy link
Copy Markdown
Contributor Author

Review at 593f7d968:

  • Voting host leaves the outer UIKit back button enabled: not changing this. Checked on a simulator build of this head: the voting screen shows only the DashUIKit bar, and its accessibility tree has a single back button (navigationbar-back, the one the vote hold disables); no outer UIKit back button is shown.
  • Bind the complete voting run to one SDK, wallet and network context: deferred to Voting: one run coordinator for Quick voting (plan snapshot, settlement state, lifecycle) #1417 (added there). Each vote is signed with that masternode's own voting key, and a network or wallet switch means leaving the screen, which stops Quick voting while a single vote holds the screen, so the realistic outcome is a failed send.
  • Unknown end dates sort first in date-new-to-old mode: not changing this. The reversed comparison uses unknownLast: false, which puts an unknown end last; VotingFilterTests.testDateOrdersFollowTheEndAndPutAnUnknownEndLast asserts [late, middle, early, unknown] for that order and passes.

romchornyi and others added 2 commits November 15, 2026 17:33
…he PIN prompt can show

Vote for all closed the Quick voting sheet and asked for the PIN in the same
turn. UIKit rejects a modal presented while a sheet is leaving, so on a Release
build the PIN prompt never showed and every run ended with "Authentication
failed". The run now starts from the sheet's (or "One vote left"'s) onDismiss,
as the single vote already does. Found in the live testnet check before the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDD-Published-From: c96362c2cd5a719402f2b565efa62bc4da93ad42
…gration check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants