Skip to content
joinery / docs

🔎 Developer portal: bugs, duplication and weak code

2415 words · updated 6 hours agodocs/audits/2026-09-25-developer-portal.md
This page links to something that is not there
../../apps/developer-portal/app/components/StatTile.vue#L2

🔎 Developer portal: bugs, duplication and weak code

Context

A static read of apps/developer-portal: every non-spec source file under shared/, server/, tools/ and app/. A finding marked Confirmed was checked against .report/ or the prerendered .output/; Likely was reasoned from the code and not reproduced; the rest were read only. Each fix comes with a spec that names the failure it pins (writing-tests skill). Line numbers are as of commit.

Bugs

IDWhereWhat goes wrongFixStatus
B1scorecards.vue:13-15Confirmed. idOf(review.path) keeps .md, because ReviewScorecard.path is a repo path. Every link from Scorecards goes to /reviews/2026-09-15-bfd6da2.md (in the built scorecards/index.html), which queries /docs/reviews/…md and lands on "No such review". The spec's fixture uses …-abc.md and never checks the href.Strip the extension (toCollectionPath(path).split("/").at(-1)), and assert the href in scorecards.spec.tsfixed
B2StatusPill.vue:17Likely. :is="to ? 'NuxtLink' : 'span'" compiles to resolveDynamicComponent("NuxtLink"). Nuxt's loader only rewrites literal resolveComponent(...), and NuxtLink is not registered globally, so this renders as an unknown <nuxtlink> element. The spec passes only because it stubs NuxtLink globally. It's latent today because no decision is superseded.Import NuxtLink from #components, as StatTile.vue:2 already doesfixed
B3changelog.vue:41-42The "Never released" alert needs unreleasedCommits > 0. But metrics.ts:31 returns null when a project has no <name>@* tag, which is exactly the never-released case. So the alert can't fire for the projects it describes.Count commits since the root commit when there's no tag, or key the alert on currentVersion/tag absence plus commits > 0fixed
B4docs.ts:48checkLink resolves a root-absolute href (/docs/x.md) against the filesystem root, not the workspace, so it's reported broken and resolved comes out as a garbage slice. resolveDocLink treats the same href as workspace-rooted, so the two checkers disagree.Reuse resolveDocLink's resolution in the collector (see D1)wont-fix — no doc here uses a root-absolute href; every repo link in the corpus is relative
B5docs.ts:48decodeURIComponent throws URIError on a stray %. The throw escapes collectDocs, and tryRun then marks the whole docs artifact failed because of one link.Wrap it and treat an undecodable href as brokenwont-fix — the only % in any href is a valid %5B escape
B6docs.ts:10The LINK regex also matches [x](y) inside fenced or inline code, so a code sample showing link syntax shows up as a broken link. The remark plugin only sees real links.Strip fences and inline code before matching (as issues.ts:3 does), or collect links from the mdastfixed
B7[artifact].get.ts:36artifact in readers is true for inherited keys. /api/snapshot/constructor calls Object() and returns { constructor: {} }.Object.hasOwn(readers, artifact)wont-fix — the only caller is useSnapshot, typed to the reader keys, and the deployed site is static
B8collect/index.tsWhen a collector fails, the previous run's <name>.json stays in .report/. The server serves it as if it were current, and only SnapshotAge on that page says it failed. The Overview and badges have no status check.Delete the stale file on failure, or have readArtifact consult manifest.artifacts[name].okwont-fix — the deploy collects on a fresh runner, so there is no stale file; locally the terminal and the artifact's own page both report the failure
B9collect/index.ts:32-40A graph failure returns early and skips deps, docs and scorecards, which don't depend on the graph (collectDocs ignores _projectRoots).Run the three independent collectors regardlesswont-fix — collect runs as an Nx target, so a graph Nx cannot build stops the run before any collector starts
B10Not-found states in docs/...slug.vue:74, decisions/id.vue:68, reviews/[[id]].vue:121"No such page/report/review" is served with HTTP 200, so the prerender crawler and link checkers can't tell it's a dead link. That's how B1 went unnoticed.setResponseStatus(404) (or createError) when page is nullfixed
B11format.ts:91relativeTime uses Date.now() and the default locale. In a prerendered site, the HTML says "just now" as of build time, and the client rehydrates with a different string and locale, which is a hydration mismatch on every page that shows an age.Render relative times client-only (<ClientOnly> or onMounted ref), keeping the absolute ISO date for SSRwont-fix — Vue's production hydration rewrites the text to the client value and logs once, so the reader sees the right age
B12useIssues.ts:24Only one page of per_page=100 is read, and PRs count toward those 100 before toIssues drops them. Once there are more than 100 open issues+PRs, both the count and the sidebar badge are silently low.Read the Link header and say "100+" (a full fetch costs rate limit), or use /search/issues?q=is:issue to get total_countwont-fix — 17 open issues and PRs against a 100-row page
B13useDeployments.ts:18The default per_page is 30. An environment whose newest deployment isn't among the latest 30 disappears, and its "Open site" button goes with it.Pass environment= per configured environment, or raise per_pagewont-fix — huella-legal records a deployment on every push to master, the portal's own trigger, so its newest is always near the top
B14invariants.ts:71-73compareLayoutBlock compares only the last path segment, so apps/foo and packages/foo hide each other.Compare area/name pairswont-fix — no two project roots share a directory name

