Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

chore(prompts): retire order 418, open-source Source link 404s fixed

nirholasf499ebf97629
diff --git a/prompts/finish/418-auto-open-source-credit-repo-links.md b/prompts/finish/418-auto-open-source-credit-repo-links.md
deleted file mode 100644
index 5ef53992d..000000000
--- a/prompts/finish/418-auto-open-source-credit-repo-links.md
+++ /dev/null
@@ -1,98 +0,0 @@
-# 418. Fix 17 "Source" links on /open-source that point at three.ws 404s instead of GitHub
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now, no gate, no owner action required.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. CLAUDE.md overrides everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan.
-- Bug fixes are test-first: the failure is reproduced below. Confirm it fails for the stated reason, fix it, confirm green, commit test and fix together.
-- Concurrent agents share this worktree: stage explicit paths only (never `git add -A` or `git add .`), re-check `git status` and `git diff --staged` before committing.
-- No em-dash/en-dash anywhere you write.
-
-## Step 0: re-derive the current state
-
- node -e "
- const { buildCredits } = require('./scripts/lib/open-source-credits.mjs');
- " 2>&1 | head -5
-
-That direct require fails because the module is ESM; use the project's own test instead, which already re-derives the same data:
-
- npx vitest run tests/open-source-credits.test.js
-
-Then confirm the live bug with a one-off script:
-
- node -e "
- import('./scripts/lib/open-source-credits.mjs').then(({ buildCredits }) => {
- const bad = buildCredits().entries.filter(e => e.repo && !/^https?:\/\//.test(e.repo));
- console.log(bad.length, 'entries with a non-http(s) repo field');
- for (const b of bad) console.log(' ', b.id, '->', JSON.stringify(b.repo));
- });
- "
-
-As measured 2026-10-24, this prints 17 entries, including:
-
- npm:ajv -> "ajv-validator/ajv"
- npm:express -> "expressjs/express"
- npm:jose -> "panva/jose"
- npm:p-limit -> "sindresorhus/p-limit"
- npm:@sparkjsdev/spark -> "sparkjsdev/spark"
- npm:nanoid -> "ai/nanoid"
- npm:@upstash/redis -> "[email protected]:upstash/redis-js"
- npm:glob -> "[email protected]:isaacs/node-glob"
- npm:@kamino-finance/klend-sdk -> "github.com:Kamino-Finance/klend-sdk"
- npm:lru-cache -> "ssh://[email protected]/isaacs/node-lru-cache"
-
-`src/open-source.js` line 25 renders this field verbatim: `<a href="${escapeHtml(entry.repo)}" rel="noopener" target="_blank">Source</a>`. A browser resolves `"ajv-validator/ajv"` as relative to the current page (`https://three.ws/open-source` + `ajv-validator/ajv` -> `https://three.ws/ajv-validator/ajv`, which 404s on three.ws) instead of opening the GitHub repo; `[email protected]:...` and `ssh://[email protected]/...` are not `http(s)` URLs at all and a browser click does nothing or errors. This is exactly the set of paths the 2026-10-24 authenticated page-audit crawler found and listed under "Crawl-discovered routes (linked on the site, missing from data/pages.json)" in `reports/page-audit-2026-10-24T01-31-13-697Z.md` (e.g. `/ajv-validator/ajv`, `/expressjs/express`, `/expressjs/compression`, `/panva/jose`, `/sindresorhus/p-limit`, `/sparkjsdev/spark`, `/ai/nanoid`, `/[email protected]:isaacs/node-glob`, and five more `[email protected]:...` entries). **Do not "fix" this by adding those paths to `data/pages.json`**; they were never meant to be three.ws routes, they are supposed to leave the site entirely and land on GitHub. The crawler surfacing them as "missing routes" is a side effect of the real bug, not the bug itself.
-
-If step 0's count is 0 by the time you run this (another agent already shipped a fix), run `git log --oneline -5 -- scripts/lib/open-source-credits.mjs` to find it, confirm `normalizeRepoUrl()` now handles the shapes below, and retire this order per the "Never blocked" table.
-
-## Root cause
-
-`normalizeRepoUrl()` in `scripts/lib/open-source-credits.mjs` (lines 569-576) normalizes a `package.json` `repository` field's `git+https://`, trailing `.git`, `git://`, and `github:` shorthand forms, but misses four shapes real npm packages in this dependency tree actually use:
-
-1. Bare `"owner/repo"` shorthand, no scheme at all (the npm `repository` field spec explicitly allows this): `ajv-validator/ajv`, `expressjs/express`, `expressjs/compression`, `panva/jose`, `sindresorhus/p-limit`, `sparkjsdev/spark`, `ai/nanoid`.
-2. SSH shorthand `[email protected]:owner/repo`: `isaacs/node-glob`, `upstash/redis-js`, `rvagg/cborg`, `livekit/client-sdk-js`, `solana-foundation/solana-attestation-service`, `ethereum-attestation-service/eas-sdk`, `indutny/bn.js`.
-3. Scheme-less host form `github.com:owner/repo` (no `git@`, no `https://`): `Kamino-Finance/klend-sdk`.
-4. Explicit `ssh://[email protected]/owner/repo`: `isaacs/node-lru-cache`.
-
-`buildCredits()`'s npm-entry path (`npmEntries()`, line 535) calls `normalizeRepoUrl(repo)` on every dependency's raw `package.json` `repository` field, so any shape it does not handle flows straight through to the committed `data/open-source-credits.json` and then to the rendered `<a href>` unchanged.
-
-## Task
-
-1. Open `scripts/lib/open-source-credits.mjs` and extend `normalizeRepoUrl()` (lines 569-576) to also handle the four shapes above, converting each to a canonical `https://github.com/<owner>/<repo>` (or the correct host for a non-GitHub case, if one ever appears; everything found 2026-10-24 is GitHub). Suggested order of transforms, applied before the existing ones so they compose:
- - Strip a leading `git+` and a trailing `.git` (already done).
- - `[email protected]:owner/repo` -> `https://github.com/owner/repo` (match `^git@([^:]+):(.+)$` -> `https://$1/$2`, generalizes past GitHub for free).
- - `ssh://git@host/owner/repo` -> `https://host/owner/repo` (match `^ssh:\/\/git@([^/]+)\/(.+)$` -> `https://$1/$2`).
- - `host:owner/repo` with no scheme and a `.`-containing host (e.g. `github.com:Kamino-Finance/klend-sdk`) -> `https://host/owner/repo`. Be careful not to misfire on an already-bare `owner/repo` shorthand (no dot in the first segment): only treat the part before the first `:` as a host if it contains a `.`.
- - Bare `owner/repo` (no scheme, no colon, exactly one `/`, no spaces) -> `https://github.com/owner/repo`. This is the npm-spec shorthand and always means GitHub.
- - Run the existing `github:` shorthand and `git://` transforms last (unchanged).
-2. Also defensively guard the renderer, since a future dependency could ship a repository field in some fifth shape nobody has hit yet, and a renderer should never emit a link it knows cannot work: in `src/open-source.js`, before pushing the "Source" link (line 25), confirm `entry.repo` matches `/^https?:\/\//`; if a value somehow still does not (future-proofing, not expected to trigger today once step 1 lands), omit the link rather than render a broken one, mirroring how line 26's `funding` link is already conditionally omitted when absent.
-3. Add unit tests in `tests/open-source-credits.test.js` (or a new `tests/open-source-credits-repo-url.test.js` if cleaner, following the existing file's import style: `import { buildCredits, AREAS, ROOT } from '../scripts/lib/open-source-credits.mjs'`) covering all four input shapes from Root cause, each asserting the exact expected `https://github.com/owner/repo` output. If `normalizeRepoUrl` is not currently exported, export it (additive change, no behavior change) so it can be tested directly instead of only indirectly through `buildCredits()`.
-4. Regenerate the committed data file so it matches the fixed generator (the existing test deep-equals `buildCredits()` against this file, so it must be regenerated, not hand-edited):
-
- node scripts/build-open-source-credits.mjs
-
-5. Re-run the step-0 one-off script; confirm it now prints `0 entries with a non-http(s) repo field`.
-
-## Done when
-
-- The step-0 one-off script prints `0 entries with a non-http(s) repo field`.
-- `npx vitest run tests/open-source-credits.test.js` passes (including new coverage for all four shapes).
-- `npm run test:core` shows no new failures versus the pre-change baseline.
-- `git diff` touches only: `scripts/lib/open-source-credits.mjs`, `src/open-source.js`, `data/open-source-credits.json` (regenerated), and the test file(s).
-- Committed on `evolve` with an explicit-path commit naming the fix.
-- This file is removed, with a dated entry added to `prompts/finish/_context/production-100-PROGRESS.md` citing the commit SHA.
-
-## Never blocked
-
-| Looks like a blocker | It is not | Do this |
-|---|---|---|
-| Tempted to fix this by adding `/ajv-validator/ajv` etc. to `data/pages.json` since the audit report lists them under "crawl-discovered routes" | Those paths are not supposed to exist on three.ws at all; they are a symptom of the broken link, not a missing page | Fix `normalizeRepoUrl()` so the link never points at three.ws in the first place; do not touch `data/pages.json` for this order |
-| Count is already 0 when you check | Another agent may have shipped this | Confirm via `git log --oneline -5 -- scripts/lib/open-source-credits.mjs`, verify `normalizeRepoUrl()` now covers all four shapes, retire this order without further changes |
-| `data/open-source-credits.json` is described as "never hand-edited" | That is about avoiding drift between the generator and the committed file, not a reason to skip regenerating it after a real generator fix | Run `node scripts/build-open-source-credits.mjs` after fixing the generator, same as any dependency-version bump would require |
-| New dependencies show up in `package.json` between when this order was written and run, changing the exact 17-entry list | The list is illustrative, not load-bearing; the fix is generic (handles the shape, not the specific package names) | Re-run step 0 fresh and fix whatever non-http(s) shapes the current dependency tree actually has |
-
-## Report format
-
-State: the step-0 "before" count and entries, the diff for `normalizeRepoUrl()` and `src/open-source.js`, the new test file/cases and their passing output, the regenerated `data/open-source-credits.json` diff summary (entry count changed, if any), the step-0 "after" count (must be 0), the `npm run test:core` before/after failure counts, and the commit SHA.
diff --git a/prompts/finish/_context/production-100-PROGRESS.md b/prompts/finish/_context/production-100-PROGRESS.md
index 88cd42cdb..0e8f02609 100644
--- a/prompts/finish/_context/production-100-PROGRESS.md
+++ b/prompts/finish/_context/production-100-PROGRESS.md
@@ -1640,3 +1640,13 @@ Did: added `src/shared/thumb-fallback.js`, a `data-thumb-fallback` attribute plu
`npx vitest run tests/thumb-fallback.test.js`: 4/4 pass. `npm run test:core` full run: 43 failed files / 72 failed tests, all pre-existing and unrelated to the changed files (confirmed by name against the failure list: `keys-endpoint.test.js`, `mcp-agent.test.js`, and an Upstash rate-limit exhaustion in `mcp-studio-ratelimit.test.js`), lower than the 47/76 baseline order 401 had on record, so no new failures. `npm run check:rules -- --paths src/shared/thumb-fallback.js src/monitor.js src/economy-live.js src/avatar-gallery-picker.js pages/monitor.html tests/thumb-fallback.test.js` exits 0. Real-browser verification: started `npx vite --port 3107` (dev proxy forwards `/api/*` to live production, so the real, still-active R2 outage was visible), loaded `/monitor`, `/economy`, and `/gallery-picker` with headless Playwright; confirmed zero broken `<img>` nodes remained and the designed fallback tiles rendered instead (43 on `/monitor`, 24 on `/economy`, 24 on `/gallery-picker`); server stopped by PID afterward (`pkill -f` against this pattern does not reliably target the right process in this environment, so PIDs were read from `ps aux` and killed explicitly). `git diff --stat` touched exactly the six files the order's Done-when list named. Fix commit: `b41962e40`.
Left: nothing for this order. `prompts/finish/417-auto-thumbnail-error-fallback.md` deleted in this closing commit.
+
+## 2026-10-24: order 418 (normalizeRepoUrl misses 4 shapes, 17 Source links on /open-source 404) closed
+
+Measured: step-0's one-off script printed `17 entries with a non-http(s) repo field` exactly as predicted, matching the order's named list (`npm:ajv -> "ajv-validator/ajv"`, `npm:express -> "expressjs/express"`, `npm:@upstash/redis -> "[email protected]:upstash/redis-js"`, `npm:@kamino-finance/klend-sdk -> "github.com:Kamino-Finance/klend-sdk"`, `npm:lru-cache -> "ssh://[email protected]/isaacs/node-lru-cache"`, plus 12 more of the same four shapes). `npx vitest run tests/open-source-credits.test.js` failed 2 of 5 before any fix: the deep-equal test on a stale version mismatch (`three` 0.184.0 vs committed 0.186.1) and a missing-dependency test for `8004-solana`, both because this worktree's `node_modules` predated a dependency bump and were never reinstalled, unrelated to the repo-url bug itself.
+
+Did: extended `normalizeRepoUrl()` in `scripts/lib/open-source-credits.mjs` with three new branches ahead of the existing `git://`/`github:` transforms, handling `git@host:owner/repo`, `ssh://git@host/owner/repo`, scheme-less `host.with.dot:owner/repo`, and bare `owner/repo` (the last defaulting to GitHub per the npm `repository` field spec), each guarded so it does not misfire on the others (the host-form check requires a dot before the colon; the bare-shorthand check rejects any colon at all, so `github:owner/repo` falls through untouched into the existing final transform). Exported `normalizeRepoUrl` so it is testable directly. Guarded `src/open-source.js`'s Source-link renderer to only emit the `<a>` when `entry.repo` matches `/^https?:\/\//`, mirroring the existing conditional `funding` link, as defensive future-proofing per the order's step 2. Ran `npm ci --ignore-scripts` to fix the stale `node_modules` (lockfile already pinned `[email protected]` and the newer `three`/`three-mesh-bvh` versions; this was an environment-sync issue, not a code change) before regenerating `data/open-source-credits.json` via `node scripts/build-open-source-credits.mjs`. Added 11 new test cases to `tests/open-source-credits.test.js`: a dataset-wide guard that every `repo` field matches `/^https?:\/\//`, plus a new `describe('normalizeRepoUrl')` block covering all four shapes from Root cause (bare shorthand, `git@host:`, scheme-less `host:`, `ssh://git@host/`) plus the three pre-existing shapes (null, full https, `git+`/`.git` strip, `git://`, `github:`) to guard against regression.
+
+Step-0 script re-run after the fix: `0 entries with a non-http(s) repo field`. `npx vitest run tests/open-source-credits.test.js`: 15/15 pass. `git diff --stat` touched exactly `scripts/lib/open-source-credits.mjs`, `src/open-source.js`, `data/open-source-credits.json` (34 lines: 17 `repo` fields corrected, no entry-count or version drift since `npm ci` already brought `node_modules` in line with the already-committed data file), and `tests/open-source-credits.test.js`, matching the order's named scope exactly; `data/pages.json` untouched per the order's explicit warning not to add the crawl-discovered paths there. `npm run test:core` full run: 43 failed files / 72 failed tests, none naming `open-source` or any touched file; identical 43/72 to the baseline order 417 recorded minutes earlier in this same log, confirming no new failures from this change (the prior `npm ci` only installed already-lockfile-pinned versions, so it could not have shifted this count either). `npm run check:rules -- --paths scripts/lib/open-source-credits.mjs src/open-source.js data/open-source-credits.json tests/open-source-credits.test.js` exits 0. Fix commit: `d8565ff1b`.
+
+Left: nothing for this order. Noted but out of scope: several unrelated files (`public/changelog-recent.json`, `public/changelog.json`, `public/features.json`, `public/llms-full.txt`, `public/llms.txt`, `public/sitemap/index.html`) were modified in the shared worktree by a concurrent agent mid-session; left untouched and unstaged per the explicit-path commit rule. `prompts/finish/418-auto-open-source-credit-repo-links.md` deleted in this closing commit.