Skip to content

fix(lua-agent-builder): webhook keys in the knowledge and permission rules; session table matches the server (1.19.2) - #35

Merged
rares04 merged 1 commit into
mainfrom
rares/lua-1955-webhook-key-verbs
Nov 6, 2026
Merged

rares04 merged 1 commit into
mainfrom
rares/lua-1955-webhook-key-verbs

Conversation

@rares04

@rares04 rares04 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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.md gets a row for lua 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.md gets auth: 'key' | 'public', when to use a key versus a vendor's own signature, and WebhookError.
  • Permissions. The four key verbs are ask rules: they change who can call a live webhook at once. They are not deploy verbs, so confirm-deploy / tokenizer.mjs are not touched. This follows the template's own rule for lua integrations webhooks and lua devices writes.

  • Build-session table. Three rows the server added are copied in (packages/shared-types/src/build-sessions/commands.ts on main):

    • features.stage and models.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 rag stayed approval. The parity tests copy the server's cases and add the plain-argument forms lua 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 lint passes, including lint-knowledge-commands (its webhooks action list gains the four verbs) and the release-version check.
  • Tests, one file at a time: session-commands 193/193, permissions-mirror 94/94, hooks/session-mode 151/151, lib/session-mode 86/86, web-apps-permissions 26/26.
  • Before the classifier fix, the six new session_write cases failed (they came out approval).

Stefan edited confirm-deploy.mjs / tokenizer.mjs on 5 Nov (#34). This PR changes neither.

🤖 Generated with Claude Code

…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>
@rares04
rares04 requested a review from selcuk-lua November 6, 2026 10:05
@rares04

rares04 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the two plugin (macos-14, 18|20) jobs were cancelled within a second of being queued, with no runner assigned and no step run. A re-run did the same. The same jobs passed on main yesterday (#34), so this looks like macOS runner availability for the org today, not this change. ubuntu-22.04 and windows-2022 (Node 18 and 20) and mcp pass, and none of these checks is required on main.

@rares04
rares04 requested review from richard-lua and selcuk-lua and removed request for richard-lua and selcuk-lua November 6, 2026 10:48

@selcuk-lua selcuk-lua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 to approval. That is the intended fix (lua features disable rag now stays session_write), but it broadens accepted trailing tokens for any rule whose verb list overlaps MUTATING_TOKENS, and the semantics now hinge on exact parity with the server's classifyLuaCommand. 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

@rares04
rares04 merged commit 5348319 into main Nov 6, 2026
10 of 14 checks passed
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.

2 participants