Duplication

IDCopiesConsolidate intoStatus
D1Link resolution is written twice, with different regexes: docs.ts:20-56 (isRepoRelative uses [a-z]+:, plus its own line-range strip) vs docLinks.ts:9-12,46-50 (ABSOLUTE, LINE_RANGE, isPlaceholder). B4 is the result.Export the classify/strip step from shared/docLinks.ts and have checkLink call itwont-fix — the copies disagree only on root-absolute hrefs and scheme characters, neither of which occurs here (see B4)
D2Two kindOfs: docs.ts:58 (repo path) and wiki.ts:115 (collection path), with different rules. .claude/agents/*.md comes out as readme in the wiki.One kindOf in shared/, fed toCollectionPath(path) from the collectorwont-fix — the one file affected is .claude/agents/repo-review-card.md, and the cost is its nav icon
D3segmentsOf is in both wiki.ts:106 and docLinks.ts:14One exportwont-fix — a one-line helper is not worth a shared export
D4The vocab check (DECISION_STATUSES as readonly string[]).includes(...) is cast four times, in decisions.ts:54,58 and docs.ts:90-91isDecisionStatus/isDecisionOutcome type guards in shared/decisions.tswont-fix — four casts over two vocabularies; a guard adds no behaviour
D5Repo URL → owner/repo parsing is in github.ts and again inline in projects.vue:29-38. The inline copy doesn't strip .git. The ${repoUrl}/… concatenations in ProseA.vue:16 and projects.vue:24,28 break on a trailing / or .git, and produce relative /actions/… links when it's unset.parseRepo(repoUrl) → { origin, owner, repo } | null in shared/github.ts, used for API URLs, blob links, Actions links and the Pages URLwont-fix — the deploy sets NUXT_PUBLIC_REPO_URL from server_url/repository, never with a trailing / or .git
D6The "first deployment per environment" dedupe is done in useDeployments.ts:19-23 and again in latestDeploymentsExport a newestPerEnvironment from shared/deployments.ts, and let the composable only fetchwont-fix — the composable dedupes to save status requests, and the second pass is then a no-op
D7The GitHub error message is shaped in useIssues.ts:9 (messageOf reads data.message) but not in useDeployments.ts:33, so rate-limit messages differMove messageOf to shared/github.tsfixed
D8git rev-parse for commit and branch runs in both collect/index.ts:23 and metrics.ts:112. MetricsArtifact.commit/branch duplicate the manifest.Pass them in, or drop them from MetricsArtifactwont-fix — two extra rev-parse calls per collect, and nothing reads the copies differently
D9The five try/write/status/log blocks in collect/index.ts:46-113 are copy-pastestep(name, task, summarise) helper, which also gives B8/B9 one place to livewont-fix — refactor only, and B8 and B9, which it would have housed, are wont-fix
D10REVIEWS_DIR is in invariants.ts:9 and scorecards.ts:8. Each review file is read and parseScoresTabled twice (invariants and scorecards). The filename regexes differ (.+ vs [0-9a-f]+), so a review can be checked but not shown.One reviews module that returns { file, date, commit, markdown, parsed } oncewont-fix — repo-review always names a review <date>-<short sha>, which both regexes accept
D11The same queryCollection("docs").select("path","title","description").all() runs under two keys: index.vue:29 and projects.vue:9. Both then build readmeFor(project) with a hand-rolled .toLowerCase() instead of toCollectionPath. The whole collection rides in the Overview payload just to find ~9 READMEs.useProjectReadmes() composable: one key, .where("path","LIKE","%/readme"), toCollectionPathwont-fix — the Overview payload is 85 KB, so the extra rows cost little
D12Project area classification appears three ways: graph.vue:7-20 groups, projects.vue:43,62-70 areaOrder + categoryFor, index.vue:34 featuredProjects. The labels already agree, so it's one table.shared/projects.ts → areaOf(root) with label and orderwont-fix — the three copies agree for every area that exists, so no page places a project differently
D13The "Uses / Used by / No relationships" block is in graph.vue twice (L114-127, L193-211) and in projects.vue (L128-139)<ProjectEdges :project> componentwont-fix — template duplication with no divergence; extracting it changes no behaviour
D14The prev/next card pair is identical in docs/[...slug].vue:100-138 and decisions/id.vue:84-122. The TOC <aside> is also repeated.<PrevNext :previous :next :to> and <PageToc :page>wont-fix — template duplication with no divergence; extracting it changes no behaviour
D15The empty state (big icon, muted line, dimmed hint) is copy-pasted in changelog, decisions, issues, reviews and scorecards. The last two carry the same text.<EmptyState icon title hint>wont-fix — template duplication with no divergence; extracting it changes no behaviour
D16The UDashboardPanel → UDashboardNavbar → #leading <UDashboardSidebarCollapse/> header is repeated verbatim in all 12 pages<PortalPage :title> with a #right slotwont-fix — Nuxt UI's standard dashboard header, identical by design

Quality

IDWhereIssueFixStatus
Q1format.ts:32-44, docs.ts:100, default.vue:72Dead code: categoryIcon/CATEGORY_ICONS are used only by their own spec (left over from the old local todo list); _projectRoots is unused; .replace(/^\//, "/") does nothingDelete all threefixed
Q2kindIcon, severityTone, wiki.ts:185Loose types: kindIcon(kind: string) should take DocKind; severityTone's union should be VulnerabilityAdvisory["severity"]; place() casts segments[0] as SectionId, so a .md under a new top-level directory (e.g. .github/) is silently dropped from the navTighten the two signatures; guard place() or give it an "Other" sectionwont-fix — every tracked .md sits under a section place() knows, and the loose signatures are compile-time only
Q3ProseA.vue:16, projects.vue:21-41, index.vueHard-coded values: blob/master; the project → workflow file / environment table lives in a page; hand-typed wiki routes (/docs/docs/guides/first-hour, /docs/docs/decisions/readme, /docs/docs/reviews/…) skip the known check docs/index.vue:43 doesDerive the branch; move the table to shared/; route the links through knownwont-fix — master is the only default branch, and every hand-typed route resolves today
Q4changelog.vue:8LIKE "%/CHANGELOG" only works because SQLite's LIKE ignores ASCII case, against shared/wiki.ts's rule that nothing compares against a capitalised pathLower-case itwont-fix — SQLite's LIKE ignores ASCII case, so the query matches
Q5tools/collect/docs.ts, tools/collect/metrics.tsCollector performance: docs spawns git log -1 once per file, serially (~110 spawns); metrics spawns about 5 per project, seriallyOne git log --name-only --format=%cI pass, plus Promise.all over projectswont-fix — a whole collect takes about 7 s
Q6run.ts:17tag is on the git allowlist, but git tag <name> writesEnforce --list, or narrow the allowlist's claim to reads onlywont-fix — the allowlist keeps credential-printing subcommands out, and the one tag call passes --list
Q7coverage.ts:32, coverage.ts:132An empty metric is 100 in metric() but 0 in weighted(), and Coverage.vue renders —% for a missing pct. When a report is absent, copyMergedReport leaves the old public/embed/coverage/ in place and the build bakes it inOne rule for an empty metric; clear the embed when there is no reportwont-fix — the deploy runs pnpm test:coverage on a fresh runner first, so the report is always present
Q8scorecards.ts:39, scorecards pageA latest review with parseError still shows a "0/5" Total tile toned bad; the !line.includes("---") row filter also drops a card whose verdict contains ---Render the parse error instead of the tile; match the separator row exactlywont-fix — compareScorecardShape already flags an unparseable review on the Overview, and none fail today
Q9projects.vue, index.vue, graph.vue, docs/index.vue, changelog.vue:89, decisions/index.vue:128Formatting drift: projects.vue packs attributes onto one line; several pages put text at column 0; two are mis-indentedpnpm exec eslint --fix — if it doesn't flag projects.vue, the Vue style rules aren't active for this appwont-fix — lint passes; turning on Vue template style rules is a @joinery/configs change, outside this app
Q10useSnapshot("docs") in the decisions pagesThe decisions pages pull the whole docs.json (every page plus its broken links) to show ~20 rowsA decisions projection in the snapshot endpointwont-fix — the decisions list payload is 41 KB

Order

  1. B1, B2, B10: user-visible broken links, plus the 404 that would have caught them.
  2. B3–B9: collector correctness. D1, D9 and D10 fall out of these fixes.
  3. B11–B14.
  4. D2–D8 (shared/ and tools/ consolidation), then D11–D16 (app components and composables).
  5. The Quality findings.

Checks once the first two steps land: pnpm exec nx collect @joinery/developer-portal && pnpm exec nx build-static @joinery/developer-portal, then grep -o 'href="/reviews/[^"]*"' .output/public/scorecards/index.html shows no .md (B1), and no .output/public/reviews/<id>/index.html contains "No such review".