Skip to content

[AAASM-2308] ✨ (scenarios): Add approval-gates/ scaffold and Python implementation#33

Open
Chisanan232 wants to merge 12 commits into
masterfrom
v0.0.1/AAASM-2308/feat/approval_gates_scaffold
Open

[AAASM-2308] ✨ (scenarios): Add approval-gates/ scaffold and Python implementation#33
Chisanan232 wants to merge 12 commits into
masterfrom
v0.0.1/AAASM-2308/feat/approval_gates_scaffold

Conversation

@Chisanan232
Copy link
Copy Markdown
Contributor

What changed

Adds the scenarios/approval-gates/ directory with shared scenario files and a fully-offline Python sub-project demonstrating the pending → approved → executed approval flow.

Shared scenario files:

  • scenarios/approval-gates/policy.yaml — 2-rule policy: get_balance (allow), transfer_funds (approval_required), default_action: deny
  • scenarios/approval-gates/expected-output.txt — terminal output reference showing the pending → approved → executed cycle
  • scenarios/approval-gates/README.md — concept explanation, approval flow walkthrough, run instructions, real-app guidance

Python sub-project (scenarios/approval-gates/python/):

  • ApprovalPolicyEngine handles allow, deny, and approval_required actions from policy.yaml
  • MockApprovalClient simulates a real approval service: auto-approves or rejects, prints pending/approved messages
  • governed() wrapper is approval-aware — tool body only runs after approval is granted
  • 8 smoke tests: allowed tool, approved transfer, rejected transfer, body-never-executes, default deny, mock client behavior

Related ticket

Closes AAASM-2308

How to verify

cd scenarios/approval-gates/python
uv sync --extra dev
uv run python src/main.py    # shows pending → approved → executed
uv run pytest tests/ -v      # 8 tests pass

Checklist

  • PR title follows [AAASM-XXXX] <GitEmoji> (<scope>): <summary>
  • No secrets, API keys, or .env files committed
  • Example sub-projects include their own README.md via the scenario-level README
  • SDK/runtime version dependencies are documented or pinned

@sonarqubecloud
Copy link
Copy Markdown

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