Repository navigation
Description
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-diagramsin lockstep, withdefineModule({ name: "diagrams", … })and the CLI worddiagram(help only for now). - Add
uiandrenderexport entries (stubs) and askills/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
releaseskill'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 diagramspasses.tests/release-manifest.test.tspasses with the new package. -
upstream-report.tsagainst a fixture clone (two synthetic commits, a newtype-*.mdand a changed checker) prints exactly those items, and--jsonmatches a pinned shape. It refuses a path that is not a git repository. -
UPSTREAM.mdcontains 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/LICENSEcarries 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/mainContract 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
schlessera commentedon Oct 16, 2026
Claiming #2088 with token
2088-scaffold-20261016-r1, branchfeat/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.schlessera commentedon Oct 16, 2026
Merged #2162 as
d585b09a8a891860c78baaaa7150fa59990deed9, with actual parentfd9c450b5. 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/based529c8e8b: 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.