Skip to content

feat(plugin-sdk): publish identifier authentication contract - #123793

Merged
steipete merged 3 commits into
mainfrom
omarshahine/rfc-0027-sdk-surface
Aug 27, 2026
Merged

steipete merged 3 commits into
mainfrom
omarshahine/rfc-0027-sdk-surface

Conversation

@omarshahine

@omarshahine omarshahine commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Companion to kernel PR #123782 (RFC openclaw/rfcs#51, tracking #124218). Refreshed 2026-08-27 by maintainer review: restacked onto the landed kernel squash (main commit d561469), and slimmed — the exact-field compatibility repairs (Discord tag, Twitch roles) moved into the kernel PR where they belong, so this PR is now purely the public contract plus the bundled-channel migrations. #123782 is landed on main; this PR completes the stack in the same release.

What Problem This Solves

The kernel grades identifier authentication, but external channel plugins cannot name the generic strength type through the supported SDK boundary, and the six bundled channels still declare the deprecated dangerous: true instead of explicit strengths with documented transport facts (the RFC's PR-4 go/no-go gate).

Why This Change Was Made

  • Exports only IdentifierAuthentication through openclaw/plugin-sdk/channel-ingress-runtime (+1 to the export budget, justified in-line; packaged consumer proves the positive import and, via @ts-expect-error, that host admission-evidence minting stays private).
  • Migrates the six bundled channels to explicit strengths, each with its authoritative transport fact documented in docs/plugins/sdk-channel-ingress.md: Discord Gateway user ID verified / PluralKit member ID asserted (per-message map) / names+tags mutable; Google Chat sender.name verified / email mutable; Mattermost post user ID verified / username mutable; IRC prefix+user@host asserted / nicks mutable; Teams sender/conversation IDs asserted / name mutable; Slack IDs asserted (relay mode caps the shared claim) / names mutable.
  • PluralKit provenance rides the kernel's per-message subject map — the first real consumer of it — and was audited against the kernel's missing-claim floor: unclaimed mutable aliases stay mutable via min(), so no outcome changes.

User Impact

Existing default admissions and rejections are unchanged: every formerly non-dangerous bundled identifier is now verified or asserted, and every former dangerous: true alias is explicitly mutable. External plugin authors can type transport-authentication claims through the real package subpath.

Evidence

  • Head 5f6f55c9cdc atop the landed kernel (d5614697454 on main); original commits preserve @omarshahine's authorship (the fourth original commit was dropped as already-upstream after relocation).
  • Focused: kernel + SDK-runtime + admission suites 64/64.
  • Full sibling sweep on this head: 8,663 tests across discord/slack/msteams/googlechat/mattermost/irc/twitch — all passing, including the three PluralKit provenance tests.
  • pnpm plugin-sdk:surface:check: 147 entrypoints, 4,346 public exports, 0 forbidden subpaths.
  • check:changed full plan and real-behavior proof (mock-gateway channel-sender-allowlist scenario) recorded on the stack head — see the run details in the PR discussion.
  • Production LOC +42/−9 (net +33: the export, six declarations with evidence comments, PluralKit provenance threading) | tests +75 | packaged-consumer fixture +17 | docs +19.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: slack Channel integration: slack scripts Repository scripts channel: irc size: S maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 6:50 AM ET / 10:50 UTC.

ClawSweeper review

What this changes

Publishes the identifier-authentication type through the channel-plugin SDK, documents transport-backed strengths, and replaces legacy identifier declarations in bundled channels.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: the landed ingress-kernel prerequisite does not include this distinct public SDK export and bundled-channel migration. No blocking correctness defect was found; it should remain open for normal maintainer merge handling.

Priority: P2
Reviewed head: 5f6f55c9cdc7ce4ab49547752e31ed323c3cc87a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused public-contract migration with coherent ownership boundaries and targeted coverage, with no blocking code finding in this review.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR is outside the external-contributor proof gate; the supplied discussion nevertheless records mock-gateway validation for the affected ingress path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR is outside the external-contributor proof gate; the supplied discussion nevertheless records mock-gateway validation for the affected ingress path.
Evidence reviewed 6 items Narrow public SDK contract: The branch exports only the IdentifierAuthentication type from the existing channel-ingress runtime subpath.
Authorization owner enforces exact-pair strengths: The shared ingress owner combines entry and subject strengths and rejects entries below the configured minimum before command authorization uses the result.
PluralKit provenance reaches both access paths: Discord lowers a PluralKit member ID to asserted and forwards that fact through both direct-message and group-command resolution; focused tests cover strict and default thresholds.
Findings None None.
Security None None.

Live Verification

Command: pnpm plugin-sdk:surface:check

Result: PASS (completed)

$ node --max-old-space-size=8192 --import tsx scripts/plugin-sdk-surface-report.mts --check
all SDK entrypoints:
  entrypoints: 339
  exports: 7333
  callable exports: 4404
  deprecated exports: 1256
  deprecated callable exports: 771
  unique entrypoint-qualified exports: 7333
public package SDK entrypoints:
  entrypoints: 147
  exports: 4346
  callable exports: 2582
  deprecated exports: 1129
  deprecated callable exports: 679
  unique entrypoint-qualified exports: 4346
local-only SDK entrypoints:
  entrypoints: 192
  exports: 2987
  callable exports: 1822
  deprecated exports: 127
  deprecated callable exports: 92
  unique entrypoint-qualified exports: 2987
deprecated public subpaths: 10
deprecated barrel subpaths: 2
public wildcard reexports: 50
package-exported forbidden subpaths: 0

Assertions:

  • PASS expect_output: public package SDK entrypoints:
  • PASS expect_output: package-exported forbidden subpaths: 0

How this fits together

Channel plugins map inbound transport events to sender identities, then the shared ingress policy evaluates those identities for allowlists and command access. This PR lets plugin authors express that identity-strength contract and aligns bundled channels with it.

flowchart LR
A[Inbound channel event] --> B[Plugin identity declaration]
B --> C[Authentication strength]
C --> D[Ingress allowlist policy]
D --> E[Command and dispatch outcome]
Loading

Before merge

  • Resolve merge risk (P1) - This adds a public Plugin SDK type, so its documented deprecated-field mapping must remain source-compatible through the stated SDK-major migration window.
  • Resolve merge risk (P1) - The transport-strength declarations affect opt-in strict authorization; an incorrectly elevated transport fact could authorize an identifier too strongly, although the branch documents the facts and applies the kernel’s exact-pair gate.
  • Complete next step (P2) - No mechanical repair is indicated; this protected maintainer PR needs normal exact-head merge validation rather than a repair job.
Agent review details

Security

None.

PR surface

Source +33, Tests +75, Docs +19, Other +18. Total +145 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 42 9 +33
Tests 3 75 0 +75
Docs 1 19 0 +19
Config 0 0 0 0
Generated 0 0 0 0
Other 2 19 1 +18
Total 15 155 10 +145

Review metrics

Metric Value Why it matters
Production versus test delta production +42/-9 (net +33); tests +75/-0; test support +17/-0; docs +19/-0; SDK budget tooling +2/-1 The justified production growth is the public type and explicit channel declarations; the accompanying tests and package-consumer fixture cover the boundary.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #124218
Summary: This PR is the SDK-and-bundled-channel implementation candidate for the accepted ingress-authentication tracking issue; the landed kernel PR is its adjacent prerequisite.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Land the accepted companion contract (recommended)
    Complete exact-head validation, then land the documented SDK export and bundled declarations with the existing legacy mappings intact.
  2. Pause for transport-contract revalidation
    If maintainers no longer accept any documented transport assertion, pause and revalidate that channel’s declared strength before introducing the public contract.

Technical review

Best possible solution:

Land this focused companion after exact-head validation, retaining the documented deprecated mappings while external plugins migrate to the single public type.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is an additive SDK and bundled-plugin contract change rather than a report of broken existing behavior.

Is this the best way to solve the issue?

Yes. Re-exporting only the generic type from the existing ingress SDK subpath is the narrowest public seam; exposing host admission-evidence APIs or adding a parallel contract would widen the boundary unnecessarily.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7245ad03b794.

Labels

Label justifications:

  • P2: This is a bounded, accepted Plugin SDK and channel-authorization improvement without an active default-path outage.
  • merge-risk: 🚨 compatibility: Exporting a new public SDK type and migrating deprecated declarations establishes a downstream plugin compatibility contract.
  • merge-risk: 🚨 security-boundary: The declared strengths feed channel authorization, so incorrect transport classification could affect opt-in strict access decisions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR is outside the external-contributor proof gate; the supplied discussion nevertheless records mock-gateway validation for the affected ingress path.

Evidence

What I checked:

Likely related people:

  • omarshahine: Git blame attributes the reviewed SDK export and Discord identity-strength implementation to Omar; he also authored the landed kernel prerequisite. (role: feature owner and current source author; confidence: high; commits: d56146974542, 5f6f55c9cdc7; files: src/plugin-sdk/channel-ingress-runtime.ts, extensions/discord/src/monitor/dm-command-auth.ts, src/channels/message-access/identifier-authentication.ts)
  • steipete: Peter supplied the latest documented maintainer refresh that restacked this companion after the prerequisite landed. (role: recent area contributor reviewer; confidence: medium; commits: 5f6f55c9cdc7; files: src/plugin-sdk/channel-ingress-runtime.ts, docs/plugins/sdk-channel-ingress.md)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-14T18:59:02.742Z sha f00dad7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T16:58:13.002Z sha 537760a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T18:32:30.899Z sha 537760a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T22:49:27.752Z sha 3ff4083 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T22:55:50.739Z sha 3ff4083 :: found issues before merge. :: [P1] Refresh the Plugin SDK surface budget after rebasing
  • reviewed 2026-08-16T00:57:10.091Z sha 3ff4083 :: found issues before merge. :: [P1] Refresh the SDK surface budget after rebasing
  • reviewed 2026-08-27T07:50:08.782Z sha b75ea163f927362daf7222e184b51f669a7e22e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T10:18:20.172Z sha ab16839 :: needs maintainer review before merge. :: none

@omarshahine

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@omarshahine

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@omarshahine

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@steipete
steipete force-pushed the omarshahine/rfc-0027-kernel branch from 6b3c6db to 132fc7c Compare August 27, 2026 07:42
@openclaw-barnacle openclaw-barnacle Bot removed the channel: twitch Channel integration: twitch label Aug 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer refresh 2026-08-27 (head b75ea163f927, rebased onto kernel head 132fc7c82f19): all four before-merge items are resolved on this head.

  • Stale surface budget — regenerated. The budget now sits on current main's baseline: 4345 → 4346 (+1 for IdentifierAuthentication), verified against actual exports; pnpm plugin-sdk:surface:check passes at 147 entrypoints / 4,346 public exports / 0 forbidden subpaths.
  • Kernel-first rebase — done. This branch is exactly three commits atop the refreshed kernel head; the duplicated channel-fix commit was dropped as already-upstream after those repairs moved into the kernel PR where they belong.
  • Packaged-consumer and surface proof — rerun at the coordinated head. Positive IdentifierAuthentication/subject-map imports and negative host-evidence @ts-expect-error imports verified; full check:changed plan and pnpm build (including plugin-SDK export checks) green; sibling sweep 8,663 tests passing; mock-gateway channel-sender-allowlist proof passed on this head.
  • Coordinated sequence — held. feat(channels): grade sender identifier authentication in the ingress kernel #123782 lands first on green exact-head CI, this PR immediately after, same release.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 27, 2026
@steipete
steipete force-pushed the omarshahine/rfc-0027-sdk-surface branch from b75ea16 to ab16839 Compare August 27, 2026 10:09
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 27, 2026
Base automatically changed from omarshahine/rfc-0027-kernel to main August 27, 2026 10:42
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch size: XL and removed size: S labels Aug 27, 2026
@steipete
steipete force-pushed the omarshahine/rfc-0027-sdk-surface branch from ab16839 to 5f6f55c Compare August 27, 2026 10:43
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch size: XL labels Aug 27, 2026
@steipete
steipete merged commit ea552df into main Aug 27, 2026
210 checks passed
@steipete
steipete deleted the omarshahine/rfc-0027-sdk-surface branch August 27, 2026 11:03
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…w#123793)

* feat(plugin-sdk): publish identifier authentication contract

* fix(discord): distinguish PluralKit identity provenance

* fix(discord): preserve PluralKit group provenance

---------

Co-authored-by: Omar Shahine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: irc channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: slack Channel integration: slack docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants