Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ bitshaper/
│ │ ├── fill.ts
│ │ ├── fillet.ts
│ │ ├── bulge.ts
│ │ ├── … # + circle, wedge, cap, pinwheel-arc, step, ogee,
│ │ │ # round-corner, arc-band, diagonal-band, leaf,
│ │ │ # diamond, parallelogram, bar, gable
│ │ └── index.ts # exports primitives in stable registration order
│ ├── library/
│ │ ├── catalog.json # curated [{id, name, tags}] entries
Expand All @@ -45,7 +48,7 @@ bitshaper/
## What belongs where

- **`src/core/`** — everything that doesn't need to know about the CLI or the catalog: the data model, the ID codec, the primitive registry, rendering, and seeded generation. This is the part of the package other tools (a future web app) import directly.
- **`src/core/primitives/`** — one pure function per primitive, each `(cellSize, rotation, invert) => path segments`. Never imports from `src/cli/` or `src/library/`. New primitives are always pushed to the end of `primitives/index.ts`'s export order — the array index becomes a primitive's permanent numeric type value in every ID ever issued (see `openspec/roadmap.md`'s 8-type-ceiling note). Never reorder existing entries.
- **`src/core/primitives/`** — one pure function per primitive, each `(cellSize, rotation, invert) => path segments`. Never imports from `src/cli/` or `src/library/`. New primitives are always appended to the end of `PRIMITIVE_REGISTRY` (`src/core/registry.ts`) — the array index becomes a primitive's permanent numeric type value in every ID ever issued (see `openspec/roadmap.md`). Never reorder existing entries. `primitives/index.ts` re-exports every builder alphabetically; `registry.ts` is the authority on registration order. Registered so far (index = `CellDef.type`): `empty` 0, `fill` 1, `fillet` 2, `bulge` 3, `circle` 4, `wedge` 5, `cap` 6, `pinwheel-arc` 7, `step` 8, `ogee` 9, `round-corner` 10, `arc-band` 11, `diagonal-band` 12, `leaf` 13, `diamond` 14, `parallelogram` 15, `bar` 16, `gable` 17.
- **`src/library/`** — the curated catalog and its accessors. Only ever references shape IDs renderable with the *current* primitive set — `bitshaper list` must never point at an unrenderable ID.
- **`src/cli/`** and **`src/cli/commands/`** — the `bitshaper` bin. Depends on `src/core/` and `src/library/`; never the reverse. One file per subcommand.
- **`test/`** — mirrors `src/` file-for-file. A test for `src/core/id.ts` lives at `test/core/id.test.ts`, not alongside the source file.
Expand Down
20 changes: 20 additions & 0 deletions docs/primitive-survey.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,23 @@ the rest:
- The "small-dot" motif (Shapes 36, 44, 46, 59, 64) is a canvas-centred circle sitting on a
grid *vertex*, not in any cell — a `corner-dot` primitive was prototyped and rejected
(no per-cell match ever preferred it). These shapes are deferred.

## Addendum (2026-09-07): `samples/new 4/` pass (Change C)

Surveyed the five screenshots in `samples/new 4/` against the 14 primitives then registered.
Four additions (registry indices 14–17):

- **`diamond`** (14) — square on its point, vertices at the edge midpoints. Sample 1 (45°
checkerboard) and the centre of sample 5.
- **`parallelogram`** (15) — full-height quad, top edge sheared right by `cellSize / 2`;
invert → backslash slant. Samples 3 (isometric-cube mark) and 4 (slanted bar rows); the
cube is an evocation, not a pixel match (true isometric is off-grid).
- **`bar`** (16) — centred axis-aligned band, full width, half-cell thick. Sample 2 (offset
horizontal stripes). Distinct from `diagonal-band` (sheared) and from edge-flush `fill`
at a finer grid.
- **`gable`** (17) — triangle, base on one edge, apex at the opposite edge midpoint. Weakly
evidenced in the samples; kept as a faceted companion to `diamond`/`cap` (two gables
base-to-base form a `diamond`).

See `docs/superpowers/specs/2026-09-07-bitshaper-new-primitives-design.md` for the full
analysis and the edge-signature adjacency table.
Loading
Loading