@@ -485,9 +485,16 @@ since consolidating more logic into the runtime makes the assumption more load-b
485485 dropping.
4864863 . ** ` messenger.sendRequest ` timeout** — the runtime-side TODO becomes more prominent once all
487487 accessor traffic flows through it.
488- 4 . ** Drop the legacy ` _accessors ` threading** through ` AppApi.runExecutor ` ,
489- ` AppSlashCommand.runTheCode ` , ` AppVideoConfProvider.runTheCode ` ,
490- ` AppOutboundCommunicationProvider.runTheCode ` signatures.
488+ 4 . ✅ ** Drop the legacy ` _accessors ` threading + delete the dead host accessor layer.** — ** landed as
489+ Phase 5** (§8). Un-threaded the ignored ` accessors: AppAccessorManager ` parameter from
490+ ` AppApi.runExecutor ` , ` AppSlashCommand ` /` AppVideoConfProvider ` /` AppOutboundCommunicationProvider `
491+ ` run* ` /` runTheCode ` and their managers; deleted ` AppAccessorManager ` (+ its ` getAccessorManager() `
492+ on ` AppManager ` and the ` purifyApp ` call), the entire ` src/server/accessors/ ` directory (unreachable
493+ from the subprocess after Phase 4), the host ` src/server/misc/UIHelper.ts ` copy (its only importers
494+ were those deleted accessors), and the ` managers/index.ts ` export. Behavior-neutral cleanup; kept
495+ separate from the Phase 4 message-path teardown because it touches the sandbox-execution core.
496+ (The parity harness is ** not** removed — it became a permanent test utility the base-runtime
497+ accessor tests depend on.)
4914985 . ** Consolidated host↔subprocess protocol/SDK** — a single typed manifest of every host-bound method
492499 and its accepted params (the §5.2 explicit method/exception list is the seed), replacing today's
493500 hand-rolled message strings and per-param normalization judgment with a declared contract. A
@@ -672,21 +679,79 @@ returning the bridge value, matching the interface.
672679** RPC-boundary note:** ` SettingRead.getValueById ` treats ` null ` and ` undefined ` alike as "does not
673680exist" (undefined serializes to null across the boundary), same adaptation as ` ServerSettingRead ` .
674681
675- ### Phase 4 — Teardown
676-
677- 1 . Replace ` AppListenerManager.executePostMessageSent ` 's ` getReader(...).getAppUser() ` with
678- ` bridges.getUserBridge().doGetAppUser(appId) ` .
679- 2 . Delete ` handleAccessorMessage ` , ` ALLOWED_ACCESSOR_METHODS ` , ` isValidOrigin ` ,
680- ` getAccessorForOrigin ` , and the ` accessor: ` branch in ` handleIncomingMessage ` .
681- 3 . Delete ` src/server/accessors/ ` entirely (including dead ` AppAccessors ` , ` Http ` ), delete
682- ` AppAccessorManager ` (and its ` purifyApp ` call in ` AppManager ` ), remove ` proxify ` from ` mod.ts ` ,
683- and drop the now-unused ` getAccessorManager() ` threading in managers (follow-up #4 can ride
684- along).
685- 4 . Delete the ` src/server/misc/UIHelper.ts ` copy (its last importers are gone with the host
686- accessors), leaving the base-runtime copy as the single source of truth; remove the transitional
687- parity harness (§6).
688- 5 . CHANGELOG entry; update any architecture docs referencing the accessor message category.
689-
690- ** End state:** ` BaseRuntimeSubprocessController ` handles exactly one app-originated RPC category —
691- ` bridges:* ` — with a single dispatcher, a single permission model, and a single accessor
692- implementation living in ` packages/apps/base-runtime ` .
682+ ### Phase 4 — Teardown — ✅ landed (message-path teardown; dead-class deletion moved to follow-up #4 )
683+
684+ 1 . ✅ Replaced ` AppListenerManager.executePostMessageSent ` 's ` getReader(appId).getUserReader().getAppUser() `
685+ with ` this.manager.getBridges().getUserBridge().doGetAppUser(appId) ` — the only load-bearing
686+ host-side accessor consumer outside the RPC path. ` AppListenerManager ` no longer references
687+ ` AppAccessorManager ` .
688+ 2 . ✅ Deleted ` handleAccessorMessage ` , ` ALLOWED_ACCESSOR_METHODS ` , ` isValidOrigin ` ,
689+ ` getAccessorForOrigin ` , the ` accessor: ` branch in ` handleIncomingMessage ` , and the controller's
690+ now-unused ` accessors ` /` api ` fields (and their ` manager.getAccessorManager() ` /` getApiManager() `
691+ reads). ` proxify ` and ` WithProxy ` were already removed from ` mod.ts ` in Phase 3. ** The
692+ ` accessor:* ` message category no longer exists — the controller dispatches only ` bridges:* ` ,
693+ ` ready ` , ` log ` , and the error notifications.** ` JSONRPC_METHOD_NOT_FOUND ` is kept (it is imported by
694+ ` ProxiedApp ` , ` AppListenerManager ` , ` AppVideoConfProvider ` ).
695+ 3 . ✅ Adapted ` tests/server/runtime/DenoRuntimeSubprocessController.test.ts ` : removed the four
696+ ` handleAccessorMessage ` cases (HTTP accessor, IRead, IEnvironmentReader-via-IRead, LivechatCreator
697+ visitor) that exercised the now-deleted ` accessor:* ` dispatch path. Their host-side resolution no
698+ longer exists (the subprocess resolves accessors locally via ` bridges:* ` ), and the equivalent
699+ behavior is covered by the surviving ` handleBridgeMessage ` "message bridge" case here plus the
700+ base-runtime accessor/RemoteBridges suites. The unused ` UserStatusConnection ` /` UserType ` import was
701+ dropped with them.
702+
703+ ** Scoping decision — physical deletion of the dead accessor classes is folded into follow-up #4 .**
704+ Deleting ` src/server/accessors/ ` + ` AppAccessorManager ` requires first un-threading the (ignored)
705+ ` accessors: AppAccessorManager ` parameter from the sandbox-execution core (` AppApi.runExecutor ` ,
706+ ` AppSlashCommand ` /` AppVideoConfProvider ` /` AppOutboundCommunicationProvider ` ` run* ` /` runTheCode ` , and
707+ their managers). That is exactly follow-up #4 ("drop the legacy ` _accessors ` threading"), which the
708+ plan already carved out as a separate, behavior-neutral change. Rather than refactor the execution
709+ core at the tail of this work for zero behavior benefit, the now-** unreachable** host accessor
710+ classes + ` AppAccessorManager ` are left in place (dead code — nothing on the subprocess path reaches
711+ them) and their removal is done in follow-up #4 together with the threading cleanup. The host
712+ ` src/server/misc/UIHelper.ts ` copy and the parity harness stay for the same reason (the harness has
713+ also become a genuine, permanent test utility that the Phase 1–3 tests depend on, so it is retained
714+ rather than removed).
715+
716+ ** End state (primary objectives met):** ` BaseRuntimeSubprocessController ` handles exactly one
717+ app-originated RPC category — ` bridges:* ` — with a single dispatcher and a single permission model,
718+ and accessor * behavior* lives in exactly one place, ` packages/apps/base-runtime ` . ` handleAccessorMessage `
719+ and the entire ` accessor:* ` category are gone. What remains is dead-code removal (Phase 5 / follow-up #4 ).
720+
721+ ### Phase 5 — Dead host accessor layer removal (follow-up #4 ) — ✅ landed
722+
723+ Physical removal of the now-unreachable host accessor code. Behavior-neutral: nothing on the
724+ subprocess path reached any of it after Phase 4.
725+
726+ 1 . ✅ ** Un-threaded the vestigial ` accessors ` parameter** from the sandbox-execution core. The
727+ ` run* ` /` runTheCode ` methods already ignored it (` _accessors ` ) — the app executes in the subprocess
728+ via ` getRuntimeController().sendRequest ` , so the host-side accessor manager was never consulted.
729+ Dropped the parameter from ` AppApi.runExecutor ` , ` AppSlashCommand.runExecutorOrPreviewer ` /
730+ ` runPreviewExecutor ` /` runTheCode ` , all ` AppVideoConfProvider.run* ` /` runTheCode ` , and
731+ ` AppOutboundCommunicationProvider.runGetProviderMetadata ` /` runSendOutboundMessage ` /` runTheCode ` , and
732+ updated the four managers' call sites. Removed the now-unused ` private readonly accessors ` field
733+ (and its ` this.manager.getAccessorManager() ` assignment) from ` AppApiManager ` ,
734+ ` AppSlashCommandManager ` , ` AppVideoConfProviderManager ` , and ` AppOutboundCommunicationProviderManager ` .
735+ 2 . ✅ ** Deleted ` AppAccessorManager ` ** (` src/server/managers/AppAccessorManager.ts ` ), removed its
736+ ` managers/index.ts ` export, and removed ` AppManager ` 's ` accessorManager ` field, its
737+ ` new AppAccessorManager(this) ` construction, the ` getAccessorManager() ` accessor, and the
738+ ` accessorManager.purifyApp(...) ` call in ` removeLocal ` (a no-op — the caches it cleared were never
739+ populated once no host code called ` getReader ` /` getModifier ` /etc.).
740+ 3 . ✅ ** Deleted the entire ` src/server/accessors/ ` directory** (64 files — the host copies of the
741+ readers, modifiers, builders, environment accessors, and the configuration/registration accessors)
742+ and the host ` src/server/misc/UIHelper.ts ` (only ever imported by those deleted accessors). The
743+ base-runtime holds the single source of truth for all of this.
744+ 4 . ✅ ** Adapted tests:** deleted ` tests/server/accessors/ ` (35 host-accessor unit tests — the
745+ base-runtime suites cover the equivalent behavior) and ` tests/server/managers/AppAccessorManager.test.ts ` ;
746+ removed the ` AppAccessorManager ` /` getAccessorManager() ` /` (x as any).accessors ` setup and assertions
747+ from the four manager tests, ` AppSettingsManager.test.ts ` , ` AppManager.test.ts ` , the two Deno-runtime
748+ integration tests, and ` AppListenerManager.test.ts ` .
749+
750+ ** Verification:** host ` tsc ` error-set unchanged vs the environmental-only baseline (no new errors);
751+ ` test:node ` host suites green (excluding the two ` deno ` -spawn integration suites, which require the
752+ ` deno ` binary unavailable in this environment); base-runtime suite unaffected (untouched by this phase).
753+
754+ ** End state:** the ` @rocket.chat/apps ` host no longer contains any accessor implementation or accessor
755+ manager. The only accessor-shaped code left on the host is the bridge layer (` AppBridges ` /` do* ` ) and
756+ ` AppResourceBridge ` ; every accessor an app actually uses is built and resolved inside
757+ ` packages/apps/base-runtime ` .
0 commit comments