Skip to content

Replace the untyped ctx.adminContext bag with a typed, optional capability registry #97

Closed

Description

@zumbrunn

Problem

Core and the admin plugin communicate through BootstrapResult.adminContext, a Record<string, unknown> | null that plugin-admin fills and core reads with casts. Core reads it in four files:

  • src/cli/serve.ts: writes jobScheduler, reads the scheduler and executeScheduledAction
  • src/runtime/register-feeds.ts: staging (staged-content preview in feeds)
  • src/runtime/register-middleware.ts and src/runtime/server.ts: auth (admin-session detection for role-gated pages)

It is untyped, so the shape is an unwritten contract that would be frozen at 1.0 by accident. It also hides which public behaviour depends on an admin being present.

Proposal

A typed, optional capability registry owned by core. An admin (or any plugin) contributes capabilities through typed slots (staging, auth / session resolver, jobs, and whatever else the audit finds); core reads them with proper types and treats a missing slot as "feature absent". "No admin" then just means "no contributions". adminContext is removed, not kept as an alias (deprecated bits are gone by 1.0).

Notes

Activity

  1. 6 remaining items

  2. zumbrunn commented on Nov 10, 2026

    @zumbrunn
    MemberAuthor

    Done: the capability registry (#109), core consuming it (#110) and the removal of adminContext, adminServices, adminPages, adminBarActions and mountEarly (#111), with the follow-ups that came out of the work (#112 to #116, #125, #126, #133, #134; later hardened in #144). Acceptance: the headless smoke test passes in CI, and the registry is covered by tests with stub plugins contributing slots and points (tests/plugin-api/capabilities_test.ts); @dune/testing's stub admin and conformance suite (testing#3 to #5) are the broader proof and ship with testing 2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions