Repository navigation
Retry an add only on a taken name, and show the server's refusal - #249
Conversation
Adding a module whose name the server refuses for any reason other than a taken name now shows the server's own reason at once, instead of retrying nineteen numbered names and then reporting twenty collisions.
KPI: 256lights | Desktop:2600KB | tick:8/10/8/1/8/8/167/7/7/8us(FPS:125000/100000/125000/1000000/125000/125000/5988/142857/142857/125000) | src:397(100835) | test:295(71352) | functions-over:333
Commit: src +19/-5 lines | test +0/-0 lines | duplicated lines 3190 -> 3190 (+0)
**UI**
- `addModule` reports a refusal through an optional out-parameter (`{status, error}`); callers that pass none behave as before.
- `addModule`'s comment says when it returns null: an empty `type`, a refusal or a failed request.
- `addPickedType` retries with `-2` to `-20` only on 409 (name in use); any other refusal, such as a name too long, stops at the first attempt and shows the server's error.
**Docs/CI**
- The backlog mirror re-rendered: two of the Project's cards changed since the last render.
- check_prose fails on counts this change does not raise: EmDash 989 -> 1039 and SelfReference 14 -> 16, which upstream/main itself shows on this machine (likely Vale without its C++ and Python grammars, W101, a hypothesis), and Temporal 170 -> 171 from upstream lines (1f42852, f5868a7); this change's added lines carry no finding.
- The Reviewer step skipped: one file, 14 lines.
Tested: desktop 3,353/3,353; JS suite 397/397; the S3 firmware (esp32s3-n16r8) built; `node --check` on app.js; in a browser on the desktop build (port 8083, a scratch data folder), adding the script particle-fountain (17 characters, over the 15-character name limit) showed one alert with the server's reason, and adding voronoi twice made voronoi-2 with no alert (James).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
Automated regression tests are still needed to verify retry behavior for 409 collisions, other refusals, request failures, and the twenty-collision limit.
1 open issue
What changed in this PR
This PR fixes MoonLive script creation in the picker so only name collisions trigger retries, while other failures show their reported reason.
Changes:
- Add optional failure details to
addModulewithout changing existing callers. - Retry with numbered names only for HTTP 409 responses.
- Refresh repository health metrics and record a desktop render-loop pacing backlog item.
| File | Description |
|---|---|
src/ui/app.js |
Report add failures and restrict picker retries to name collisions. |
docs/work/backlog_mirror/platform.md |
Document the desktop render-loop pacing backlog item. |
docs/work/backlog_mirror/cards.json |
Add the corresponding backlog card metadata. |
docs/reference/metrics/repo-health.md |
Refresh the generated repository health report. |
docs/reference/metrics/repo-health.json |
Update the underlying repository health measurements. |
Review effort: Balanced
| return created; | ||
| } | ||
| // Only a taken name (409) is worth retrying with a suffix: any other refusal (a name too long, an unknown type, a missing parent) fails the same way with -2, so the add stops at the first and shows the server's own reason. | ||
| if (why.status !== 409) { |
#249 (the add retry) merged after this branch was cut; its regenerated repo-health conflicted with this branch's newer KPI run, which stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

PR 0 of the Pi HUB75 series agreed in the agent-to-agent thread (https://discord.com/channels/700041398778331156/1571096940576510053). It is not HUB75 work, so it goes up alone.
What changes
Adding a MoonLive script from the picker retried the name with
-2to-20on any refusal, then alerted that twenty modules of that name already exist. A name too long, or any other refusal, looked like twenty collisions.addModulereports a refusal through an optional out-parameter ({status, error}); callers that pass none behave as before.addPickedTyperetries only on 409 (name in use). Any other refusal stops at the first attempt and shows the server's own reason.One file,
src/ui/app.js, 14 lines of code.Tested
particle-fountain(17 characters, over the 15-character module name limit) shows one alert with the server's reason ("could not add particle-fountain: missing type, a name too long, or no parent_id ..."); addingvoronoitwice makesvoronoi-2with no alert.check_prosefails on counts this change does not raise: EmDash and SelfReference, whichmainshows on this machine too (likely Vale running without its C++ and Python grammars), and two Temporal findings in lines already onmain. The change's own added lines carry no finding.How it was written
The change was written with an AI agent (Claude) from the bug found while adding the HUB75 test pattern script; I read every line, ran the browser checks myself, and the agent ran the suites and checks.