Repository navigation
fix(lua-agent-builder): webhook keys in the knowledge and permission rules; session table matches the server (1.19.2) - #35
Conversation
…rules; session table matches the server again (1.19.2) The four lua webhooks key verbs (lua-cli 3.65.0) are ask rules and documented in cli-reference.md and primitives.md, with auth: 'key', X-Lua-Key / ?key=, the keys file and WebhookError. The session-mode mirror gains the server's features.stage, models.stage and webhooks.keys rows, and a rule's own verbs no longer count as a mutating word, so lua models set / lua features disable are session_write in a session, as lua-api stages them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
CI note: the two |
selcuk-lua
left a comment
There was a problem hiding this comment.
Code review — LOW risk
This change mirrors three server-side build-session rules into the vendored classifier (features/models staging → session_write, the four webhook key verbs → unavailable), registers those four verbs as ask permission rules, documents webhook keys in the knowledge base, and bumps the plugin version across every manifest. The only behavioral logic is the classifier tweak, which is narrowly scoped and backed by the updated parity fixtures (the new session_write and webhooks.keys cases, and the removed models set/features enable x approval expectations are consistent with the new rules). Permission rules are added per-verb (not a blanket glob), matching the stated contract. No security or correctness issues found; two advisory notes below.
Minor
lib/session-commands.mjs:344— The new!rule.verbs?.includes(t)exclusion stops a rule's own verbs from escalating a read/session_write match toapproval. That is the intended fix (lua features disable ragnow stayssession_write), but it broadens accepted trailing tokens for any rule whose verb list overlapsMUTATING_TOKENS, and the semantics now hinge on exact parity with the server'sclassifyLuaCommand. Verify the server excludes verbs the same way (all occurrences vs. the single matched verb).mcp/lua-platform/dist/server.js— The committed bundle was regenerated; the diff is unreviewable, so "only version strings changed" can't be confirmed from the diff alone. Lean on a reproducible-build CI check (or drop the committed artifact) to guarantee no unintended code change slipped in.
PR Risk Reviewer — automated senior review of 17301b0 · risk: low · confidence: 0.82
Plugin 1.19.2. Covers webhook keys (LUA-1955, plugin part) and brings the build-session command table back in line with the server.
What changes
Knowledge.
cli-reference.mdgets a row forlua webhooks protect|rotate-key|revoke-key|unprotect. It covers where a key is saved, that it is never printed without a terminal, what callers send, and the 401.primitives.mdgetsauth: 'key' | 'public', when to use a key versus a vendor's own signature, andWebhookError.Permissions. The four key verbs are
askrules: they change who can call a live webhook at once. They are not deploy verbs, soconfirm-deploy/tokenizer.mjsare not touched. This follows the template's own rule forlua integrations webhooksandlua deviceswrites.Build-session table. Three rows the server added are copied in (
packages/shared-types/src/build-sessions/commands.tson main):features.stageandmodels.stage(session_write);webhooks.keys(unavailable).A rule's own verbs no longer count as a mutating word, as on the server; without that,
lua features disable ragstayedapproval. The parity tests copy the server's cases and add the plain-argument formslua models set <code>/lua features disable <name>, which lua-cli 3.67.0 accepts. The token lists (mutating, destructive, high-risk, read verbs) were compared with the server's and are equal.Version. 1.19.1 → 1.19.2 in every manifest. The MCP bundle was rebuilt; the only diff is the version strings.
Checks
npm run lintpasses, includinglint-knowledge-commands(itswebhooksaction list gains the four verbs) and the release-version check.session_writecases failed (they came outapproval).Stefan edited
confirm-deploy.mjs/tokenizer.mjson 5 Nov (#34). This PR changes neither.🤖 Generated with Claude Code