fix(base): gate +form-submit behind high-risk-write confirmation#1546
fix(base): gate +form-submit behind high-risk-write confirmation#1546hehanlin1996 wants to merge 1 commit into
Conversation
Promote `base +form-submit` from `write` to `high-risk-write` so form submission requires explicit confirmation. Form submits are irreversible and AI agents had no way to let users review content before writing. Now the flow is: `--dry-run` to preview the exact fields, show them to the user, then re-run with `--yes`. Without `--yes` the command returns a structured `confirmation_required` error (exit 10) and writes nothing, reusing the existing fail-closed gate (same as +table-delete / +field-update). Also documents the preview->confirm flow in the lark-base skill reference. Closes larksuite#1545 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
BaseFormSubmit high-risk-write promotion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Promote
base +form-submitfromwritetohigh-risk-writeso the irreversible form submission requires explicit confirmation, giving AI agents a way to let users review content before it is written.Changes
shortcuts/base/base_form_submit.go: setRisk: "high-risk-write"; add a preview→confirm tip plus the sharedbaseHighRiskYesTipagent guidance.shortcuts/base/base_shortcuts_test.go: addTestBaseFormSubmitRisk; update the metadata assertion; pass--yesin the execute-path tests now gated by confirmation.skills/lark-base/references/lark-base-form-submit.md: document the--dry-run→ confirm →--yesflow and the--yesflag.Test Plan
go test ./shortcuts/base/)lark-cli base +form-submitflow works as expected--yes: returnsconfirmation_required(exit 10), no network call, nothing written.--dry-run: previews the exact submit body for review.Related Issues
Summary by CodeRabbit
New Features
--yesconfirmation flag to prevent accidental data changes.--dry-runbefore final submission.Documentation
Tests