Skip to content

modules: scaffold the diagrams module with upstream provenance and a sync procedure #2088

Closed

Description

@schlessera

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

Stack B (diagrams core), layer 1 of 4. Branch feat/2088-diagrams-module-scaffold. Parent: main. Next layer: #2089. Plan: #2079 § Stack plan.

Context

The diagrams module is new. It adapts the method of https://github.com/cathrynlavery/diagram-design (MIT), reviewed at commit b46c970. docs/decisions/module-renderers.md ruling 7 requires:

  • a pinned upstream commit
  • the MIT notice for the adapted portions
  • no vendored upstream HTML
  • a written procedure for reviewing upstream over time

The procedure is drafted in the plan's "Keeping up with upstream" section.

Module layout precedent: packages/module-video/ (manifest in src/module.ts, skills/, LICENSE, and the package.json files entry).

Scope

  • Create packages/module-diagrams, published as @schlessera/brain-module-diagrams in lockstep, with defineModule({ name: "diagrams", … }) and the CLI word diagram (help only for now).
  • Add ui and render export entries (stubs) and a skills/ directory.
  • Add upstream.json: repository, commit, date and plugin version of the last reviewed upstream state.
  • packages/module-diagrams/LICENSE: brain-kit's MIT text, then a "Portions adapted from diagram-design" section reproducing upstream's MIT notice verbatim (ruling on modules: rule on reproducing upstream's MIT notice, which names a person, against the no-real-names rule #2109; decision ruling 8). Add to that section a statement of which parts are adapted (rules, budgets, type grammars) and which are not (skin, examples, tooling).
  • Add UPSTREAM.md: the review procedure moved from the plan. Leave a pointer in the plan.
  • Add scripts/upstream-report.ts <clone> --since <commit> [--json]. It reads a local clone, never runs anything in it, and lists added, removed and changed references and checkers grouped as in the procedure, with CHANGELOG entries since the commit.
  • Release manifest, package inventories and README, following the release skill's checklist for adding a package.

Out of scope

  • The spec, geometry, skin, renderer and skill (later tasks).
  • Running a real upstream review (part of the epic's definition of done).

Acceptance criteria

  • brain module lint diagrams passes. tests/release-manifest.test.ts passes with the new package.
  • upstream-report.ts against a fixture clone (two synthetic commits, a new type-*.md and a changed checker) prints exactly those items, and --json matches a pinned shape. It refuses a path that is not a git repository.
  • UPSTREAM.md contains the four triage outcomes, the re-author rule and the pin-moving rule from the plan, and the plan points to it.
  • packages/module-diagrams/LICENSE carries upstream's notice verbatim under its own section, and the leakage gate passes with its patterns and exemptions unchanged.
  • A test covering this fails on the tree before the change and passes after.

Verification

bun run test
bun run typecheck
bun run lint
brain module lint diagrams
bun run check:pr --base origin/main

Contract impact

  • This touches the integration contract.
  • This changes a published package's behaviour, so it needs a changeset.

2026-10-16: the upstream notice question moved to its own ruling, #2109. The notice scope and acceptance item now point there.
2026-10-16: #2109 ruled option A. The notice lives in the module's LICENSE.

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 prerequisite delivered: PR #2102 merged as 283b2339e1928f50ec448bd8abf65fa00f17a375, closing #2109 and recording option A in the decision and AGENTS.md. The attribution prerequisite is satisfied; clear its blocked label. Other scope and stack selection rules remain as recorded.

2026-10-16 #2137 reconciliation: 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.

Activity

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

    @schlessera
    OwnerAuthor

    Claiming #2088 with token 2088-scaffold-20261016-r1, branch feat/2088-diagrams-scaffold-r1. Implementing the help-only module scaffold, pinned upstream provenance/license, local-clone report and required release inventories. Upstream code is read as data; no scripts are executed.

  6. schlessera commented on Oct 16, 2026

    @schlessera
    OwnerAuthor

    Merged #2162 as d585b09a8a891860c78baaaa7150fa59990deed9, with actual parent fd9c450b5. The scaffold, pinned provenance/license, local-clone report and nineteen-package release inventories are delivered. Issue and PR retain release 0.44.0.

    Retained proof on head a4efec0e7/base d529c8e8b: committed preflight 916 pass, 6072 assertions; module/report tests 4 pass, 44 assertions; typecheck and full build pass. Nested-checker failing-first and three behavioral mutations are recorded in the PR. Exact upstream notice and actual 37-entry tarball were verified, including packed Bun/Node entries.

    Actual integrated squash separately passed 102 scaffold/core-renderer/citation/release tests (272 assertions). Hosted main proof is queued and is not claimed green. The standalone diagram-check command, renderer and skill are later epic work; no upstream review was performed. #2089 can now start from main.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: modulespriority: p1type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions