Skip to content

feat(nodetask): consume gov task results — outputs, conditions, pending loop#451

Merged
bdchatham merged 1 commit into
mainfrom
feat/nodetask-gov-outputs
Jul 6, 2026
Merged

feat(nodetask): consume gov task results — outputs, conditions, pending loop#451
bdchatham merged 1 commit into
mainfrom
feat/nodetask-gov-outputs

Conversation

@bdchatham

Copy link
Copy Markdown
Collaborator

The controller half of the SeiNodeTask governance UX work (design: sei-protocol/bdchatham-designs#98) — consumes the seictl v0.0.61 gov completion contract. This is the payoff: a completed gov task now surfaces its proposal ID / tx hash, a task reports Failed instead of a false Complete when a tx doesn't commit, and the integration test's brittle proposal-ID REST scan is deleted.

Depends on: seictl#219 (v0.0.61). Follows PR #450 (stop-resubmit).

Changes

  • go.mod → seictl v0.0.61.
  • sidecarExecution.Result() captures the terminal task result (both success and failure paths).
  • driveTask decodes the gov result and branches: committed_ok → Complete + Ready/Confirmed + outputs; committed_failed → Failed/TxFailed + outputs; pending → reset to Pending and re-submit (same task ID → engine run+1 → marker adopt re-checks), bounded by spec.timeoutSeconds; on timeout → Failed/InclusionUndetermined (txHash retained). Non-gov failures unchanged.
  • populateOutputs stamps proposalId/txHash/height into the existing CRD Outputs (decode-by-kind, via a local wire-mirror — no heavy sidecar-tasks import). No CRD schema change.
  • SDK TaskOutputs gains gov arms; integration test reads the proposal ID off the task output and deletes resolveProposalID (the plan-name REST scan).
  • Refreshed the stale "outputs deferred / chain-as-medium" docs.

Tests

controller_gov_test.go: Confirmed / CommittedFailed / Pending→resubmit→converge / PendingTimeout / GovVote-confirmed / no-result→generic-failure, plus TestGovResultMirrorMatchesWire (guards the local mirror against seictl GovTxResult drift).

Sign-off

systems-engineer (pending loop, decode, idempotency — logic correct, no changes) and kubernetes-specialist (condition discipline, single-patch, contract-safe) — both green.

⚠️ Deploy-order (one-way-door adjacent)

Roll this controller before the seictl v0.0.61 sidecar image. A pre-2b controller treats the new sidecar's pending→Failed as terminal and would prematurely fail an in-flight gov tx. New-controller + old-sidecar is graceful (nil result → today's behavior).

Reviewer flag for confirmation

Gov-kind success now emits Ready reason=Confirmed (was TaskComplete). Confirm no PromQL/runbook filters the old reason for gov kinds (gov-ops is a newer surface, likely safe).

🤖 Generated with Claude Code

…ng loop

Bumps seictl to v0.0.61 and consumes its gov completion contract:

- sidecarExecution gains a Result() accessor capturing the terminal task
  result (stamped on both success and failure).
- driveTask decodes the gov result and branches: committed_ok -> Complete +
  Ready/Confirmed + outputs; committed_failed -> Failed/TxFailed + outputs;
  pending -> reset to Pending and re-submit (same task ID -> engine re-run ->
  marker adopt), bounded by spec.timeoutSeconds; on timeout -> Failed/
  InclusionUndetermined (txHash retained). Non-gov failures unchanged.
- populateOutputs stamps proposalId/txHash/height into the existing CRD
  Outputs for the three gov kinds (decode-by-kind, no sidecar-tasks import).
- SDK TaskOutputs surfaces gov outputs; the integration test now reads the
  proposal ID off the upgrade task output and deletes resolveProposalID (the
  brittle plan-name REST scan).
- Refresh the stale "outputs deferred / chain-as-medium" docs.

Deploy-order: this controller must roll BEFORE the v0.0.61 sidecar image
(D1=X interim — an old controller sees Failed where it saw Complete).

Design: sei-protocol/bdchatham-designs#98.

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

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Gov reconciliation and on-chain tx outcome handling changed materially; deploy order requires this controller before seictl v0.0.61 sidecars or in-flight gov tasks can fail prematurely, and gov success now uses Ready reason Confirmed instead of TaskComplete.

Overview
Bumps seictl to v0.0.61 and wires the controller to the sidecar’s structured gov task results (txHash, proposalId, inclusionStatus). Terminal GetTask payloads are captured on sidecarExecution.Result() and decoded via a local govResult mirror in govoutputs.go.

Gov completion semantics replace a flat Complete/Failed poll: committed_ok → Complete with CRD outputs and Ready reason Confirmed; committed_failed → Failed TxFailed with outputs; pending resets task status to Pending and re-submits (same task ID) until spec.timeoutSeconds, then Failed InclusionUndetermined. Execution timeout logic is factored into execTimedOut.

The SDK exposes gov fields on TaskOutputs and translateTaskOutputs; package docs drop the “chain-as-medium only” stance for completed gov tasks. The integration upgrade test reads proposalID from task output and removes the resolveProposalID REST scan.

New controller_gov_test.go covers confirmed, tx failed, pending re-submit/converge, pending timeout, wire-shape drift guard, and generic failures without a result payload.

Reviewed by Cursor Bugbot for commit faa59a0. Bugbot is set up for automated code reviews on this repo. Configure here.

@bdchatham bdchatham merged commit 7b3a5b9 into main Jul 6, 2026
5 checks passed
@bdchatham bdchatham deleted the feat/nodetask-gov-outputs branch July 6, 2026 20:46
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.

1 participant