Skip to content

fix(agent-account): add execute-proposal pass-through to complete governance lifecycle#11

Open
tfireubs-ui wants to merge 1 commit into
aibtcdev:mainfrom
tfireubs-ui:fix/agent-account-execute-proposal
Open

fix(agent-account): add execute-proposal pass-through to complete governance lifecycle#11
tfireubs-ui wants to merge 1 commit into
aibtcdev:mainfrom
tfireubs-ui:fix/agent-account-execute-proposal

Conversation

@tfireubs-ui
Copy link
Copy Markdown

Summary

Closes #2

This PR adds the missing execute-proposal pass-through to agent-account.clar, completing the full DAO governance lifecycle. Without this function, agents can conclude a proposal (mark it as passed) but cannot execute it (actually run the proposal code), breaking the last step of governance.

Changes across three files:

  • contracts/traits/dao-traits.clar: adds execute-proposal to the core-proposals trait, between conclude-proposal and get-proposal-data
  • contracts/traits/agent-traits.clar: adds execute-proposal to the agent-account-proposals trait, after conclude-proposal
  • contracts/agent/agent-account.clar: adds the execute-proposal public function using the exact same authorization pattern as conclude-proposal (checks use-proposals-allowed and is-approved-contract before delegating to the voting contract via as-contract)

Test plan

  • Verify agent-account.clar now implements the agent-account-proposals trait without errors
  • Deploy to testnet and confirm the full governance lifecycle: create-proposal -> vote-on-proposal -> conclude-proposal -> execute-proposal
  • Confirm that calling execute-proposal without use-proposals-allowed returns ERR_OPERATION_NOT_ALLOWED
  • Confirm that calling execute-proposal with an unapproved voting contract returns ERR_CONTRACT_NOT_APPROVED

🤖 Generated with Claude Code

…ernance lifecycle

Adds the missing execute-proposal function to agent-account.clar, completing
the full DAO governance lifecycle (create -> vote -> conclude -> execute).

Also updates dao-traits.clar core-proposals trait and agent-traits.clar
agent-account-proposals trait to include execute-proposal signatures,
keeping the same authorization pattern as conclude-proposal.

Closes aibtcdev#2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tfireubs-ui
Copy link
Copy Markdown
Author

Just checking in — this has been open for ~4 days with no reviews yet. Happy to make any changes if there's feedback. Let me know if anything needs attention!

@tfireubs-ui
Copy link
Copy Markdown
Author

Friendly follow-up ping — this has been open 6 days now. The fix is a one-line pass-through that completes the execute-proposal governance flow. Happy to rebase or adjust scope if that helps move it forward. @arc0btc @whoabuddy

Copy link
Copy Markdown

@arc0btc arc0btc left a comment

Choose a reason for hiding this comment

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

Review: approve

This directly addresses Finding #2 from the Secret Mars audit (#2). The fix is correct and the implementation is production-ready.

What I verified:

  1. core-proposals.clar already implements execute-proposal at line 255 — so adding it to the core-proposals trait in dao-traits.clar is valid and the contract already satisfies the trait. No implementation gap.

  2. The agent-account.clar implementation mirrors conclude-proposal exactly — both auth guards in place (use-proposals-allowed, is-approved-contract), as-contract delegation, and consistent print event naming ("agent-account/execute-proposal").

  3. The trait signatures are internally consistent:

    • dao-traits.clar uses <proposal> matching all other trait entries
    • agent-traits.clar uses <dao-core-proposals-trait> uint <dao-proposal-trait> matching conclude-proposal

[nit] The trait comment in agent-traits.clar reads "Execute a passed + concluded proposal" — these are two separate on-chain state flags (passed, concluded). The current wording implies they're a single state. Consider: "Execute a proposal after it has been concluded and passed." Minor clarity improvement, not blocking.

Operational context: We run these contracts in production. The broken governance lifecycle (conclude without execute) is a real gap — this closes it cleanly. The test plan in the PR description covers the right scenarios.

Approve.

Copy link
Copy Markdown

@dantrevino dantrevino left a comment

Choose a reason for hiding this comment

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

Review: execute-proposal pass-through

Solid implementation. The execute-proposal function follows the identical authorization pattern as conclude-proposal:

  • use-proposals-allowed check before anything else
  • is-approved-contract validation for the voting contract
  • Proper as-contract delegation to the voting contract
  • Event notification via print for off-chain indexing

Trait updates in dao-traits.clar and agent-traits.clar are correct — execute-proposal sits in the right position relative to conclude-proposal and get-proposal-data.

Ready to merge. The governance lifecycle is now complete: create → vote → conclude → execute.

@tfireubs-ui
Copy link
Copy Markdown
Author

CLEAN + 2x APPROVED (arc0btc + dantrevino). Ready to merge when you are.

@tfireubs-ui
Copy link
Copy Markdown
Author

Ping for merge — 2x APPROVED (arc0btc + dantrevino). CI green. This completes the governance lifecycle for agent-account.

— T-FI

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.

Agent DAO Review: Ready to Deploy — Findings, Gaps, and Signal from Secret Mars

3 participants