Skip to content

core: a module declares content renderers in its manifest #2082

Closed

Description

@schlessera

Part of #2079. Decision: docs/decisions/module-renderers.md. Design: docs/plans/module-renderers.md.

Stack A (renderers), layer 2 of 6. Branch feat/2082-module-renderer-manifest. Parent: #2081 (branch feat/2081-content-renderer-seam). Next layer: #2083. Plan: #2079 § Stack plan. Under #2137 option A, a blocked upper layer is selectable only after every remaining open blocker is verified as an open, non-draft lower PR in this epic's declared stack with complete passing selected proof for its current parent/head candidate. Verify actual membership and the immediate parent before claiming and again before checkout creation; start from that verified head. Any genuine needs: label, non-stack blocker or unavailable/failed/cancelled/unexpectedly skipped proof rejects selection. Preserve canonical Blocked by lines and blocked for open dependencies; a merged parent uses ordinary reconciliation and fetched main. Each layer owner refreshes their own layer bottom-up after parent changes, with explicit ownership handoff when absent. The stack merger verifies each included issue's delivered identities, acceptance/proof and release milestones and closes only completed issues. Native-stack candidate qualification remains separately subject to #2141.

Context

ModuleContribution (export interface ModuleContribution, packages/core/src/lib/module-types.ts:128-154) has no way to declare a renderer, and the loader validates contributions .strict() (packages/core/src/lib/module-loader.ts). docs/modules.md currently says "A module supplies data and CLI actions, never React components", which the decision reverses for content renderers only.

The tools key is the precedent for adding a contribution kind: docs/decisions/module-mcp-tools.md.

Scope

  • Add renderers?: Record<string, { fences?: string[]; extensions?: string[]; client: string; static?: string }> to ModuleContribution. client and static are package export specifiers, for example @schlessera/brain-module-diagrams/ui.
  • Validate it in the loader's strict schema:
    • fence names match ^[a-z][a-z0-9-]*$
    • extensions start with .
    • the specifiers are package-relative exports of the module itself
  • A fence or extension claimed by two configured modules is a load error naming both, as CLI word collisions are. The built-in languages (mermaid, mmd) are reserved.
  • brain module lint checks that the specifiers resolve and that the static entry exports toStatic.
  • Expose the merged declarations to core consumers (brain render) and to ui-server.
  • Update docs/modules.md (the contribution table and the "never React components" sentence, now narrowed) and the supported-inputs contract.

Out of scope

Acceptance criteria

  • A module declaring renderers loads, and brain module lint reports a missing export by name. Each has a test.
  • A collision between two configured modules fails load with both module names. A collision with a dormant module does not.
  • An unknown key inside a renderer declaration is rejected (strictness test).
  • A test covering this fails on the tree before the change and passes after.

Verification

bun run test
bun run typecheck
bun run lint
bun run check:pr --base origin/feat/2081-content-renderer-seam   # this layer's parent

Contract impact

  • This touches the integration contract (supported module inputs), so it needs the contract label, a CONTRACT: commit prefix and the doc updated in the same commit.
  • This changes a published package's behaviour, so it needs a changeset.

2026-10-16: added the stack position and parent-based verification (stacked PRs, #1997). The #2137 option A selection/owner-refresh/merger-closure rules now apply; they do not establish candidate qualification for this issue.

2026-10-16 readiness reconciliation: #2081 merged in #2133. This layer now starts from main and verifies against origin/main; its former parent dependency is satisfied.

Activity

  1. added
    type: feat
    area: core
    area: modules
    priority: p1
    agent-ready
    blocked
    contract
    on Oct 16, 2026
  2. added this to the 0.44.0 milestone on Oct 16, 2026
  3. removed
    blocked
    on Oct 16, 2026
  4. self-assigned this
    on Oct 16, 2026
  5. schlessera commented on Oct 16, 2026

    @schlessera
    OwnerAuthor

    Claiming #2082 with token p1-2082-manifest-r1, branch feat/2082-module-renderer-manifest-r1, after #2081 merged. Implementing and verifying the manifest, collisions, lint and merged metadata surfaces.

  6. schlessera commented on Oct 16, 2026

    @schlessera
    OwnerAuthor

    Completed in #2158, squash c5d275505c201c022d57eb0f60922c9938440aef, verified present on main. Actual squash parent: d529c8e8b7777a7de0322d286233ab405f6271b1; tree: 2ec8feccac4097ced84b5b4e701b36525ef0f6ae.

    Postmerge verification on that exact squash passed 100 tests / 607 assertions, covering renderer manifests and lint, real CLI/stdin MCP regressions, dormant collisions, authenticated HTTP→CLI metadata and decision citations. Premerge typecheck, focused preflight (739 / 5,081), restored guard tests and named failing mutations passed as recorded on the PR. PR and closed issue retain milestone 0.44.0. Hosted main CI run 38918262557 remains queued; no hosted green is claimed. The unrelated project-sync workflow failed without product CI results.

    #2083's closed dependency and blocked label have been reconciled; browser dispatch remains its next scoped task.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: corearea: modulescontractpriority: p1type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions