Skip to content

Clarify Plugin Lifecycle terminology to distinguish from database Triggers - #101

Closed
hotlong with Copilot wants to merge 3 commits into
mainfrom
copilot/review-zod-usage
Closed

Clarify Plugin Lifecycle terminology to distinguish from database Triggers#101
hotlong with Copilot wants to merge 3 commits into
mainfrom
copilot/review-zod-usage

Conversation

CopilotAI commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Reviewed all Zod schemas to assess whether an old "hook" specification needed preservation. No separate hook specification exists in the codebase. Found terminology overlap: Plugin Lifecycle used "hook" in descriptions, creating confusion with database Triggers which serve a different purpose.

Changes

  • Renamed type: PluginLifecycleHooksPluginLifecycleCallbacks
  • Updated descriptions: "Hook called on..." → "Lifecycle callback on..."
  • Added analysis doc: HOOK_TRIGGER_CLARIFICATION.md documenting the semantic differences

Semantic Distinction

// Database-level business logic hooks (before/after CRUD operations)exportconstTriggerSchema=z.object({timing: z.enum(['before','after']),action: z.enum(['insert','update','delete']),execute: z.function().args(TriggerContextSchema)...});// Plugin system lifecycle callbacks (install/enable/disable/uninstall)exportconstPluginLifecycleSchema=z.object({onInstall: z.function().describe('Lifecycle callback on plugin installation'),onEnable: z.function().describe('Lifecycle callback when plugin is enabled'),
...
});

Recommendation

Do not implement the planned hooks.zod.ts (Hook Registry Protocol) mentioned in the roadmap. Current Trigger specification already covers database-level extension points (beforeObjectCreate, afterRecordSave, etc.). Adding a separate hook registry would be redundant.

Original prompt

审核所有的zod,我们之前有定义一个类似现在trigger的hook规范,现在还需要保留吗


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercelBot commented Jan 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
specErrorErrorJan 24, 2026 11:55am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
CopilotAI changed the title [WIP] Review existing Zod schema and hook specificationsClarify Plugin Lifecycle terminology to distinguish from database TriggersJan 24, 2026
CopilotAI requested a review from hotlongJanuary 24, 2026 11:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hotlong