Commit Graph

53 Commits

Author SHA1 Message Date
Peter Steinberger 61a3d3e7d9 perf(plugins): memoize failed facade module resolutions (#124664)
resolveFacadeModuleLocation only cached successful locations, so every
lookup for a plugin that is not installed re-walked the bundled-plugins
dir and registry on every request — request-time freshness polling of
process-stable install topology, which the architecture doctrine forbids.

Cache null results too. Install/reload/doctor flows already clear this
cache through registerPluginMetadataProcessMemoLifecycleClear, so a
newly installed plugin becomes visible exactly when the lifecycle owner
says so — the retry-on-appear test now pins that contract instead of
accidental per-call refresh.
2026-08-16 08:33:23 -07:00
Peter Steinberger ebb2770000 refactor: eliminate export name collisions (#122084)
* refactor: eliminate export name collisions

* chore(scripts): burn resolved collision baselines

* refactor: narrow legacy session load options

* chore: refresh SDK and session debt baselines

* refactor: adopt upstream secrets collision fix

* test(plugin-sdk): mock renamed session store core

* fix(scripts): track renamed session accessor core
2026-08-11 10:41:50 -07:00
Peter Steinberger a8caab5c3d refactor(plugin-sdk): remove unused private QA helpers (#119437) 2026-08-04 20:16:07 -07:00
Peter Steinberger 3fb201c5a7 fix(plugins): reuse gateway lifecycle metadata and isolate plugin state (#114476)
* fix(plugins): reuse gateway metadata and preserve reload isolation

* test(plugins): split lifecycle regressions and simplify gateway dispatch

* perf(plugins): reuse proven immutable snapshot graphs

* test(plugins): isolate snapshot lifecycle regression mocks

* perf(plugins): retain one gateway metadata cache

* test(plugins): preserve frozen proxy descriptor invariants

* test(plugins): isolate lifecycle metadata mock ownership

* test(plugins): bind shared worker mocks before module evaluation
2026-07-27 07:48:13 -04:00
Alex Knight 342d13a914 fix(plugins): resolve public artifacts from installed plugin roots (#98819)
* fix(plugins): resolve public artifacts from installed plugin roots

Externalized official plugins ship gateway-auth/doctor/secret/message-tool
public artifacts in their installed npm package, but the public-surface
loader only searched bundled locations. On packaged installs this emptied
the gateway auth bypass set for /api/channels/mattermost/command, so every
Mattermost slash callback was rejected 401 before the plugin ran.

Fall back to the plugin's installed package root (install-record index)
when bundled resolution misses; bundled/source locations keep precedence.

Fixes #98740

* fix(gateway): resolve channel auth-bypass artifacts via activation-gated facade

Route gateway-auth bypass artifact loading through the activation-gated
facade seam so externalized (installed) channel plugins keep their
unauthenticated callback paths, while denied/disabled plugins contribute
nothing and never execute artifact code. Reject hardlinked artifacts for
installed plugin roots in the facade loader per hardlink-policy.

Replaces the earlier install-record fallback in the shared bundled
artifact loader, which broadened every artifact surface past its trust
boundary (see PR review); other externalized-plugin surfaces are #98842.

Fixes #98740

* fix(gateway): load facade activation runtime via async lazy import

The sync createRequire/jiti candidate loader for
facade-activation-check.runtime.js only resolves from built dist; under
vitest source runs it cannot follow .js->.ts specifiers or workspace
package subpaths, so the gateway auth-bypass path threw 'Unable to load
facade activation check runtime' (CI shard failure). Add an async
activated-load API backed by dynamic import (vitest- and dist-native),
warm the shared runtime memo, and make the bypass consumer async - its
single caller already awaits behind the config-snapshot promise cache.

* revert(plugins): drop install-record fallback from public-surface loader

Superseded by the activation-gated facade seam in gateway-auth-bypass;
review found the loader-level fallback broadened every artifact surface
past its trust boundary (see PR #98819 discussion).

* fix(plugin-sdk): drop unused oxlint disable on async facade loader

* test(plugin-sdk): cover facade hardlink policy for installed vs core roots

* test(plugin-sdk): cover facade hardlink policy for installed vs core roots

---------

Co-authored-by: Alex Knight <15041791+amknight@users.noreply.github.com>
2026-07-04 10:57:42 +10:00
Dallin Romney fb750e6eed Fix main CI guard drift (#90532) 2026-06-04 20:31:41 -07:00
Peter Steinberger 99bb94589b docs: document sdk facade loader contracts 2026-06-04 22:29:06 -04:00
Peter Steinberger a16c6ca94b docs: document plugin sdk public helpers 2026-06-04 19:14:41 -04:00
Peter Steinberger 4f4d108639 chore(lint): remove underscore-dangle allow list (#83542)
* chore(lint): reduce underscore-dangle exceptions

* chore(lint): reduce more underscore exceptions

* chore(lint): remove underscore-dangle allow list

* fix(lint): repair underscore cleanup regressions

* test(lint): track version define suppression
2026-05-18 14:56:06 +01:00
Peter Steinberger 691d62630f test: keep slow tests under duration cap 2026-05-18 00:26:44 +01:00
Shakker f1406b1b56 fix: load linked plugin facades when bundled fallback is off 2026-05-09 19:19:14 +01:00
Shakker d1e40ca3e8 test: skip disabled bundled facade resolution 2026-05-09 18:35:20 +01:00
Peter Steinberger 23fd8a90f9 refactor: simplify plugin module loading 2026-05-02 01:41:09 +01:00
Peter Steinberger 83c1d25d6b refactor: remove unused plugin test reset hooks 2026-05-01 22:24:13 +01:00
Peter Steinberger e27fe55aa8 refactor: simplify plugin cache boundaries 2026-04-29 04:33:15 +01:00
Peter Steinberger 88068b9649 fix: prepare bundled facade runtime deps 2026-04-28 03:25:01 +01:00
Peter Steinberger da3cf1c1a8 fix: preserve bundled facade fallback semantics 2026-04-28 00:50:34 +01:00
Peter Steinberger eddfffebe8 refactor: share facade resolution helpers 2026-04-20 15:29:16 +01:00
Peter Steinberger f27c164e7f refactor: share lazy facade value binder 2026-04-20 14:57:50 +01:00
Peter Steinberger df525b90f2 chore(lint): enable unnecessary type parameter rule 2026-04-18 18:31:13 +01:00
Gustavo Madeira Santana d5933af80b QA: fix private runtime source loading (#67428)
Merged via squash.

Prepared head SHA: b8bf2b6be6
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-15 21:59:16 -04:00
Vincent Koc 4d6eeebda2 fix(plugin-sdk): share facade runtime jiti cache helper 2026-04-14 17:46:30 +01:00
Vincent Koc 9843a4f1fc fix(plugins): share source public surface resolver 2026-04-14 17:33:15 +01:00
Vincent Koc f12d6bf3bb fix(plugins): share public surface source extensions 2026-04-14 17:29:44 +01:00
Vincent Koc 2f29a58b4e fix(plugin-sdk): share facade activation check candidate loader 2026-04-14 17:24:33 +01:00
Altay 554bc0a9fd fix(plugins): keep test helpers out of contract barrels (#63311)
Merged via squash.

Prepared head SHA: 769e90c6af
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-08 22:59:05 +01:00
Peter Steinberger 820201a343 fix(ci): restore plugin sdk doctor boundaries 2026-04-07 06:49:15 +01:00
Vincent Koc 8e8c7344bd perf(plugin-sdk): lazy-load facade activation checks 2026-04-07 06:41:24 +01:00
Peter Steinberger 34c1e53792 fix(ci): align facade runtime loading 2026-04-07 06:37:14 +01:00
Vincent Koc 02261e931c perf(plugin-sdk): avoid bundled metadata scans in facade runtime 2026-04-07 06:35:51 +01:00
Vincent Koc 1aca95ae15 perf(plugin-sdk): split light facade loader 2026-04-07 06:22:35 +01:00
Peter Steinberger 98b76d83ea perf(test): trim bundled registry and facade tests 2026-04-07 01:03:03 +01:00
Peter Steinberger 8c38c662c1 perf(test): trim bundled facade hot paths 2026-04-07 00:59:49 +01:00
Peter Steinberger 80c8567f9d fix: resolve merge conflicts and preserve runtime test fixes 2026-04-06 22:46:33 +01:00
Peter Steinberger 5d0e8336ab perf(test): trim bundled channel bootstrap 2026-04-06 17:05:59 +01:00
Peter Steinberger 8a33a8d607 perf(test): trim runtime lookups and add changed bench 2026-04-06 16:49:28 +01:00
Ayaan Zaidi 332e7d9d7b style: trim facade fallback comment noise 2026-04-06 08:07:38 +05:30
Chunyue Wang 1e9289f535 fix: resolve global bundled plugin facade fallback (#61297) (thanks @openperf)
* fix(gateway): resolve globally-installed bundled plugins in facade-runtime

* fix: resolve global bundled plugin facade fallback (#61297) (thanks @openperf)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-06 08:03:18 +05:30
Peter Steinberger 36080283e4 refactor: remove remaining contract path leaks 2026-04-05 20:59:56 +01:00
Vincent Koc fd0cc90427 fix(plugin-sdk): resolve facade post-load re-entry (#61286) 2026-04-05 11:25:36 +01:00
Vincent Koc 69b74476d7 fix(contracts): lock runtime seam regressions 2026-04-05 08:52:20 +01:00
Altay ccc7549afe fix(ci): break facade runtime init cycle (#61053)
* fix(ci): break facade runtime init cycle

* style(config): normalize provider schema imports
2026-04-05 01:31:59 +03:00
Peter Steinberger daac149744 fix(ci): honor runtime config snapshots for facades 2026-04-04 09:08:25 +01:00
Peter Steinberger edfaa01d1d refactor(plugin-sdk): split runtime helper seams 2026-04-04 08:53:19 +01:00
Peter Steinberger cd38eba316 refactor: unify plugin activation source plumbing 2026-04-03 23:39:36 +09:00
Peter Steinberger ef86edacf7 fix: harden plugin auto-enable empty config handling 2026-04-02 15:19:53 +01:00
Vincent Koc 4f692190b4 fix(config): tolerate missing facade boundary config 2026-04-02 23:04:53 +09:00
Vincent Koc bb3f17fc02 refactor(plugins): drop generic status report alias (#59700) 2026-04-02 22:59:25 +09:00
Vincent Koc def5b954a8 feat(plugins): surface imported runtime state in status tooling (#59659)
* feat(plugins): surface imported runtime state

* fix(plugins): keep status imports snapshot-only

* fix(plugins): keep status snapshots manifest-only

* fix(plugins): restore doctor load checks

* refactor(plugins): split snapshot and diagnostics reports

* fix(plugins): track imported erroring modules

* fix(plugins): keep hot metadata where required

* fix(plugins): keep hot doctor and write targeting

* fix(plugins): track throwing module imports
2026-04-02 22:50:17 +09:00
Vincent Koc 9823833383 fix(plugins): preserve activation provenance (#59641)
* fix(plugins): preserve activation provenance

* fix(gateway): preserve activation reason metadata

* fix(plugins): harden activation state policy
2026-04-02 20:57:14 +09:00