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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ It is standalone (not Eurorack), powered from a 5 V power bank through a screw t
5. Known issues of the current board are documented in `BUILD_GUIDE.md` section 10; the v2.0 fixes and leftovers are in `BUILD_GUIDE_v2.md` section 10. Reference those sections instead of restating the issues.
6. **The board has exactly one power input: `J4`, the screw terminal. Never describe USB-C as a power option.** v3.9 removed the `USB1` footprint and its `R1`/`R2` CC pull-downs outright, after a USB-C-powered v3.0 board ran for 20–30 minutes and then smoked at a connector pin ([#221](https://github.com/engmung/Patternflow/issues/221)) — the failure is delayed, so "it seems to work" is not evidence. On v3.9 the footprint does not exist; on a v3.0 board already in someone's hands, `USB1`/`R1`/`R2` stay unpopulated. Release notes and changelog entries that record the hold as it stood are history — update current-state docs, leave the record alone.
7. **The firmware core is not the place to put a feature.** `firmware/patternflow/patternflow.ino` and `firmware/patternflow/src/` are the device itself — panel, encoders, pattern loader, Wi-Fi, sleep, console — and every published firmware compiles them **unchanged**. They change for a bug or a real improvement to the device, and nothing else; a feature bends to fit the core, never the reverse. Features attach through the hooks in `firmware/patternflow/features/pf_feature.h`, and the core names none of them — no `#include`, no `#if PF_<FEATURE>_ENABLED`, not even a feature's name in a string on the screen or in a console page. Before editing the core, ask whether the edit would still be correct on a build that does not contain the feature you are working on; if not, it belongs in `features/`. The full reasoning is [`docs/EDITIONS.md`](docs/EDITIONS.md), and the header comment of `patternflow.ino` lists the regressions this rule exists because of.
8. During a cleanup window (see [`docs/rfc-cleanup.md`](docs/rfc-cleanup.md)) no PR changes behaviour; moves and renames carry a redirect or an updated link map.

## Common commands
- Web dev server: `npm run dev` (inside the `web/` directory)
Expand Down
83 changes: 83 additions & 0 deletions docs/investigations/2026-10-cleanup-baseline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Cleanup baseline

*Step 0 of [rfc-cleanup.md](../rfc-cleanup.md), §2.2. Run on 14 October 2026.*

The cleanup starts from `8226f7ea5da15b0e0e55b15fa9ec7af136eef080` on `dev`,
the commit that added [rfc-cleanup-progress.md](../rfc-cleanup-progress.md).
Project v3.11.0, Audio v0.7.0, Performance v0.4.0. The last commit to touch
`firmware/` or `web/` before it is `caaf2c1`, on 12 October.

The web commands ran in a cloud container on that tree with nothing added:
Node 22.22.0, npm 10.9.4, `npm ci` from `web/package-lock.json`. CI runs Node 20.

## The five commands

| command | result | output |
| --- | --- | --- |
| `firmware/bundles/build.sh all` | pass, on CI | five compositions built and scanned, see below |
| `npm run check:ci` | pass | 25 suites, last line `All module cache checks passed.`, 50 s |
| `npm run check:panels` | pass | 35 test files, 478 tests, 19 s |
| `npm run typecheck` | pass | `tsc --noEmit` prints nothing, 27 s |
| `npm run lint` | pass | 0 errors, 12 warnings, 50 s |

None of the five is red, so there is no fix PR to land before Step 1.

The container cannot build firmware. PlatformIO fetches the espressif32 platform
and the Xtensa toolchain from `api.registry.platformio.org`, and the container's
network policy refuses that host (403 on CONNECT). So `build.sh all` ran the way
CI runs it, `build.sh one <composition>` per job, in `firmware-build.yml`
dispatched on `dev` at this SHA ([run 38560727407](https://github.com/Patternflow-lab/Patternflow/actions/runs/38560727407)).
Each job scans its image for the feature markers:

```
default 1102672 bytes ok
audio 1208656 bytes ok
performance 1526624 bytes ok
clock 1187088 bytes ok
midi 1163440 bytes ok
```

`check_footprint.py` says `every edition within tolerance` in all five. The 17
host-side checks in `firmware-checks.yml` and the two in `console-sync.yml` pass.

The lint warnings, for Step 3:

| file | line | rule |
| --- | --- | --- |
| `web/scripts/performance-smoke.ts` | 16 | `@typescript-eslint/no-unused-vars` |
| `web/src/app/build/breadboard/page.tsx` | 394, 435, 476, 514, 556 | `@next/next/no-img-element` |
| `web/src/app/editions/EditionCard.tsx` | 35 | `@typescript-eslint/no-unused-vars` |
| `web/src/app/roadmap/RoadmapMap.tsx` | 272 | `@typescript-eslint/no-unused-vars` |
| `web/src/app/roadmap/RoadmapMap.tsx` | 315 | `react-hooks/exhaustive-deps` |
| `web/src/components/community/PatternCard.tsx` | 8 | `@typescript-eslint/no-unused-vars` |
| `web/src/components/journal/JournalLightbox.tsx` | 86 | `@next/next/no-img-element` |
| `web/src/components/sections/Hero.tsx` | 55 | `@next/next/no-img-element` |

## The doc map

`npm run doc-map` in `web/` ([doc-map.ts](../../web/scripts/doc-map.ts))
wrote [2026-10-doc-map.csv](2026-10-doc-map.csv): 1007 links out of 193
files, 7 of them from this file, `AGENTS.md` and the progress log as Step 0
leaves them. 532 are relative, 329 site, 114 absolute-blob and 32 console.
None is absolute-raw; nothing links through `raw.githubusercontent.com`.

24 of the absolute-blob rows name a release tag, `v1.0.0` to `v3.1.0`, from the
roadmap, the release notes and the hardware READMEs. A shallow clone has no
tags and reports those 24 as `no`, so fetch the tags before running the script.

The map leaves out links that a file move cannot break: a bare `#anchor`
inside one file, the repository's front page, issues, pull requests and
releases. It also leaves out the site's own route links (`href="/guide"` in a
component), the vendored upstream docs under `hub75/`, `webserver/` and
`pubsubclient/`, and the `*_index.h` headers, which are the console pages again.

§2.3 expects the site to link `BUILD_GUIDE_v2.md` at §1, §2, §4, §8 and §10.
At this SHA it links it once, from `BuildPanel.tsx`, with no anchor. The
anchored links go to `BUILD_GUIDE.md`. Moving the v2 guide touches that one
site link, the test beside it, and five Markdown files: `README.md`,
`BUILD_GUIDE.md`, `docs/assembly/README.md`, `hardware/README.md` and
`hardware/case/README.md`.

## Known broken

None. Every row in the map resolves.
Loading
Loading